<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assistance with automating cli commands on AP using Python/Paramiko in Aerohive Migrated Content</title>
    <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79526#M8263</link>
    <description>&lt;P&gt;See also: https://github.com/andytruett/aeromiko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We pair it with Nornir to get information from many APs and make batch changes with concurrency.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2019 21:36:35 GMT</pubDate>
    <dc:creator>andy_truett</dc:creator>
    <dc:date>2019-11-01T21:36:35Z</dc:date>
    <item>
      <title>Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79521#M8258</link>
      <description>&lt;P&gt;I am trying to build a python script to connect to the APs cli via SSH using Paramiko, issue commands and collect the output.&amp;nbsp;Ultimately, I want to develop a more automated and reliable method to upgrading the APs software in the field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to connect to the AP using paramiko.SSHClient() and .connect() and this appears to be successful.&amp;nbsp;When I issue .exec_command("show version") for example, I get nothing back in the stdout buffer.&amp;nbsp;Code example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ssh = paramiko.SSHClient()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print("Connecting to AP")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssh.connect(hostname=ap_ip, username="admin", password="1234")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print("Connected -sending command to AP")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;stdin, stdout, stderr = ssh.exec_command("show version")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print("command issued")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;data_out&amp;nbsp;= stdout.readlines()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(data_out)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;stdin.flush()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssh.close()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone successfully been able to script against the Aerohive APs?&amp;nbsp;Any direction would be appreciated as I am not making progress with this effort.&amp;nbsp;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 23:19:45 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79521#M8258</guid>
      <dc:creator>chris_krieter</dc:creator>
      <dc:date>2019-10-03T23:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79522#M8259</link>
      <description>&lt;P&gt;I started looking into this two years ago. Might be helpful to ping Kirk Byers, the creator of Netmiko to look into the output and add support for HiveOS.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 23:35:34 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79522#M8259</guid>
      <dc:creator>sderikonja1</dc:creator>
      <dc:date>2019-10-03T23:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79523#M8260</link>
      <description>&lt;P&gt;If you want to send commands via SSH to a large group of access points in my case 6600 access points.  I would use Cattools by solarwinds.  It is not perfect but it works for most things and is not that expensive.  I use it to run VLAN probes all the time.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 20:19:02 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79523#M8260</guid>
      <dc:creator>dennisph</dc:creator>
      <dc:date>2019-10-04T20:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79524#M8261</link>
      <description>&lt;P&gt;Luckily, I was able to get this working using a Paramiko shell.  The code below is an example of how I can send and get feedback from non-interactive commands (like show commands).  I will post something on Netmiko so see if we can get HiveOS support added, however, what is the future of HiveOS with the acquisition?  Would it be worth the effort?&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Import pprint (print pretty) and Paramiko libs&lt;/P&gt;&lt;P&gt;from pprint import pprint&lt;/P&gt;&lt;P&gt;import paramiko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Function &lt;/P&gt;&lt;P&gt;def TestSSHtoAP():&lt;/P&gt;&lt;P&gt;    # Get host/ip from user&lt;/P&gt;&lt;P&gt;    host = input("Enter hostname or ip of device:  ")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;    # Setup and connect to AP on SSH - auto accept host key&lt;/P&gt;&lt;P&gt;    ssh = paramiko.SSHClient()&lt;/P&gt;&lt;P&gt;    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())&lt;/P&gt;&lt;P&gt;    print("Connecting to AP")&lt;/P&gt;&lt;P&gt;    ssh.connect(hostname=host, port=22, username='admin', password='XXXX')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;    # Create channel for sending data and prefill the var &lt;/P&gt;&lt;P&gt;    channel = ssh.invoke_shell()&lt;/P&gt;&lt;P&gt;    channel_data = str(channel.recv(9999))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;   # While loop untli we exit&lt;/P&gt;&lt;P&gt;    while True:&lt;/P&gt;&lt;P&gt;        # if there is data on the receive of channel, print it otherwise continue&lt;/P&gt;&lt;P&gt;        if channel.recv_ready():&lt;/P&gt;&lt;P&gt;            channel_data += str(channel.recv(9999))&lt;/P&gt;&lt;P&gt;            print('#########   Device Output #########&lt;BR /&gt;
')&lt;/P&gt;&lt;P&gt;            pprint(channel_data)&lt;/P&gt;&lt;P&gt;            print('&lt;BR /&gt;
##################')&lt;/P&gt;&lt;P&gt;        else:&lt;/P&gt;&lt;P&gt;            continue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;        # if the channel_data ends with the hostname#'  (note the ' after # is necessary)&lt;/P&gt;&lt;P&gt;        if channel_data.endswith(host + "#'"):&lt;/P&gt;&lt;P&gt;            # get a command from user to send to AP&lt;/P&gt;&lt;P&gt;            show_command = input("Enter a show command to send:  ")&lt;/P&gt;&lt;P&gt;            # send it and print the output&lt;/P&gt;&lt;P&gt;            channel.send(show_command + '&lt;BR /&gt;
')&lt;/P&gt;&lt;P&gt;            channel.send('&lt;BR /&gt;
')&lt;/P&gt;&lt;P&gt;            channel_data += str(channel.recv(9999))&lt;/P&gt;&lt;P&gt;            print('&lt;BR /&gt;
#########   Device Output #########&lt;BR /&gt;
')&lt;/P&gt;&lt;P&gt;            pprint(channel_data)&lt;/P&gt;&lt;P&gt;            print('&lt;BR /&gt;
##################&lt;BR /&gt;
')&lt;/P&gt;&lt;P&gt;            #exit while loop and exit function&lt;/P&gt;&lt;P&gt;            return True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;    #close the ssh session&lt;/P&gt;&lt;P&gt;    ssh.close()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Function call and exit&lt;/P&gt;&lt;P&gt;TestSSHtoAP()&lt;/P&gt;&lt;P&gt;print("Exiting")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 23:56:28 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79524#M8261</guid>
      <dc:creator>chris_krieter</dc:creator>
      <dc:date>2019-10-04T23:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79525#M8262</link>
      <description>&lt;P&gt;Chris that is pretty awesome.  I personally think they will keep HiveOS it seems to work well.  I don't know much about Extreme's OS or if they even offer CLI.  I just hope they keep improving the cloud management because it seems very clunky to me.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Oct 2019 00:15:10 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79525#M8262</guid>
      <dc:creator>dennisph</dc:creator>
      <dc:date>2019-10-05T00:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79526#M8263</link>
      <description>&lt;P&gt;See also: https://github.com/andytruett/aeromiko&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We pair it with Nornir to get information from many APs and make batch changes with concurrency.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:36:35 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79526#M8263</guid>
      <dc:creator>andy_truett</dc:creator>
      <dc:date>2019-11-01T21:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79527#M8264</link>
      <description>&lt;P&gt;Andy - this is awesome!  Did you just create this?  Nice work!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good call on the Nornir, we had discussed using for this reason!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:45:49 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79527#M8264</guid>
      <dc:creator>chris_krieter</dc:creator>
      <dc:date>2019-11-01T21:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79528#M8265</link>
      <description>&lt;P&gt;It's been used internally for a while, but decided to get it out into the world, due in part to seeing this question.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 21:52:25 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79528#M8265</guid>
      <dc:creator>andy_truett</dc:creator>
      <dc:date>2019-11-01T21:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79529#M8266</link>
      <description>&lt;P&gt;I'm a noob on python and I can't seem to make any of those work.  Any more help or explanation?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 04:42:02 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79529#M8266</guid>
      <dc:creator>bobby_clowers</dc:creator>
      <dc:date>2020-02-14T04:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79530#M8267</link>
      <description>&lt;P&gt;Why don't you show us what you've got and we can walk through it with you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 05:25:57 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79530#M8267</guid>
      <dc:creator>andy_truett</dc:creator>
      <dc:date>2020-02-14T05:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79531#M8268</link>
      <description>&lt;P&gt;I was trying to use what you had.  know very little about python.  If its to much i understand.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 05:28:13 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79531#M8268</guid>
      <dc:creator>bobby_clowers</dc:creator>
      <dc:date>2020-02-14T05:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79532#M8269</link>
      <description>&lt;P&gt;Take look here and see if this script makes any sense for you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;https://github.com/andytruett/Aeromiko/tree/master/example&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 05:38:48 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79532#M8269</guid>
      <dc:creator>andy_truett</dc:creator>
      <dc:date>2020-02-14T05:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79533#M8270</link>
      <description>&lt;P&gt;Take a look at https://github.com/andytruett/aeromiko/blob/master/example/example.py and see if you can do anything with it.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 06:14:22 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79533#M8270</guid>
      <dc:creator>andy_truett</dc:creator>
      <dc:date>2020-02-14T06:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Assistance with automating cli commands on AP using Python/Paramiko</title>
      <link>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79534#M8271</link>
      <description>&lt;P&gt;I tried using it and this is the message I get.   Where do i put in the ip address?&lt;/P&gt;&lt;P&gt;usage: Data_Extraction.py [-h] ip_addresses [ip_addresses ...]&lt;/P&gt;&lt;P&gt;Data_Extraction.py: error: the following arguments are required: ip_addresses&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 21:42:26 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/aerohive-migrated-content/assistance-with-automating-cli-commands-on-ap-using-python/m-p/79534#M8271</guid>
      <dc:creator>bobby_clowers</dc:creator>
      <dc:date>2020-02-14T21:42:26Z</dc:date>
    </item>
  </channel>
</rss>

