No matter what command is issued, all I get is the output that would be generated after an
interactive session has 'exited'. For some reason, the buffer seems to be getting flushed. This device is a Cisco Call Manager with access via SSH2.
Below I show the script along with the output generated and the output from a 'manual' login via SecureCRT.
Any help would be greatly appreciated.
Thanks
Script
======================
#!/usr/bin/perl
use Net::SSH::Perl;
use Math::BigInt::GMP;
my $server = '10.1.1.1';
my $ssh = Net::SSH::Perl->new($server);
print "Logging into server... ";
$ssh->login('user', 'passwd');
print "Running command ($command)... ";
my ($out, $errors, $exit) = $ssh->cmd('show logins');
print "$out";
Programatic Output
=======================
[user@linux2 voice_dupes]$ ./dupes.pl
Logging into server... Running command (show logins)...
Copyright Cisco Systems 2006-2008
[user@linux2 voice_dupes]$
Manual Output:
=======================
Last login: Thu Sep 18 21:48:36 2008 from 10.9.9.9
Welcome to the Platform Command Line Interface
admin:show logins
pwccmadm pts/0 1.1.1.1 Thu Sep 18 22:35 still logged in
pwccmadm pts/1 1.1.1.1 Thu Sep 18 21:48 - 21:48 (00:00)
wtmp begins Tue Sep 2 10:54:05 2008
admin:exit
Copyright Cisco Systems 2006-2008
|