|more useful options|
Unable to store the command output from Net::SSH2. Please help.by perl514 (Pilgrim)
|on Oct 28, 2012 at 16:30 UTC||Need Help??|
perl514 has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to collect the ouptut of a command that is run after logging in to a NAS Array through SSH.
The command, nas_server -list gives the statuts of the NAS Array. I am trying the following script to do it. For some reason, its not capturing the actual command output of the command in the @output array even after stating my @output = $chan->exec('nas_server -list'); It seems to capture the value 1, which I presume corresponds with the successful status of the command being executed.
Here is the complete script
And here is the output. The IP given in the example is 127.0.0.1, but I am actually using a different IP to login to the NAS Array
Firstly, I know very rudimentary Perl and I am back here after almost a year, so if any mistakes in the script above please do forgive me. Thanks a lot to vdubjunkie, because If not for his node Net::SSH2 woes, I wouldn't even have written the above script.
The NAS Array (Network Attached Storage Array) is an EMC Storage Array - NS960. I am running the script from a Windows 2003 host on which Perl Version 5.14.2 is installed.
Kindly request you please guide me to a site where a detailed tutorial for the Net:SSH2 Module is given. I did go through the perldoc, also googled, but didn't find anything that I could understand. :(
Perlpetually Indebted To PerlMonks