Wireless Access

last person joined: 23 hours ago 

Access network design for branch, remote, outdoor, and campus locations with HPE Aruba Networking access points and mobility controllers.
Expand all | Collapse all

Script for CLI commands

This thread has been viewed 25 times
  • 1.  Script for CLI commands

    Posted Feb 12, 2019 05:44 AM

    Hi guys,

    i saw a lot of topics but nothing gives me a clear answer.

    I want to script a file which logged to the IAP and run several commands.

    For example to disable the SSID.

     

    I saw very old topics here but nothing helps me really.


    Any hints?

    Thanks a lot.



  • 2.  RE: Script for CLI commands

    EMPLOYEE
    Posted Feb 12, 2019 12:34 PM

    While not intended for this exact use case, you may be able to modify the commands in AirRecorder to do what you want.  It's a free tool on the support site.  The reason I say it's not intended to do this is when you run it, it runs a set of commands on the interval set in the config file for the tool.

    AirRecorder.png



  • 3.  RE: Script for CLI commands

    Posted Feb 13, 2019 07:27 AM

    Thanks a lot.
    I tested AirRecorder, but get enable handshake errors.

    in macos and ubuntu as well.

    no clue how to fix this.

     

    my java version:
    java version "11.0.2" 2019-01-15 LTS

    Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)

    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

    i get a lot of : Failed to connect: java.io.IOException: Enable handschake failed(1).

    also with --disable-fast-login.

     

    java -jar AirRecorder-1.5.5-release.jar -disable-fast-login 192.168.1.xx

     

     

    any ideas?

     



  • 4.  RE: Script for CLI commands

    Posted Feb 13, 2019 04:49 AM

    I have an ugly script for some junipers where I send commands through SSH (this would be the only way since there is no API for this, please NOTE that it's very error prone).

     

    I am using python and paramiko, I'll give you part of the code, maybe it will get you going.

     

    import paramiko
    import time
    ip = 'insert_ip_here' username = 'insert_username_here' password = 'insert_password_here'
    remote_conn_pre = paramiko.SSHClient() remote_conn_pre.set_missing_host_key_policy( paramiko.AutoAddPolicy()) try: remote_conn_pre.connect(ip, username=username, password=password) except paramiko.AuthenticationException: print '{} authentication error'.format(ip) continue except socket.error, e: print '{} socket error'.format(ip) continue remote_conn = remote_conn_pre.invoke_shell() remote_conn.send("show system storage partition
    ") time.sleep(10) output = remote_conn.recv(5000) remote_conn.close()

    The response is stored in the output variable.