use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host => '192.168.1.1');
$session->login('xxx', 'xxx');
# Execute a command
my @output = $session->cmd('show version');
print @output;
# Enable mode
if ($session->enable("enable_password") ) {
@output = $session->cmd('show privilege');
print "My privileges: @output\n";
} else {
warn "Can't enable: " . $session->errmsg;
}
$session->close;
Mar 25, 2009
perl telnet cisco router script
Subscribe to:
Post Comments (Atom)
0 意見:
Post a Comment