Not sure what you are trying to achieve, but you may have a look at
Airrecorder.
And not python, but Expect (which has a Python module as well, so you may use it to convert into python), this is a script that logs in over ssh, checks if a client is connected to the AP, and if it is it will disconnect the client, just as an example:
#!/usr/bin/expect -f
set timeout 20
set ip [lindex $argv 0]
spawn ssh admin@$ip
expect "password:"
send -- "ThePassword-here\r"
expect "#"
send -- "show clients | inc b8:27:eb:01:3a:ff\r"
expect {
"rpi-client" {
send -- "disconnect-user mac b8:27:eb:01:3a:ff\r"
}
"#" {
send -- "\r"
}
}
expect "#"
send -- "exit"
Note that scripting over SSH is not really recommended as the CLI commands or command output may change over time. Sometimes it is just a pragmatic and quick, so from that points valid approach to fix an immediate issue.
------------------------------
Herman Robers
------------------------
If you have urgent issues, always contact your Aruba partner, distributor, or Aruba TAC Support. Check
https://www.arubanetworks.com/support-services/contact-support/ for how to contact Aruba TAC. Any opinions expressed here are solely my own and not necessarily that of Hewlett Packard Enterprise or Aruba Networks.
------------------------------
Original Message:
Sent: Feb 01, 2021 09:44 AM
From: Chris Watson
Subject: SSH to an IAP via script
Hello,
I wanted to see if anyone has a working example of a pythion script that can connect to an IAP cluster and execute basic commands.
------------------------------
Thanks,
SATX71
------------------------------