[Solved] NMS Sync with Netbox not working

General discussion of anything Unimus
Post Reply
DVT
Posts: 3
Joined: Mon Aug 19, 2024 12:39 pm

Mon Aug 19, 2024 12:57 pm

We're using the latest version of Unimus (2.5.0) as jar file on a RHEL9 system, Java 11 and a mariadb backend. Also an nginx as reverse proxy on the same machine.

I configured the NMS Sync and use role=xxxx as filter. But this raises a 400 returncode. The netbox http-log shows this:
... "GET /api/dcim/device-roles/?name=xxxx HTTP/1.1" 200 52
... "GET /api/dcim/devices/?role HTTP/1.1" 400 73
It looks like the first request gets the devicerole succesfully, but at the 2nd request the URL is cut off at the end. A browser-request at https://netbox/api/dcim/devices/?role=xxxx gives the correct results.

Same issue with location=??? as filter.
User avatar
Tomas
Posts: 1274
Joined: Sat Jun 25, 2016 12:33 pm

Mon Aug 19, 2024 2:33 pm

DVT wrote:
Mon Aug 19, 2024 12:57 pm
...
I configured the NMS Sync and use role=xxxx as filter. But this raises a 400 returncode. The netbox http-log shows this:
...
Hi, our devs looked into the code, and we think we know what's going on here. The flow you see in the logs can occur if the role/location provided in the Sync Rule doesn't exist.

Basically with the current NetBox importer code, even if no roles/locations, etc. provided in the Sync Rule are found, Unimus will still attempt to hit the "/devices" endpoint in NetBox. We will change this in 2.5.1, so if the qualifier is not found by Unimus, it will fail instantly and report the proper error in the Sync result and not hit the NetBox API a 2nd time.

Now to the root of the issue - the role/location not being found. NetBox API is case-sensivite. Please make sure the role/location exists in NetBox, and casing is proper in Unimus.
Post Reply