![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| how to use telnet in script | sibghat | Shell Programming and Scripting | 7 | 04-03-2007 04:38 AM |
| telnet through script | arun.viswanath | UNIX for Dummies Questions & Answers | 1 | 03-26-2006 09:33 AM |
| ksh telnet script | rwunwla | Shell Programming and Scripting | 5 | 12-16-2005 05:22 AM |
| telnet in a script | vaccari | UNIX for Dummies Questions & Answers | 10 | 10-10-2001 08:37 AM |
| telnet in a script | vaccari | IP Networking | 4 | 12-15-2000 11:42 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Help with borked Telnet script
I'm trying to telnet to a McData switch via a perl script to display port information. This script stopped working on some switches who've had their firmware upgraded.
Here's the script: #!/usr/bin/perl use Net::Telnet; $mySwitch = shift || die "command needs arguments, perl_telnet.pl <switch_name>"; $myPassword = "password"; $telnet = new Net::Telnet ( Timeout=>10, Errmode=>'die'); $telnet->open("$mySwitch"); $telnet->waitfor('/Username: $/i'); $telnet->print('Administrator'); $telnet->waitfor('/Password: $/i'); $telnet->print("$myPassword"); print $telnet->cmd('show port status'); print $telnet->cmd('logout'); ---------------------------- This works for most switches but the ones that dont display the following error: pattern match read eof at <path to script>l line 18 What does this mean? I cant tell which step this is failing. The following is displayed when doing a telnet to the switch that works: Connected to switch.company.com. Escape character is '^]'. Username: Administrator Password: Root> This switch doesn't work and you can see below that the reponse from the telnet session to the switch is the same: Connected to switch.company.com. Escape character is '^]'. Username: Administrator Password: Root> Does my patter matchin jive? I think there may be some control character in there in the new switch. How do I mod the perl script to ignore these things? |
| Forum Sponsor | ||
|
|