oxidized icon indicating copy to clipboard operation
oxidized copied to clipboard

Duplicated nodes using http pagination

Open stevesaner opened this issue 1 year ago • 4 comments

I am using Netbox as a source for oxidized. I am on the latest version of oxidized and here is the source config (oxidized is running on the same machine as netbox)

http: url: http://127.0.0.1:8001/api/dcim/devices/?status=active&cf_oxidized=true scheme: http delimiter: !ruby/regexp /:/ headers: Authorization: Token map: name: name model: platform.name ip: primary_ip4.address group: role.name insecure: true secure: false hosts_location: results pagination: true pagination_key_name: 'next'

This was working perfectly until I got to over 50 nodes. I then turned pagination on so that oxidized would make additional requests to netbox for the 2nd 50 nodes and so forth.

On the oxidized web interface, the first 50 nodes look just fine, but when I go to page 2, all of the nodes on page two are duplicated. I have a total of 56 nodes now defined in Netbox, but oxidized says there are 62 nodes. That's because 51 through 56 are there twice.

stevesaner avatar Apr 25 '24 19:04 stevesaner

This doesn't address the actual problem, but it may be a suitable workaround for you. You can provide a "limit" parameter in the Netbox URL to give you back more per page to avoid pagination completely. The URL I use in my source is this:

https://netbox.my.env/api/dcim/devices/?format=json&limit=1000&tag=oxidized

ianbarrere avatar May 29 '24 14:05 ianbarrere

That does provide a workaround. Thanks for the suggestion.

stevesaner avatar Jun 04 '24 15:06 stevesaner