Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Run interactive commands with "Net::SSH::Expect"

by slayedbylucifer (Scribe)
on Jan 10, 2011 at 17:45 UTC ( [id://881516]=note: print w/replies, xml ) Need Help??


in reply to Re: Run interactive commands with "Net::SSH::Expect"
in thread Run interactive commands with "Net::SSH::Expect"

I had tried that option, But I tried it one more time after reading your response....

I increased the time out period aslo I used "\s*" to match number of spaces. But no luck. Here is hte output:

# ./change_password.pl The login was successful Let's change the password of root on remote server now

I am pretty sure that my script is ignoring the "send" statements and then apparently dying.

Thanks for taking time to provide your feedback.

Replies are listed 'Best First'.
Re^3: Run interactive commands with "Net::SSH::Expect"
by slayedbylucifer (Scribe) on Jan 13, 2011 at 11:12 UTC

    OK, I have made some progress. I ran the perl debugger and after the 2nd print statement, the debugger throws following error:

    croak (ILLEGAL_ARGUMENT . " missing argument 'string'.") unless ($send +); croak (ILLEGAL_STATE_NO_SSH_CONNECTION);

    When I look into the "package Net::SSH::Expect", it is mentioned right on the top that:

    use constant ILLEGAL_STATE_NO_SSH_CONNECTION => "IllegalState: you don +'t have a valid SSH connection to the server";

    So,..my assumption in my previous replies was correct, the script is ignoring the "send " statement because now I realize that by teh time the script reaches to execute the "send" statement, the ssh connection does not remain active.

    Could you please help me figure this out, I cannot reason why would my ssh connection get closed ??

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://881516]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-18 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found