in reply to
Re: Net::SSH::Perl doesn't execute commands
in thread Net::SSH::Perl doesn't execute commands
Ok then! Thanks for the very valuable input!
Ok, so I am able to issue commands to the load balancer software (which is a proprietary software layer sitting on top of a BSD core) via ssh and this is what I get:
[bluethundr@cc90-45:~ ] #:ssh bluethundr@10.50.0.1 show lb vserver gl-
+www
Password:
Done
gl-www (0.0.0.0:0) - HTTP Type: ADDRESS
State: UP
Effective State: UP ARP:DISABLED
Client Idle Timeout: 180 sec
Down state flush: ENABLED
Port Rewrite : DISABLED
Configured Method: ROUNDROBIN
Mode: IP
Persistence: NONE
Redirect URL: http://pi.glcdn.us/DowntimeGeneric/gl_downtime.html
Vserver IP and Port insertion: OFF
1) cc61-35-http (10.50.35.61: 80) - HTTP State: UP Weight: 1
2) cc61-44-http (10.50.44.61: 80) - HTTP State: UP Weight: 1
Done
So something like this would be the desired output of my little script.
But when I run my script the output would indicate that it's not finding the netscaler commands:
**********LB VSERVERS**********
show lb vserver default-router
Can't exec "show": No such file or directory at ./vservers.pl line 23,
+ <LBVSERVERS> line 1.
Out = Done
ERROR: No such command
, Error = ERROR: No such command, Exit = 64
Ready for next lb vserver? (y/n): y
show lb vserver gl-www
Can't exec "show": No such file or directory at ./vservers.pl line 23,
+ <LBVSERVERS> line 2.
Out = Done
ERROR: No such command
, Error = ERROR: No such command, Exit = 64
Ready for next lb vserver? (y/n): y
show lb vserver c9-qa-bp-http
Can't exec "show": No such file or directory at ./vservers.pl line 23,
+ <LBVSERVERS> line 3.
Out = Done
ERROR: No such command
, Error = ERROR: No such command, Exit = 64
Ready for next lb vserver? (y/n):
And when I execute a unix shell and do a find on the "show" command it turns up nothing, nada:
root@ns# find / -name show -print
root@ns#
So my question would be, why does plain old ssh find the netscaler commands when I issue them on the command line, but Net::SSH::Perl does not find them when issued from my script? Also it should be noted that I changed the quote (") marks to backticks (`) in the Net::SSH::Perl commands.
i..e.
was
$ssh->cmd("show lb vserver $csvserver");changed to
$ssh->cmd(`show lb vserver $csvserver`);Right now I only have output for the latter and not the former. I can get you the other input (with the quotes) if you feel it's important. Rather late, and retiring right now and picking this up again tomorrow. Thanks for your help!