in reply to copy run tftp on cisco router using net::snmp
#!/usr/bin/perl use Net::Telnet; my $dow = `date '+%w' --date '1 days ago'`; my $router = "IP_OF_ROUTER"; my $user = "username"; my $pass = "password"; my $enable = "enable_password"; my $tftp_server = "IP_OF_SERVER"; my $t = new Net::Telnet(Timeout => 10); $t->open( $router ); $t->waitfor( '/Username:/' ); $t->print( "$user" ); sleep 2; $t->waitfor( '/Password:/' ); $t->print( "$pass" ); sleep 2; $t->print( "enable" ); $t->waitfor( '/Password:/' ); $t->print( "$enable" ); sleep 2; $t->print( "copy startup-config tftp" ); sleep 2; $t->print( "$tftp_server" ); sleep 2; $t->print( "router.$dow" ); sleep 3; $t->print( "quit" ); exit( 0 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: copy run tftp on cisco router using net::snmp
by c (Hermit) on Aug 09, 2001 at 16:47 UTC |