in reply to Re: (3) Net::Telnet time outs
in thread Net::Telnet time outs

Changed the line to what you suggested and it does not work. if you notice the command is being returned and then it does not waitfor the prompt.
command being sent
< 0x00000: 74 65 72 72 61 3a 73 79 62 61 73 65 24 20
> 0x00000: 2f 6e 6d 73 2f 73 79 73 74 65 6d 2f 62 69 6e 2f
> 0x00010: 73 79 62 61 73 65 2f 62 61 63 6b 75 70 5f 73 79
> 0x00020: 62 61 73 65 2e 70 6c 20 53 65 72 76 65 72 2e 4e
> 0x00030: 61 6d 65 3d 4c 55 4e 41 20 42 61 63 6b 75 70 2e
> 0x00040: 44 61 74 61 62 61 73 65 3d 43 48 52 49 53 20 42
> 0x00050: 61 63 6b 75 70 2e 54 79 70 65 3d 74 72 61 6e 0d
> 0x00060: 0a
Command being returned
. < 0x00000: 2f 6e 6d 73 2f 73 79 73 74 65 6d 2f 62 69 6e 2f
< 0x00010: 73 79 62 61 73 65 2f 62 61 63 6b 75 70 5f 73 79
< 0x00020: 62 61 73 65 2e 70 6c 20 53 65 72 76 65 72 2e 4e
< 0x00030: 61 6d 65 3d 4c 55 4e 41 20 42 61 63 6b 75 70 2e
< 0x00040: 44 61 74 61 62 61 73 65 3d 43 48 52 49 53 20 42
< 0x00050: 61 63 6b 75 70 2e 54 79 70 65 3d 74 72 61 6e 0d
< 0x00060:
0a .

Replies are listed 'Best First'.
Re: (5) Net::Telnet time outs
by Rex(Wrecks) (Curate) on Aug 13, 2002 at 23:32 UTC
    Hmm, not quite, the command "being returned" is simply the "echo" of the command coming back, this happens immediatly after you send it, it's like when you type in a telnet window, for every keystroke you send it sends one back to display in your console. This does NOT mean the command is finished, the command could very well be hanging. How long does the command take to run in a regular telnet window? The fact that the dump log ends there means that nothing is coming back through the telnet connection, not even a prompt, which tells me the command (for whatever reason) is not finished.

    Example: I sent a sleep command to one of my machines this was the output of it and the chain of events:
    #Command I sent my @lines = $th->cmd("sleep 10"); #dump_log output #Matched a prompt < 0x00000: 72 65 78 40 44 72 69 7a 7a 74 3e 20 rex@Dri +zzt> #command is sent > 0x00000: 73 6c 65 65 70 20 31 30 0d 0a sleep 1 +0.. #command is immediatly echoed back < 0x00000: 73 6c 65 65 70 20 31 30 0d 0a sleep 1 +0.. #10 second wait here and then prompt returns < 0x00000: 72 65 78 40 44 72 69 7a 7a 74 3e 20 rex@Dri +zzt>

    Remember that dump_log is both input and output logs!

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
      The command will take any where from 1 to 30 seconds to run. I am dumping a sybase database tran log. The command is never executed almost like the command is sent then it exits from the Telnet session it then stops the job. When the command is executed in another window nothing is returned until it completes and goes back to the prompt.
        Ok, now for the obvious, is backup.pl in your path? Try running a different (very simple "hello world" style) perl script that is in the exact same place as backup.pl with the same permissions. This is seeming to be very strange. Also remove the waitfors, the cmd method will wait for timeout or prompt match, whichever is first.

        Make sure you are running with use strict ; and -w for as much info as possible.

        Also is there anything in @lines? Does the command return anything? (Although that is not likely whit the info in the dump log.).

        There must be something we are missing, with the info we have given you this should work just fine.

        "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!