toronto-community-network
toronto-community-network copied to clipboard
unms_exporter not working
Please Help!
For some reason, the script cannot connect to my UNMS host
/opt/unms_exporter# UNMS_HOST=10.77.1.231 UNMS_KEY=ca2c9f48-2466-4a6c-b312-2d1d0abe2bb3 python3 unms_exporter.py
10.77.0.220 - - [12/Aug/2021 15:51:15] code 400, message Bad Request
10.77.0.220 - - [12/Aug/2021 15:51:15] "GET /metrics?target=10.77.1.231 HTTP/1.1" 400 -
no firewall, exporter and unms ping each other
Usually i see this error when it could not match the IP address (10.77.1.231) in UNMS.
If you hit http://127.0.0.1:8000/metrics?target=10.77.1.231
via curl or a browser you should see an error Provided target name/IP does not exist.
Usually we see this because the script can only match the IP address that is UNMS sees when the device reports back. (which i agree is annoying) and we used the wrong ip of a router.
In your case it may be an API issue.
curl -H "x-auth-token:ca2c9f48-2466-4a6c-b312-2d1d0abe2bb3" "https://10.77.1.231/nms/api/v2.1/devices"
see if
- you get a json output
- your last used increases
If you get a json, prase the output and take a look at "ipAddress"
PS: ou can try to use targetName
instead of target
which will match on identification/name
Just realized that your UNMS_HOST
and your target=
are the same
UNMS_HOST=10.77.1.231
That should be where your UNMS server is. Probably a hostname due to HTTPS