scaleway / netbox-netprod-importer

Poll data from network devices in production and import it into netbox
GNU General Public License v3.0
101 stars 31 forks source link

Dynamic devices list fetched from filtering on Netbox #21

Closed VictorPavlushin closed 4 years ago

VictorPavlushin commented 5 years ago

How do you view the formation of a device list from a netbox on the filters Device type, Tag and optionally Primary IP?

VictorPavlushin commented 5 years ago

Parameters for napalm take from there too

aruhier commented 5 years ago

Hi @VictorPavlushin! In fact, as I wrote it in my doc, I personally don't want to handle the device type, neither of the tag. They're more related to the DCIM, and prefer to let the user to handle it.

About the primary IP, I set it to the napalm target : https://github.com/Anthony25/netbox-netprod-importer/blob/master/netbox_netprod_importer/importer.py#L70

VictorPavlushin commented 5 years ago

I guess you misunderstood me, or I said so wrong. I'm talking about the device list https://netboxnetimporter.readthedocs.io/en/latest/quickstart.html#device-list which can be generated from the netbox. As filters use Device type, Tag and optionally Primary IP.

aruhier commented 5 years ago

Oh ok, I see. It's a great idea, I already thought about using the data already in netbox (because all information needed by the importer can be registered in netbox).

I will just rename your feature request to make it clearer.

VictorPavlushin commented 5 years ago

I plan to do this. Have questions: 1) The config for this will be in a individual file or in the new config.yml section? 2) From netboxapi, I did not understand how to add several platforms, site and similar filters. netbox_mapper = NetboxMapper (netbox_api, app_name = "dcim", model = "devices") devs = netbox_mapper.get (platform = "ios", platform = "nxos") that doesn't work.

VictorPavlushin commented 4 years ago

https://github.com/aruhier/netbox-netprod-importer/pull/27