Thursday, September 22, 2011

How to Connect Juniper Netscreen Device using Perl Scripts

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

use Net::Telnet ();
$t = new Net::Telnet (Timeout => 10,
Prompt => '/ns5gt-adsl->/');

$t->login(netscreenUsername, Password);
@lines = $t->cmd("get policy id X");
print @lines;

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

No comments:

Post a Comment