Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Cisco > Perl script to issue IOS commands and save to local files from a given IP list

Reply
Thread Tools

Perl script to issue IOS commands and save to local files from a given IP list

 
 
aung.naingoo@gmail.com
Guest
Posts: n/a
 
      05-05-2007
Can anybody point to a perl script that can issue IOS commands and
save to local files from a given IP list. I am currently using one of
the perl scripts and it doesn't have an error checking. So, whenever
the remote device from a given IP list is not respond, it stop. It
would be good to have a script that can skip the non-responding IP,
log the non-responding IPs, and continue with the rest of the IPs in
the given list.

Below is the script that I am currently using:

#!/usr/bin/perl -w
use Net::Telnet::Cisco;
@devices = `cat my_devices_ip_list.txt`;
foreach my $device (@devices) {
chomp($device);
my $session = Net::Telnet::Cisco->new(Host => $device);
$session->login('my_user_name','my_password');
$session->enable("my_enable_password");
@ver = $session->cmd("sh ver");
open LOG, "> $device.conf";
select LOG;
print @ver;
close LOG;
}

 
Reply With Quote
 
 
 
 
Phillip Remaker
Guest
Posts: n/a
 
      05-09-2007
Have you looked at Cisco Beyond?

http://forums.cisco.com/eforum/servlet/EEM?page=main

and Cosi-nms?

http://cosi-nms.sourceforge.net/alpha-progs.html

Good source for some scripts you may want to hack on.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue in executing more than one perl script from Single perl script nilesh.sonawane@gmail.com Perl Misc 3 11-01-2007 06:19 PM
instructions on how to perform an IOS upgrade on a Catalyst 6500 switch (IOS to IOS) Mike Rahl Cisco 1 05-30-2007 05:22 PM
Days in a given date range for a given month......... Lord0 Java 1 04-19-2006 04:54 PM
command to list ALL the commands within Cisco IOS 12.1 JohnNews Cisco 1 11-24-2003 01:20 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments