
Welcome to another episode of What's up, home? weirdness. Who wouldn't have their own Netbox at home and who wouldn't think of it as home CMDB? I just started experimenting with that. For those who do not know, CMDB -- or Configuration Management Database -- is the source of truth for your inventory of stuff. In data centers, your servers, their cables, their everything, telling in which data center and which rack they are.
For me... well.. take a look at for yourself. One picture tells more than one thousand words of my verbal storytelling.

What is it good for?
Well... in real business world, for many things, from knowing about your assets, their serial numbers, purchase dates, hardware configuration, much else. I could go as deep as that, but even for me there's a limit how far I want to go with these little experiments. Today's case is merely to demonstrate the flexibility of Zabbix, yet again.
How did I do this?
I quickly threw in the data to Netbox by hand -- that looks by a lot of work to do, but in fact, that was not too bad, took me about 45 minutes.
- Created a Site called What's up, home
- Created the rooms by adding new locations and making the previously created site as their parent
- Added some manufacturers
- Added some device roles
- Added some device types
After that, adding the devices themselves is a breeze. If you have not used Netbox, this is how adding a new device looks like. Yes yes, in real business world there would have been many more items for me to fill in, but for this case, I only added the mandatory items and even those just by choosing from the drop-down menus. Not a big deal.

... and the Zabbix integration?
Actually, this is something I created many years ago already for other purposes, but still seems to work with today's versions of Netbox. My little template queries Netbox over its API and asks if it has anything that matches with the host name that's in Zabbix. If it has, then it gets the rack location and other stuff.


How this then works is pretty standard stuff. Retrieve a master item:

.. .and the dependent items then gather the data, parse some JSONPaths with Zabbix item preprocessing, and at least some of the items also do populate bits and pieces in Zabbix inventory. This is handy in real world, as your alerts can then contain the exact rack location and so forth about your failing devices. Add them as tags, add them as part of the alert text, your imagination is your limit.


Does it work?
Of course it does! Here's the inventory grouped by manufacturer:

and if I click on any of them, I get this:

Of course I can also for example browse the data through the latest data:

... or could just create some dashboards for visualising all this. I did not do that yet, as this is what I did tonight so far and now I'm going to bed. To be continued. Maybe. For now, the template only pulls data from Netbox, but I'd like to push data towards it as well, for example to also tell there if a light bulb is powered on or not.
Comments
Ooohhh, your Netbox setup looks awesome! All those fancy colours! :-)
I think I will copy you and do it manually until I can figure out that damn automation xD
Thanks for sharing your knowledge! Netbox and Zabbix are a dream come true!
:-)