![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux LiveCD Router 2.0.27 (Default Router branch) | iBot | Software Releases - RSS News | 0 | 05-14-2008 04:30 PM |
| Linux LiveCD Router 2.0.26 (Default Router branch) | iBot | Software Releases - RSS News | 0 | 03-03-2008 02:00 AM |
| SSH to Router in Script | earnstaf | Shell Programming and Scripting | 0 | 07-17-2007 10:42 AM |
| DSL Router | praveenk | UNIX for Advanced & Expert Users | 9 | 08-29-2002 02:19 PM |
| router | matt2kjones | Security | 1 | 07-18-2002 01:08 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Script to run on a router
I want to make a Perl script to telnet to a router and apply commands, and get the output of the commands in a file.
Can any one help me in that? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Can't any one help me, I find the script to login to router but the issue is to redirect the output of commands to a file.
#!/usr/local/bin/perl # use Net::Telnet (); $machine = '1.1.1.1'; $logfile = "cisco.log"; $t = new Net::Telnet (Timeout => 10); $t->input_log($logfile); $t->open($machine); print "Connected to $machine\n"; $t->waitfor('/Username: $/'); $t->print("cisco"); $t->waitfor('/Password: $/'); $t->print("cisco"); $t->prompt('/LTD-INC>/'); $t->cmd("enable"); $t->waitfor('/Password: $/'); $t->print("cisco"); $t->prompt('/LTD-INC#/'); $t->cmd("show run"); ????????????????????? This is what I don't know ????????????????? print "Logged in successfully.\n"; print "Collecting informations"; print "done.\n"; print "Most heavy connection/s :\n" ; |
|
#3
|
|||
|
|||
|
I have the script now running on cisco routers, but on Juniper routers, it time out and not continue.
Can Any one help me important , PLZ ??? |
|||
| Google The UNIX and Linux Forums |