armcinto has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to write a simple script that will ssh to and execute a command on a Cisco CallManager server. I can see that I'm authenticating and logging in to the CLI of the server, but I can't get the command to execute. I've tried multiple variations, but nothing is working.
I'm using strawbery perl on an XP machine, the CallManager server is running linux but I'm logging into a CLI (not the linux shell).
my $channel = $ssh->channel(); $channel->execute("show account"); my $output;<br> $channel->read($output,1028); print "output:\n $output\n";
This line is what the CLI prints after you successfully login, so the authentication and creating the channel appears to be working.
I have tried ssh debug, and get the following;
I don't see any debug statement for the exec. I've also tried to create shell (with and without blocking(0/1) and then write the command, but get pretty much the same result.
I also know that this same script will work when connected to a Cisco IOS router/switch, so I know it's something with the CLI on the server. I'm just hoping there is a way to get it to work.
Any help would be appreciated, I don't know what else to try at this point.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ssh2 channel/exec issue
by armcinto (Initiate) on Jul 23, 2013 at 23:55 UTC |