Created
October 18, 2018 04:57
-
-
Save UBNT-cmb/c738e1921a7013fcc5aa95588d9e6677 to your computer and use it in GitHub Desktop.
example of getting UniFi device stats from controller API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
username=username | |
password=password | |
baseurl=https://localhost:8443 | |
site=default | |
cookie=/tmp/unifi_cookie | |
mac=aa:bb:cc:dd:ee:ff | |
curl_cmd="curl --tlsv1 --silent --cookie ${cookie} --cookie-jar ${cookie} --insecure " | |
${curl_cmd} --data "{'username':'$username', 'password':'$password'}" $baseurl/api/login | |
${curl_cmd} $baseurl/api/s/$site/stat/device/$mac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment