Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Installing the NETCONF Perl Client and Prerequisites Package

To install the NETCONF Perl client and the prerequisites package, perform the following procedures:

Verifying the Installation and Version of Perl

Perl must be installed on your system before you install the NETCONF Perl client prerequisites package or client software. The NETCONF Perl client requires Perl version 5.6.1 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 that the version is earlier than the required version, you must download and install Perl version 5.6.1 or later in order to use the NETCONF Perl client. The Perl source packages are located at:

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

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

Extracting the NETCONF Perl Client and Sample Scripts

To uncompress and extract the contents of the compressed tar archive that contains the NETCONF Perl client and sample scripts:

  1. Create the directory where you want to store the NET::Netconf Perl client application and sample scripts, move the downloaded client application file into that directory, and then make that directory the working directory.
    $ mkdir parent-directory$ mv netconf-perl-release.tar.gz parent-directory$ cd parent-directory
  2. Uncompress and extract the contents of the NETCONF Perl client package:
    • On FreeBSD and Linux systems:
      $ tar zxf netconf-perl-release.tar.gz
    • On Solaris systems:
      $ gzip -dc netconf-perl-release.tar.gz | tar xf

where release is the release code, for example 10.4R2.6. The command creates a directory called netconf-perl-release and extracts the contents of the tar archive to it. For example, a typical filename for the compressed tar archive is netconf-perl-10.4R2.6.tar.gz. Extracting the contents of this archive creates the directory netconf-perl-10.4R2.6 directly under parent-directory and places the application files and sample scripts into this new directory.

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

Extracting and Installing the NETCONF 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 NETCONF Perl client and the included examples to work correctly. The NETCONF Perl distribution includes the install-prereqs.pl script, which you use to install the prerequisites. Starting with Junos OS Release 11.4, you have the option to install all Perl modules that are part of the prerequisites directly from the Comprehensive Perl Archive Network (CPAN) global repository.

To uncompress and extract the contents of the compressed tar archive containing the prerequisite files:

  1. Move the downloaded prerequisites package into the parent-directory/netconf-perl-release/ directory that was created in Extracting the NETCONF Perl Client and Sample Scripts.

    The compressed tar archive containing the prerequisite files must be uncompressed, unpacked, and installed in that directory.

  2. Uncompress and extract the contents of the package:
    • On FreeBSD and Linux systems:
      $ tar zxf netconf-perl-prereqs-release.tar.gz
    • On Solaris systems:
      $ gzip -dc netconf-perl-prereqs-release.tar.gz | tar xf

where release is the release code, for example 10.4R2.6. 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, which is /usr/local/lib/. You can opt to install the modules in a private directory.

  • To install the required modules in the standard directory:
    1. Log in as root.
    2. Go to the netconf-perl-release/ directory where you extracted the contents of the prerequisites package.
    3. 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 earlier version of the module 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.
      $ 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

    2. Go to the netconf-perl-release directory where you extracted the contents of the prerequisites package.
    3. 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 earlier version of the module 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.

Starting with Junos OS Release 11.4, after issuing the perl install-prereqs.pl command, the script provides the option to install the prerequisites from CPAN. The CPAN module is included with standard Perl installations. If you choose to install from CPAN, the script checks that the CPAN module is installed on your system and that you have connectivity to http://www.cpan.org. If the CPAN module is present and connectivity is verified, installation begins automatically.

  1. To install from CPAN, press Enter or type 'y' when prompted.
    # perl install-prereqs.pl
    This script installs all modules required by default.
    Would you like to install the pre-requisite modules from CPAN? [y]/n y
    Testing MCPAN on your system...
    OK
    Trying to ping CPAN
    OK
    These modules will be installed in the system directory.
    
    This installation takes around 15 minutes
    
    Begin automatic installation:
    <output omitted>

You might be prompted for additional information during the installation. For example, if additional dependent modules are required for a specific module, the installer might ask if the missing modules should be added to the install queue.

Note: On some systems, the firewall might reject utilities that are set to use active FTP, and CPAN installation might hang. If this is an issue, set the corresponding environment variable so that passive FTP is enabled.

Installation log files are written to netconf-perl-release/tmp/output/. After installation, you can view any missing dependencies by issuing the following command:

$ perl required-mod.pl

This command lists the modules that still require installation.

Installing the NETCONF Perl Client

After installing the prerequisites package as detailed in Extracting and Installing the NETCONF Perl Client Prerequisites Package, install the NETCONF Perl client software.

To install the client software:

  1. Go to the netconf-perl-release/ directory that was created in Extracting the NETCONF Perl Client and Sample Scripts.
  2. Create the makefile.
    • To install the Perl client in the standard directory (usually /usr/local/lib):
      # perl Makefile.PL
      Checking if your kit is complete...
      Looks good
      Writing Makefile for netconf-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 Extracting and Installing the NETCONF Perl Client Prerequisites Package, and create the makefile:

      # perl Makefile.PL LIB=$PERL5LIB INSTALLMAN3DIR=$PERL5LIB/../man/man3
  3. Install the Net::NETCONF module:
    # make# make install

The NETCONF Perl client application is installed and ready for use. For information about the Net::NETCONF::Manager, Net::NETCONF::Transform, or Net::NETCONF::Trace classes, consult the appropriate man page by invoking the man command and specifying the class. For example:

$ man Net::NETCONF::Manager$ man Net::NETCONF::Transform$ man Net::NETCONF::Trace

The sample scripts reside in the netconf-perl-release/examples/ directory. You can review and run these examples to acquire some familiarity with the client before writing your own applications.

Published: 2013-07-26

Published: 2013-07-26