Installing the Prerequisites Package and the Junos XML Protocol Perl Client
Perl must be installed on your system before you install the prerequisites package or the client software. The Junos XML protocol Perl client requires Perl version 5.0004 or later. To confirm whether Perl is installed on your system and to determine which version of Perl is currently running, issue the following commands:
If the issued output indicates that Perl is not installed or the version is older than the required version, you need to download and install the Perl source package located at http://www.cpan.org/src/stable.tar.gz .
After installing a suitable version of Perl, unpack and install the prerequisites package. Then install the Junos XML protocol Perl client application. These procedures are detailed in the following sections:
- Unpacking and Installing the Junos XML Protocol Perl Client Prerequisites Package
- Installing the Junos XML Protocol Perl Client
For additional information, consult the README file that is included with the client distribution. It is located in the parent-directory/junoscript-perl-release/ directory.
Unpacking and Installing the Junos XML Protocol Perl Client Prerequisites Package
The prerequisites package consists of C libraries, executables, and Perl modules. It must be installed on the client machine for the Junos XML protocol Perl client and the included examples to work correctly. To uncompress and unpack the gzip tar archive containing the prerequisite files, perform the following steps:
- Move the downloaded prerequisites package into
the
parent-directory/junoscript-perl-release/directory that was created in Step 2 of Unpacking the Junos XML Protocol Perl Client and Sample Scripts. The gzip tar archive containing the prerequisite files must be uncompressed, unpacked, and installed in this directory. - Issue the following command to uncompress and unpack
the package:
- On FreeBSD and Linux systems:% tar zxf junoscript-perl-prereqs-release-type.tar.gz
- On Solaris systems:% gzip -dc junoscript-perl-prereqs-release-type.tar.gz | tar xf
- On FreeBSD and Linux systems:
where release is the release code
(e.g. 10.3R1.1) and type is domestic or export. This command creates a
directory called prereqs/ and writes
the contents of the package to it.
By default, the prerequisite Perl modules are installed in the
standard directory. The standard directory is normally /usr/local/lib/. You need root privileges to access
the standard directory. You can opt to install the modules in a private
directory.
- To install the required modules in the standard directory:
- Go to the
parent-directory/junoscript-perl-releasedirectory where you unpacked the prerequisites package. - Issue the following command:% perl install-prereqs.pl -used_by example -force
where the -used_by example option is invoked to install only modules used by a specific example, and the -force option installs the module even if an older version exists or if the make test command fails.
- Go to the
- To install the required modules in a private directory:
- Set the PERL5LIB, MANPATH, and PATH environment variables.% setenv PERL5LIB private-directory-path% setenv MANPATH "$MANPATH/:$PERL5LIB/../man"% setenv PATH "$PATH/:$PERL5LIB/../bin"
For sh, ksh, and bash shells, $PERL5LIB can be set with EXPORT PERL5LIB=private-directory-path
- Go to the
parent-directory/junoscript-perl-releasedirectory where the prerequisites package was unpacked: - Issue the following command:% perl install-prereqs.pl -used_by example -install_directory $PERL5LIB -force
where the -used_by example option is invoked to install only modules used by a specific example, and the -force option installs the module even if an older version exists or if the make test command fails. The -install_directory $PERL5LIB option installs the prerequisite Perl modules in the private directory that you specified in Step 1.
- Set the PERL5LIB, MANPATH, and PATH environment variables.
To view any missing dependencies, issue the following command:
This command lists the modules that still require installation.
Installing the Junos XML Protocol Perl Client
After installing the prerequisites package as detailed in Unpacking and Installing the Junos XML Protocol Perl Client
Prerequisites Package, install
the Junos XML protocol Perl client software. Go to the parent-directory/junoscript-perl-release/ directory that was created in Step 2 in Unpacking the Junos XML Protocol Perl Client and Sample Scripts. Perform
the following steps to install the client software:
- Create the makefile:
- To install the Perl client in the standard directory (generally
/usr/local/lib):% perl Makefile.plChecking if your kit is complete... Looks good Writing Makefile for junoscript-perl
- To install the Perl client in a private directory:
Make sure that the PERL5LIB, MANPATH, and PATH environment variables are set as detailed in Unpacking and Installing the Junos XML Protocol Perl Client Prerequisites Package. Then create the makefile:
% perl Makefile.PL LIB=$PERL5LIB INSTALLMAN3DIR=$PERL5LIB/../man/man3
- To install the Perl client in the standard directory (generally
- Test and install the application:% make% make test% make install
The Junos XML protocol Perl client application is installed and ready for use. For information about the JUNOS::Device object and a list of valid queries, consult the man page by invoking the man command for the JUNOS::Device object:
The sample scripts reside in parent-directory/junoscript-perl-release/examples/. You can review and
run these examples to acquire some familiarity with the client before
writing your own applications.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1