![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Need 'expect' help, ssh/telnet and trapping | ippy98 | Shell Programming and Scripting | 0 | 03-03-2009 08:42 AM |
| strange expect script behavior, or am i misunderstanding expect scripting? | v1k0d3n | Shell Programming and Scripting | 2 | 12-10-2008 04:31 PM |
| Webpage to Telnet via Perl and Expect: Telnet problem? | jondo | Shell Programming and Scripting | 1 | 07-22-2008 12:35 AM |
| Unexpected Results (at least I did not expect them) | altamaha | Shell Programming and Scripting | 6 | 06-19-2008 09:43 AM |
| ftp delays | Luftwaffe | IP Networking | 5 | 10-02-2002 08:13 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
expect telnet unexpected delays
I must automatically monitor and manage a large number of boxes on our network.
I have been using perl/Net::Telnet and expect/telnet and also perl/ssh and expect/ssh to reach the command line of the remote boxes. Scripts are working but slow. (Yes, I do use SNMP also but many boxes do not speak SNMP) I believe that there is some protocol or terminal negotiating that I may be ignoring that blocks when the remote box sends a query and I do not respond. I tried to read the RFC on Telnet which appeared to have an infinite number of options. My application is very simple: get to the remote command line. Here is an example of expect/ssh (telnet exactly the same result) that includes unexpected data then the remote blocks for 10 seconds (local or remote default timeout?) then continues with expected response. Code:
expect: set expect_out(buffer) "admin@10.100.72.223's password:"
send: sending "xxxxx\r" to { exp4 }
(logo deleted)
MikroTik RouterOS 3.20 (c) 1999-2009 http://www.mikrotik.com/
^[[?62;9;c^[[39;3Rexpect: timed out
expect: does " \r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\n\r MMM MMM
(expected data deleted)
MikroTik RouterOS 3.20 (c) 1999-2009 http://www.mikrotik.com/\r\n\r\r\n\r
\u001b[9999B\r\u001b[9999B\u001bZ \u001b[6n" (spawn_id exp4) match glob
pattern " > "? no
Part does appear to be a terminal command. I have to guess the remote box is asking me a question and I am failing to answer. Surprising is that using ssh rather than Telnet gives the same results. Manual use of ssh or Telnet = no delays. Script use of ssh or Telnet = 10 second delays for each send/expect cycle! Can some one give me a clue??? |
| Bookmarks |
| Tags |
| delay, expect, negotiation, telnet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|