Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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!

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (5)
    As of 2014-12-27 04:06 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (176 votes), past polls