in reply to Re: Cisco Telnet
in thread Cisco Telnet
i would like if its possible to write in the log file the error form eval in this code. From "perllogrouter/router$i.log"the eval error to be put there if its possible.
eval { my $session = Net::Telnet::Cisco->new(Host => "$device", Input_log => "perllogrouter/router$i.log", ); $session->login(Password => $curpwd); if ($session->enable("$curpwd")) { # Execute a command @output = $session->cmd ('show running-config | section hostname') +; print "@output\n"; print " ======================================================\n"; } $session->close; }; if ($@) {print "Error: $@\n"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Cisco Telnet
by mvip (Acolyte) on Aug 27, 2013 at 16:18 UTC |