INDEX | About Me | Private Projects | Hobbies/Science-Toys | From my keyboard / IT
[Go to Articles Index] | [Go to IT Articles INDEX]

How to connect Juniper Netscreen with a Perl Script:

           The site http://search.cpan.org contains a usable and easy library to connect netscreen devices. Name of the library is Net::Telnet::Netscreen. Its use is straightforward:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/usr/bin/perl
use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
                  Prompt => '/ns5gt-adsl->/');
 
$t->open("IP_ADDR_of_NetscreenDevice");
$t->login(netscreenUsername, Password);
 @lines = $t->cmd("get policy id X");
print @lines;
$t->cmd("exit");
$t->cmd("exit");

           IP_ADDR_of_NetscreenDevice, netscreenUsername and Password expressions can be replaced with an address, an username and a password, respectively.

One of the copies of this article located here: Practical Code Solutions: How to Connect Juniper Netscreen Device using Perl Scripts
My Personal Web Page - ReNewing period...