10-03-2019 04:19 PM
I am trying to build a python script to connect to the APs cli via SSH using Paramiko, issue commands and collect the output. Ultimately, I want to develop a more automated and reliable method to upgrading the APs software in the field.
I am able to connect to the AP using paramiko.SSHClient() and .connect() and this appears to be successful. When I issue .exec_command("show version") for example, I get nothing back in the stdout buffer. Code example below:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print("Connecting to AP")
ssh.connect(hostname=ap_ip, username="admin", password="1234")
print("Connected -sending command to AP")
stdin, stdout, stderr = ssh.exec_command("show version")
print("command issued")
data_out = stdout.readlines()
print(data_out)
stdin.flush()
ssh.close()
Has anyone successfully been able to script against the Aerohive APs? Any direction would be appreciated as I am not making progress with this effort. Thanks!
02-14-2020 01:42 PM
I tried using it and this is the message I get. Where do i put in the ip address?
usage: Data_Extraction.py [-h] ip_addresses [ip_addresses ...]
Data_Extraction.py: error: the following arguments are required: ip_addresses
02-13-2020 10:14 PM
Take a look at https://github.com/andytruett/aeromiko/blob/master/example/example.py and see if you can do anything with it.
02-13-2020 09:38 PM
Take look here and see if this script makes any sense for you:
https://github.com/andytruett/Aeromiko/tree/master/example
02-13-2020 09:28 PM
I was trying to use what you had. know very little about python. If its to much i understand.