Skip to content

Instantly share code, notes, and snippets.

@UBNT-cmb
Created October 18, 2018 04:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UBNT-cmb/c738e1921a7013fcc5aa95588d9e6677 to your computer and use it in GitHub Desktop.
Save UBNT-cmb/c738e1921a7013fcc5aa95588d9e6677 to your computer and use it in GitHub Desktop.
example of getting UniFi device stats from controller API
#!/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