den-it / ntmap

Network topology map using Netbox as a data source
MIT License
146 stars 14 forks source link

Incorrect Polling for Form Factor #1

Closed martydingo closed 4 years ago

martydingo commented 4 years ago

Hiya there,

This line of code results on an error in newer versions of Netbox.

# form interfaces json for node in graphJson["results"]["nodes"]: sql = """SELECT d.name as device, i.id AS netbox_id, i.name AS name, i.lag_id AS lag_netbox_id, l.name AS lag, i.form_factor AS form_factor, i.description AS description, i._connected_interface_id AS neighbor_interface_netbox_id, ni.name AS neighbor_interface, nd.id AS neighbor_netbox_id, nd.name AS neighbor

Namely this one

i.form_factor AS form_factor as this needs to access type.value, not form_factor.

martydingo commented 4 years ago

Sorry, should be i.type

den-it commented 4 years ago

Hi!

Thanks for the first issue :)

Ntmap works with the latest stable Netbox release - 2.8.8. It seems to me there is no such a problem with 2.8.8.

Interface type in 2.8.8 is 'physical' or 'virtual'. Interface form factor is '40gbase-x-qsfpp', '10gbase-x-sfpp' or similar. So, everything looks to be ok.

It is going to be a change in the model of interfaces in Netbox 2.9. As soon as stable 2.9 is released, Ntmap will be updated accordingly.