ArubaOS and Controllers

Reply
Contributor I

net-ssh-perl connecting to an Aruba Controller?

Has anyone had any luck getting the Perl module: net-ssh-Perl to connect to an Aruba Controller? I can connect to other devices just fine but not to an Aruba Controller.

I have (and still do) used Kiwi Cat tools to connect but I'd like to bypass this and go directly at the Controller itself via Perl and ssh.

The Perl script looks like it should work but does not return anything. I've tried in both interactive and non interactive modes with the same results... nothing.

Has anyone successfully done this? (Or am I wasting my time trying?)

I'm trying a fairly simple script:

#!/usr/bin/perl
#
use Net::SSH::Perl;
#
my $host = "aruba-controller";
my $user = "admin";
my $pass = "passwd";
#
my $ssh = Net::SSH::Perl->new($host, (debug => 1,
protocol => 2 ,
interactive => 0));
#
$ssh->login($user, $pass);
#
my $cmd = "help";
#
my($stdout,$stderr,$exit) = $ssh->cmd($cmd);
print "stdout=$stdout \nstderr=$stderr \nexit=$exit\n";
#
exit;
Occasional Contributor II

Re: net-ssh-perl connecting to an Aruba Controller?

Hi Kslate,

i havn't done this with perl yet, but form a java-ssh-framework i know that 'command execution' is not working. You have to open a "interactive shell" and handle the session via this shell.

I just had a quick view into the Net::SSH::Perl docu. It seems $ssh->shell might be your friend, but they also noted that they are connecting the output to stdout and input to stdin, what i think is not what you want.

I'm not the perl guru, but it might be a point into the proper direction ;)

bye,
chris
Contributor I

Found the answer

If anyone cares....

I never was able to get any of the net::sshX perl modules to work.

What did end up working is a perl expect module. it works a bit odd as far as capturing your output but in the end it works.
New Contributor

Re: net-ssh-perl connecting to an Aruba Controller?

FWIW, I did write an SSH to aruba controller function but it was in PHP through the SSH2 module. It did work well enough for most tasks i required but it was plagued with sleep()s and such to keep the connections alive at certain times, particularly when you wanted some output rather than a quick input. The code was thus unnecessarily slow at tasks that didnt require output from the controllers (not that bad really, but i like my scripts snappy). In the end i went back to an older and much more reliable perl Net::Telnet based script for said work (I'll try to port it to net-ssh when i get some time and/or motivation).

My SSH implementation had a similar symptoms while i developed but after some time i was able to work out the kinks and get a prompt (i do believe it was a timing issue, hence the sleep() mentioned).
Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: