Ways of populating and updating NetBox with live data

4,590 views
Skip to first unread message

Fei Yeh

unread,
Aug 13, 2020, 10:08:11 AM8/13/20
to NetBox
Hi all,
New to NetBox here.
We are currently trying to run it with NAPALM because we also want to use NetBox for live monitoring.  However, it doesn't seem like NAPALM can populate and update the interfaces and VLANs by itself.

What are the tools that you generally use/recommend to populate / update the live information on a network switch?  Are there already surveys or lists somewhere on this subject?

Thank you.

Fei Yeh

Jeremy Stretch

unread,
Aug 14, 2020, 9:05:14 AM8/14/20
to Fei Yeh, NetBox
Hi Fei,

NetBox is not intended to automatically replicate live network state. Rather, it serves to represent the intended state of a network for comparison against operational data. If it's live data you're after, there are plenty of monitoring tools which would be better suited to that function.

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/4a91386d-ae65-4367-8a03-0972f38ecd80n%40googlegroups.com.


--
Jeremy Stretch
Sr. Network Automation Engineer
Network to Code, LLC

Anders Hagman

unread,
Aug 16, 2020, 10:52:42 AM8/16/20
to Fei Yeh, NetBox
Hi

I totally agree with Jeremy. Netbox is the documentation, instead of excel, visio, paper….
To have an active loop between Netbox and your network devices sounds handy but can be deceptive.
A configuration fault done in your network devices will also end up as the correct documented configuration.
Even worse if the loop is totally automatic with deleting objects in Netbox a network outage could wipe out your whole documentation.

With that said.
In a brown field environment with in our case 800 switches and 100 routers, fortunately only Cisco, we use python to get info from Prime Infrastructure via its API and write it to Netbox.
From PI API fetch:
- models and part number
- number of interface and type
- power ports and type

From this create YAML files for the device types and populate Netbox.

From PI API fetch:
- devices
- serial no
- name
- primary IP
- other  IP interfaces
- interface description
- VLANs

From this identify site by primary IP or name.
Create device with correct device-type and site.
Add interfaces (eq VLAN99 for mgmt)
DNS check and add FQDN to primary IP address.

After first run in POC-Netbox, in other case around 4 h, we hade 900 Switch/routers with all necessary info onboard. Only thing missing is placement in rack and of course all cabling.
This includes 2 routers, with 1500 VLAN interfaces each, to our WAN service.

Next is to decide how to rerun the script in diff mode and how to act on changes. The ide is to use the report/script part but it lacks cron features .

/Anders

Matthew Yauch

unread,
Aug 16, 2020, 7:38:31 PM8/16/20
to NetBox
My preferred workflow is to have Python automation scripts poll the network to confirm that configuration and topology matches Netbox. If it doesn't, alert on it in some way and give users the option to either update documentation (Netbox) with a click, or open a ticket. Imagine you start your day and open your own web interface dashboard and it has several notifications that various config changes were made in the past day without documentation updates. This way either the people making configuration changes also update the documentation or worst case you know documentation wasn't updated and you know exactly who to call and yell at.

Eschin Tenebrous

unread,
Aug 17, 2020, 8:17:46 PM8/17/20
to NetBox
Hey Matthew,

I'm gearing up to implement pretty much this exact workflow in our environment.

I have a solid idea of what needs done and how to do it, but overwhelmed at the options at my disposal :)

I'd be curious to know what your environment/scripts look like.  I'm currently planning on using Ansible to gather data from nodes.  Haven't exactly decided how I want to do the "stare and compare code" against Netbox's database though.

Ansible is able to work against Rest APIs, so I've considered using Ansible to both gather data and compare against Netbox's database.  Though I'm relatively new to Ansible, so not sure how that would end up looking once implemented, but it seems capable of doing just that....

And to echo the responses of others already in this thread, it's definitely not Netbox's intended design to have data automatically inserted/populated.  Instead, Netbox is designed to be the "human entry point into the network".  You ideally would use Netbox to generate and monitor configurations across the network, meaning Netbox acts as the "human controlled and checked frontend for your automation".

That said, I have heard of some environments automating the insertion/population of certain data points into Netbox's database (such as serial numbers).  This could be accomplished via the
API, I believe.

Matthew Yauch

unread,
Aug 18, 2020, 10:52:15 AM8/18/20
to Eschin Tenebrous, NetBox
Hi Eschin,

I’m no longer at the company where I installed Netbox, and my current position is unique (no IP access to anything) so I’m not able to automate anything from a central location using Netbox as the data source.

I don’t care that much for ansible so I tend to write my own Netmiko scripts, sometimes with a Flask or Django front end. I was using Genie to convert Cisco output into data. I’m aware of the concept of using Netbox as a frontend, however the company I was at had 30+ national locations with different operations staff at each making network changes every day. Without more granular access controls I couldn’t fully roll it out to the users. The new Netbox version is providing that ironically right when I left! Instead I used my scripts to poll the constantly changing network state and configuration and inform me of network changes so I could keep documentation updated, and alert on incorrect configuration from field staff.


From: netbox-...@googlegroups.com <netbox-...@googlegroups.com> on behalf of Eschin Tenebrous <mic...@claramunt.network>
Sent: Monday, August 17, 2020 5:17:46 PM
To: NetBox <netbox-...@googlegroups.com>
Subject: Re: [netbox-discuss] Ways of populating and updating NetBox with live data
 
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/WwejAESDwvk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/a2ba23d5-1ea0-47a5-a74b-0bbcf2734ac8o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages