nextbox-ui-plugin icon indicating copy to clipboard operation
nextbox-ui-plugin copied to clipboard

Passive Objects?

Open warriorsoul15 opened this issue 4 years ago • 2 comments

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.

warriorsoul15 avatar Feb 09 '21 21:02 warriorsoul15

Only devices without Interface type connections are “passive” according to the plugin’s logic. What are your plugin and NetBox versions?

iDebugAll avatar Feb 09 '21 22:02 iDebugAll

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.

fix_views.txt

neuro42 avatar Aug 05 '21 04:08 neuro42