use Net::Cisco;
$t =Net::Telnet::Cisco->new(Host=>'192.168.2.1');
$t->login('919', 'password');
@output=$t->cmd("show runn");
open(CONFIG,">config.txt");
print CONFIG "@output\n";
close(CONFIG);
$t->close;
The above code can telnets into a Cisco device and and executes a command "show runn" and writes that output to file config.txt
I didn't include any success and failure control statements,please comment..if u need any further information
No comments:
Post a Comment