Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^3: Net::SSH::Perl doesn't execute commands

by rjt (Deacon)
on Jun 09, 2010 at 04:13 UTC ( #843805=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Net::SSH::Perl doesn't execute commands
in thread Net::SSH::Perl doesn't execute commands

        $ssh->cmd(`show lb vserver $csvserver`);

That is almost certainly not what you want to do. Your qx// example will run your "show lb ..." command on the local machine and attempt to run the output of that on the remote machine.

It sounds like the root issue of your problem is the "show" command. I would log on to the BSD machine and run "which show" for starters--it may be an alias, or, it might be a builtin of a particular shell on the system that doesn't happen to be the same as the shell for the "bluethundr" user you're logging in with with Net::SSH::Perl.

That being said, diagnostics are everything. I would also debug Net::SSH::Perl as well, by substituting a well-known command in place of "show". I typically start with something like this:

#$ssh->cmd("show lb vserver $csvserver"); my ($out, $err, $exit) = $ssh->cmd("echo show lb vserver $csvserver"); + # DEBUG warn "out = '$out', err = '$err', exit = $exit\n";

Which SSH protocol version are you using? You should be using v2. v1 does not support multiple commands per session.

Comment on Re^3: Net::SSH::Perl doesn't execute commands
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-09-18 07:37 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (109 votes), past polls