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

Discussion in 'Cisco' started by aung.naingoo@gmail.com, May 5, 2007.

  1. Guest

    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;
    }
    , May 5, 2007
    #1
    1. Advertising

  2. Phillip Remaker, May 9, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mkinsman

    NAS Perl/CGI Script

    mkinsman, Nov 23, 2003, in forum: Cisco
    Replies:
    0
    Views:
    556
    mkinsman
    Nov 23, 2003
  2. JohnNews
    Replies:
    1
    Views:
    807
    Walter Roberson
    Nov 24, 2003
  3. tomviolin
    Replies:
    9
    Views:
    1,081
    Richard Graves
    Apr 26, 2005
  4. Runar Furenes

    Writing a simple cgi-script with perl

    Runar Furenes, Jul 22, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    799
  5. business one way

    Is it a Perl program or a Perl script?

    business one way, Jan 5, 2008, in forum: Digital Photography
    Replies:
    0
    Views:
    690
    business one way
    Jan 5, 2008
Loading...

Share This Page