![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| 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 08:30 PM |
| Linux LiveCD Router 2.0.26 (Default Router branch) | iBot | Software Releases - RSS News | 0 | 03-03-2008 05:00 AM |
| SSH to Router in Script | earnstaf | Shell Programming and Scripting | 0 | 07-17-2007 02:42 PM |
| DSL Router | praveenk | UNIX for Advanced & Expert Users | 9 | 08-29-2002 06:19 PM |
| router | matt2kjones | Security | 1 | 07-18-2002 05:08 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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" ; |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|