Controllerless Networks

Reply
Contributor II

PERL script for SSH access to instant CLI not working

Hello,

 

I am trying to implement a PERL script to log into an IAP-215 to run CLI commands periodically.  However, I am running into some problems with this.  Our telnet script has been working fine, but really would prefer to use SSH.

 

PC side:

[1] Error : Received SSH_MSG_DISCONNECT: 33554432:Only cli connections are allowed to the AP

[1] Error : Writing packet: error on socket (or connection closed): Operation now in progress

[1] Error : Writing packet: error on socket (or connection closed): Operation now in progress

 

In AP side:

Jun  8 05:34:54 2017 192.168.4.30 <192.168.4.30 04:BD:88:CE:18:A2> sshd[14785]: Accepted password for admin from 192.168.4.1 port 33460 ssh2

Jun  8 05:34:54 2017 192.168.4.30 <192.168.4.30 04:BD:88:CE:18:A2> sshd[14785]: Disconnecting: Only cli connections are allowed to the AP

 

What can we do here?  Are there any other alternatives

  1. Python Paramiko  library,
  2. Or optimize the current python pexpect program
  3. Or use the linux ssh command in shell
  4. Or use putty
  5. Or use poco C++ library
  6. Or any other available open source methods

?

Re: PERL script for SSH access to instant CLI not working

I don't know your script, so need to guess based on what you write.

 

It looks like your script tries to execute commands directly over ssh. That is not supported in the Instant AP. The only supported login method is that you start an interactive session and enter the command there.

That is exactly how it must be done with telnet, as telnet does not allow direct execution of commands (there was rexec/rshell for that in the past; don't use it it is insecure, and for that reason replaced by SSH that has all in it).

 

To make it more clear, for example if you want to run the 'show version' command, what you would do as normal user is login, see that there is a prompt, then type 'show version', and see what comes out. With SSH it is possible to skip the prompt part, and directly execute the command (instead of the shell that gives the command prompt). This makes scripting easier and is probably the method that your script prefers when running over ssh, but is not supported by the Instant AP.

 

You will need to let your script check for the prompts and issue the commands just like it does on telnet.

 

 

--
If you have urgent issues, please contact your Aruba partner or Aruba TAC (click for contact details).
Guru Elite

Re: PERL script for SSH access to instant CLI not working

Use expect (like you mentioned)  http://community.arubanetworks.com/t5/Wireless-Access/Sharing-quot-Expect-quot-script-to-backup-controllers/m-p/85362#M15800

 

or

 

use Airrecorder (Requires Login):

https://support.arubanetworks.com/ToolsResources/tabid/76/DMXModule/514/EntryId/11035/Default.aspx



Colin Joseph
Aruba Customer Engineering

Looking for an Answer? Search the Community Knowledge Base Here: Community Knowledge Base

Contributor II

Re: PERL script for SSH access to instant CLI not working

Does AirRecorder work only with controller based APs, or will it work with an IAP?

 

Are there any limits on the what commands can be issued with AirRecorder?

 

Regards,

Zummarius

Guru Elite

Re: PERL script for SSH access to instant CLI not working

Airecorder will work with either controller-based or Instant APs.

 

There is no limit to the commands that can be run.



Colin Joseph
Aruba Customer Engineering

Looking for an Answer? Search the Community Knowledge Base Here: Community Knowledge Base

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: