junoscript-perl

 view release on metacpan or  search on metacpan

README.html  view on Meta::CPAN

	<tt>% tar zxf junoscript-<i>n.n</i>-<i>type</i>.tar.gz</tt> 
	<br />
	<br /> 
	On Solaris systems:
	<br />
	<tt>% gzip -dc junoscript-<i>n.n</i>-<i>type</i>.tar.gz | tar xf -</tt>
	<br />&nbsp;
	</li>
	
	<span class="bullet"><li></span>
	Change to the JUNOScript directory.
	<br />
	<tt>% cd junoscript-<i>n.n</i></tt>
	<br />&nbsp;
	</li>
	
	<span class="bullet"><li></span>
	Download the gzip archive of the prerequisite library and modules from
	the Juniper Networks Web site in a directory called <tt>prereqs</tt>,  
	<b>which must be directly under the <tt>junoscript-<i>n.n</i></tt> directory</b>.
	The archive is named 
	<tt>junoscript-prereqs-<i>n.n</i>-<i>type</i>.tar.gz</tt> where
        <tt><i>n.n</i></tt> is a release code such as 5.1 and
        <tt><i>type</i></tt> is either <tt>export</tt> or <tt>domestic</tt>. For instructions, 
	see <a href="#downloads">Download</a>.
	<br />&nbsp;
	</li>
	
	<span class="bullet"><li></span>
	Unzip and untar the archive.
	<br />
	<br />
	On FreeBSD and Linux systems:
	<br />
	<tt>[/my/junoscript-<i>n.n</i>]% tar zxf </tt>
    	<tt>junoscript-prereqs-<i>n.n</i>-type.tar.gz</tt>
	<br />
	<br />
	On Solaris systems:
	<br />
	<tt>[/my/junoscript-<i>n.n</i>]% gzip -dc junoscript-prereqs-<i>n.n</i>-type.tar.gz | tar xf -</tt>
	<br />&nbsp;
	</li>
	
	<span class="bullet"><li></span>
	Install the required C binaries and Perl modules. If you wish to 
	install the required files in your private directory instead of the 
	standard directory, you can use the <tt>-install_directory</tt> option to 
	specify your private installation directory. The standard directory 
	is the installation directory configured in the perl executable.  
	Usually, the standard directory is <tt>/usr/lib</tt> or <tt>/usr/local/lib</tt>, and
	you'll need root privilege to install modules in these directories.
	<br />
	<br />
	<i>If installing modules under the standard directory (normally /usr/local/lib and you'll need root privilege):</i>
	<br />
	<tt>[/my/junoscript-<i>n.n</i>]% perl install-prereqs.pl -force</tt>
	<br />
	<br />
	<i>Installing modules under your own private directory</i> (see <a href="#notes01">notes</a> below):<br />
	<tt>[/my/junoscript-<i>n.n</i>]% setenv PERL5LIB /my/private/directory/lib<br /></tt>
	<tt>[/my/junoscript-<i>n.n</i>]% setenv MANPATH "$MANPATH/:$PERL5LIB/../man" <br /></tt>
	<tt>[/my/junoscript-<i>n.n</i>]% setenv PATH "$PATH/:$PERL5LIB/../bin" <br /></tt>
	<tt>[/my/junoscript-<i>n.n</i>]% perl install-prereqs.pl -install_directory $PERL5LIB -force</tt>
	
	<br />
	<br />
	As the <tt>install-prereqs.pl</tt> script installs the last few modules, 
	it prompts you for input. Simply following the instructions and 
	accept default responses whenever they are offered. The only 
	exception is during installation of the SSH module: here you 
	must choose one of the cipher packages supported by the JUNOScript 
	server-- DES, DES3 or Blowfish. 
	<br />
	<br />
	The option <tt>-force</tt> forces <tt>install-prereqs.pl</tt> to install 
	a module even if an older version already exists or <tt>make test</tt>
	fails. For more information on the <tt>install-prereqs.pl</tt> options, type 
	<tt>perl install-prereqs.pl -help</tt>.<br />&nbsp;</li>
	
	<span class="bullet"><li></span>
	Create JUNOS::Device makefile.
	
	<br /><br />
	<i>If installing JUNOS::Device under the standard directory (it's normally /usr/local/lib):</i><br />
	<tt>[/my/junoscript-<i>n.n</i>]% perl Makefile.PL</tt>
	
	<br /><br />
	<i>If installing JUNOS::Device under your own private directory:</i><br />
	<tt>[/my/junoscript-<i>n.n</i>]% perl Makefile.PL LIB=$PERL5LIB INSTALLMAN3DIR=$PERL5LIB/../man/man3</tt><br />&nbsp;

	</li>
	
	<span class="bullet"><li></span>

	Test and install the JUNOS::Device module.
	
	<br /><br />
	<tt>[/my/junoscript-<i>n.n</i>]% make<br />
	[/my/junoscript-<i>n.n</i>]% make test<br />
	[/my/junoscript-<i>n.n</i>]% make install</tt><br />&nbsp;

	</li>
	
	</ol>


<p>
<a name="notes01">Notes</a> for private directory installation:</p>

<ul class="bcopy">
<span class="bullet"><li></span>

If you are installing the JUNOScript modules in a private directory, 
remember to set <tt>PERL5LIB</tt>, <tt>MANPATH</tt>, and <tt>PATH</tt> 
environment variables
before installing the Perl modules and running the examples.  
If the <tt>PERL5LIB</tt> variable is set, perl will first look 
for Perl modules in the 
specified directory before looking in the standard directory.  (If you're
using sh, ksh or bash, use <tt>EXPORT</tt> instead of <tt>setenv</tt>.)
<br />
<br />
<tt>
% setenv MANPATH "$MANPATH/:$PERL5LIB/../man"
<br />
% man JUNOS::Device
<br />
% setenv PATH "$PATH/:$PERL5LIB/../bin"
<br />
% which xsltproc
</tt>

<br />&nbsp;

</li>
</ul>


<!----------------------------------- ----------------------------------->

<br />&nbsp;<a href="#"><img src="to_topg.gif" alt="Back to Top" border="0" width="62" height="13" /></a>
<a name="examples">&nbsp;</a>

<p>
<span class="l2">Running the Sample Scripts </span><br />

<p>
The JUNOScript Perl distribution includes sample scripts that demonstrate how to use JUNOScript to retrieve and change the configuration of a Juniper Networks router. The samples reside in the 
<tt>junoscript-<i>n.n</i>/examples</tt> directory.</p>

<p>
<span class="l3">Reading configuration: Chassis Inventory</span><br />

This example sends a <tt>&lt;get-chassis-information&gt;</tt> request to the Juniper Networks router and displays the result to the standard output. Depending on the 
command line option, it uses XSLT to display the result in plain text, HTML, or raw XML. The purpose of this example is to show the power and flexibility of combining the 
JUNOScript and XSLT.</p>

<ol class="bcopy">
<span class="bullet"><li></span>Change directory to <tt>examples/get_chassis_inventory</tt>.<br />
<tt>[/my/junoscript-<i>n.n</i>]% cd examples/get_chassis_inventory</tt><br />&nbsp;</li>

<span class="bullet"><li></span>Run the script <tt>get_chassis_inventory.pl</tt>.<br />
<tt>[/my/junoscript-<i>n.n</i>/examples/get_chassis_inventory]% perl get_chassis_inventory.pl [-d] [-o &lt;outputfile&gt;]
[-x &lt;xslfile&gt;] [-m &lt;access&gt;] 
[-l &lt;login&gt;] [-p &lt;password&gt;] &lt;router&gt;</tt></li></ol>


<p>
<span class="l3"><i>Example:</i></span><br />

<tt>[/my/junoscript-<i>n.n</i>/examples/get_chassis_inventory]% perl get_chassis_inventory.pl router11<br />
login: johndoe<br />
password:</tt></p>

<p>
<span class="l3"><i>Where:</i></span><br />

<tt>-d</tt><br />
Optional. The default is debug off. If this flag is present, all debugging statements from the JUNOS modules will be sent to standard output.</p>

<p>
-x &lt;xslfile&gt;<br />
-o &lt;outputfile&gt;<br />
Optional.&nbsp; If &lt;xslfile&gt; is specified, the &lt;xslfile&gt; is used for rendering the output.&nbsp;
If &lt;xslfile&gt; is
not specified, xsl/chassis_inventory_csv.xsl is used by default.&nbsp; You can
use any of the three XSL files (csv, html, and xml) or create your own.&nbsp; If 
&lt;outputfile&gt; is specified, the transformation will be put into &lt;outputfile&gt;. If &lt;outputfile&gt; is not specified,

README.html  view on Meta::CPAN

	
	<span class="bullet"><li></span>Use RDB tools to manipulate the data as desired.<br />&nbsp;</li>
	
	<span class="bullet"><li></span>Regenerate XML from your database:<br />
	<tt>[/my/junoscript-<i>n.n</i>/examples/RDB]% perl unpop_tables.pl jun_configuration 1 &gt; config.xml</tt></li></ol>


<!-----------------------------------  ----------------------------------->

<br />&nbsp;<a href="#"><img src="to_topg.gif" alt="Back to Top" border="0" width="62" height="13" /></a>
<a name="perl">&nbsp;</a>

<p class="l2">Installation of PERL</p>

<ol class="bcopy"><b>UNIX</b>
<span class="bullet"><li></span>Retrieve the perl source package (http://cpan.org/src/stable.tar.gz)<br />&nbsp;</li>

<span class="bullet"><li></span>Install the stable.tar.gz.

<br /><br />
FreeBSD and Linux:<br />
<tt>% tar zxf</tt> stable.tar.gz

<br /><br />
Solaris:<br />
<tt>% gzip -dc</tt> stable.tar.gz <tt>| tar xf -</tt>

<br /><br />
Follow instruction in perl-5.6.1/INSTALL to install perl. You can make your private directory the standard directory for installation, then the perl executables and any 
Perl modules you install will automatically go to the directory you specified. Otherwise, take the defaults and the executables and modules will be installed under 
/usr/local.</li></ol>


<!-----------------------------------  ----------------------------------->

<br />&nbsp;<a href="#"><img src="to_topg.gif" alt="Back to Top" border="0" width="62" height="13" /></a>
<a name="example_perlmod">&nbsp;</a>

<p>
<span class="l2">Installation of Perl Modules Required by Examples</span>

<p>
You can tell install-prereqs.pl to install only the modules required by JUNOS::Device or by a specific example. By default install-prereqs.pl install all required modules 
for JUNOS::Device, get_chassis_inventory.pl, load_configuration.pl and diagnose_bgp.pl. The RDB installation is kept separate because it required the installation of a RDB. 
This section shows you how to specify which set of modules to install.</p>

	<ol class="bcopy"><b>UNIX</b>
	<span class="bullet"><li></span>Go to the junoscript directory.<br />
	<tt>% cd junoscript-<i>n.n</i></tt><br />&nbsp;</li>
	
	<span class="bullet"><li></span>Install the Perl modules required by the specific example. If you wish to install the required files in your private directory instead 
	of the standard directory, you can use the -install_directory option to specify your private installation directory. The standard directory is the installation 
	directory configured in the perl executable.
	
	<br /><br />
	<i>Installing modules under the standard directory (it's normally /usr/local/lib and you'll need root privilege):</i><br />
	<tt>[/my/junoscript-<i>n.n</i>]% perl install-prereqs.pl -used_by &lt;example&gt; -force</tt>
	
	<br /><br />
	<i>Installing modules under your own private directory</i> (see <a href="#notes02">notes</a> below):<br />
	<tt>[/my/junoscript-<i>n.n</i>]% setenv PERL5LIB /my/private/directory/lib<br />
	[/my/junoscript-<i>n.n</i>]% perl install-prereqs.pl -used_by &lt;example&gt; -install_directory $PERL5LIB -force</tt>
	
	<br /><br />
	Where &lt;example&gt; is get_chassis_inventory, load_configuration, RDB, diagnose_bgp, or JUNOS::Device. If the -used_by option is not used, the default is to install 
	all required modules except those required by RDB. The reason required modules for RDB is not part of the default installation is because it requires an RDB being 
	installed first.
	
	<br /><br />
	When install-prereqs.pl is installing Term::ReadKey, it will prompt user for inputs.
	
	<br /><br />
	The option -force forces install-prereqs.pl to install the module even if an older version already exists or 'make test' fails. For more information on the 
	install-prereqs.pl options, type 'perl install-prereqs.pl -help'.</li></ol>


<p>
<a name="notes02">Notes</a> for private directory installation:</p>

<ul class="bcopy">
<span class="bullet"><li></span>Remember to set PERL5LIB before installation of the Perl modules and running the examples. PERL5LIB is an environment variable, it can be 
set to a colon-separated list of directories. If set, perl will first look for Perl modules in the PERL5LIB directories before looking in the standard directory. The 
instruction above uses the csh syntax for setting environment variable. For sh, ksh and bash, use EXPORT PERL5LIB=/my/private/directory/lib.<br />&nbsp;</li>
</ul>


<!-----------------------------------  ----------------------------------->

<br />&nbsp;<a href="#"><img src="to_topg.gif" alt="Back to Top" border="0" width="62" height="13" /></a>
<a name="dependencies">&nbsp;</a>

<p>
<span class="l2">Dependencies</span><br />

<p>
When you run the install script, you'll see the list of C libraries, 
executables, and Perl modules required by JUNOS::Device and its examples.
The only module that the install script does not address is the mysql
distribution.  To run the RDB example, you must first install mysql
before running the installation for RDB.
</p>
<p>
If you wish to find out what are missing dependencies on your system without running the install script, you can run the following commands.
</p>
<p>
<ul><tt>perl required-mod.pl</tt></ul>
<br />
<br />

<!-----------------------------------  ----------------------------------->

<br />&nbsp;<a href="#"><img src="to_topg.gif" alt="Back to Top" border="0" width="62" height="13" /></a>
<a name="faq">&nbsp;</a>

<p>
<span class="l2">FAQ</span>

<ol class="bcopy"><b>Installation</b><br /><br />

<span class="bullet"><li></span>
The installation of Math::Pari failed. When I looked into the 



( run in 1.696 second using v1.01-cache-2.11-cpan-39bf76dae61 )