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:

% which perl% perl -v

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:

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:

  1. 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.
  2. 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

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 view any missing dependencies, issue the following command:

% perl required-mod.pl

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:

  1. Create the makefile:
    • To install the Perl client in the standard directory (generally /usr/local/lib):
      % perl Makefile.pl
      Checking 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
  2. 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:

% man JUNOS::Device

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.