IvanAK has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, im new in perl and i love it and trying to learn from the beginning, but the time is the worst enemy and i need help with one little program that i start and now im trying to improve it. So here is what i have for now:
use Net::Telnet::Cisco; for ($i = 1; $i <= 254; $i++){ $device = "10.10.$i.1"; my $session = Net::Telnet::Cisco->new(Host => "$device", Input_log => "perllogrouter/router$i.log", ); $session->login('admin', 'admin'); $session->cmd('conf t'); @output = $session->cmd ('some command'); $session->close; }
So my problem or improvement that i want to make is, I have some routers that have different password and on some they dont ask for username,just password. So how can i improve this ... any suggestions or examples ??? hhhmmm and also im not having all subnet active,/i mean, for example 10.10.50.1 is not active, it doesn't exist, also 10.10.66.1 doesn't exist etc. Tnx in advanced
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Telnet Cisco routers
by Illuminatus (Curate) on Apr 11, 2013 at 20:42 UTC | |
by IvanAK (Acolyte) on Apr 14, 2013 at 15:13 UTC | |
by IvanAK (Acolyte) on Apr 16, 2013 at 20:48 UTC | |
by Illuminatus (Curate) on Apr 18, 2013 at 15:34 UTC | |
by IvanAK (Acolyte) on Apr 24, 2013 at 19:54 UTC |
Back to
Seekers of Perl Wisdom