nextbox-ui-plugin
nextbox-ui-plugin copied to clipboard
Passive Objects?
How does it determine if something is passive?
A number of my switches show as "passive" devices despite having interfaces connected in netbox to other devices that are active. Just curious how its figuring that out.
Only devices without Interface type connections are “passive” according to the plugin’s logic. What are your plugin and NetBox versions?
The problem is in the logic that tries to implement this. It loops through all of the cables where the device is A, and then all of the cables where the device is B, and sets passive to true if, in either loop, all the links found have no interface. If you enter all the network cables from the switch to a device (so A is always the device), and then connect a power cable from the PDU to the switch (so the switch is B), the loop looking at the b devices will determine the device to be passive.
It may be possible to use a single filter on device_id to return all the cables involving the device, and only iterate through the list once. If the separate queries are still wanted, this patch seems to do what the code's comment (and your comment above) seem to indicate the intent was.