Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Install the Junos XML Protocol Perl Client and Prerequisites Package

To install the Junos XML protocol Perl client and the prerequisites package, perform the following procedures:

Verifying Installation and Version of Perl

Perl must be installed on your system before you install the Junos XML protocol Perl client prerequisites package or 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 must download and install Perl version 5.0004 or later in order to use the Junos XML protocol Perl client. The Perl source packages are located at:

http://www.cpan.org/src/.

After installing a suitable version of Perl, extract the Junos XML protocol Perl client, extract and install the prerequisites package, and then install the Junos XML protocol Perl client application.

Extracting the Junos XML Protocol Perl Client and Sample Scripts

To uncompress and extract the contents of the compressed tar archive that contains the Junos XML protocol Perl client and sample scripts, perform the following steps:

  1. Create the directory where you want to store the Junos XML protocol Perl client application and sample scripts, and move the downloaded client application file into this directory. Then make this directory the working directory:
  2. Issue the following command to uncompress and extract the contents of the Junos XML protocol Perl client package:
    • On FreeBSD and Linux systems:

    • On Solaris systems:

where release is the release code, for example 20.4R1.1, and type is domestic or export.

Step 2 creates a directory called junoscript-perl-release and extracts the contents of the tar archive to it. For example, a typical filename for the compressed tar archive is junoscript-perl-9.5R1.8-domestic.tar.gz. Extracting the contents of this archive creates the directory junoscript-perl-9.5R1.8 directly under parent-directory and places the application files and sample scripts into this new directory.

The junoscript-perl-release/README file contains instructions for extracting and installing the Perl prerequisite modules, creating a Makefile, and installing and testing the JUNOS::Device module.

Extracting 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 in order for the Junos XML protocol Perl client and the included examples to work correctly. To uncompress and extract the contents of the compressed 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 Extracting the Junos XML Protocol Perl Client and Sample Scripts. The compressed tar archive containing the prerequisite files must be uncompressed, unpacked, and installed in this directory.
  2. Issue the following command to uncompress and extract the contents of the package:
    • On FreeBSD and Linux systems:

    • On Solaris systems:

where release is the release code, for example 20.4R1.1, and type is domestic or export. This command creates a directory called prereqs/ and extracts the contents of the tar archive 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:

    1. Go to the junoscript-perl-release/ directory where you extracted the contents of the prerequisites package.

    2. Issue the following command:

      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.

  • To install the required modules in a private directory:

    1. Set the PERL5LIB, MANPATH, and PATH environment variables.

      For sh, ksh, and bash shells, $PERL5LIB can be set with EXPORT PERL5LIB=private-directory-path

    2. Go to the junoscript-perl-release directory where you extracted the contents of the prerequisites package.

    3. Issue the following command:

      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.

Installation log files are written to junoscript-perl-release/tmp/output/. After installation, you can view any missing dependencies by issuing 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 Extracting and Installing the Junos XML Protocol Perl Client Prerequisites Package, install the Junos XML protocol Perl client software. Go to the junoscript-perl-release/ directory that was created in Extracting the Junos XML Protocol Perl Client and Sample Scripts. Perform the following steps to install the client software:

  1. Create the makefile:

  2. Test and install the application:

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 the junoscript-perl-release/examples/ directory. You can review and run these examples to acquire some familiarity with the client before writing your own applications.