Tag: netbox

Configuring Logging in NetBox

Creating the log file and setting the permissions: $ sudo mkdir /var/log/netbox $ sudo touch /var/log/netbox/netbox.log $ sudo chown -R netbox.netbox /var/log/netbox $ Configuring NetBox (in /opt/netbox/netbox/netbox/configuration.py): You can set the level for the loggers as needed, in this setup the file handler accepts DEBUG and higher but the actual loggers (“django” and “netbox”) only […]

Selecting Pynetbox Version

If you have: And you need: Then you need to use: Because: NetBox 3.2.0 or newer /api/ipam/vlan-groups/<id>/available_vlans pynetbox 6.5.0 or newer Feature was added in NetBox 3.2 (not yet released) NetBox 3.1.1 or newer /api/ipam/prefixes/<id>/available_ips (or _prefixes) pynetbox 6.4.1 or newer NetBox behaviour was changed, pynetbox was updated to support that NetBox 3.1.0 or newer […]

Hints for Pynetbox

Note: I don’t yet have extensive experience on NetBox 2.9.x but these have been shown useful in earlier NetBox versions. I’ll update the page later if I find some further comments about the performance in NetBox 2.9.x. Speeding up fetching the devices Fetching lots of devices (hundreds or thousands, depending on the environment) with netbox.dcim.devices.all() […]

Using Pynetbox

Pynetbox is a Python API client library for NetBox. Here are some basic examples of using pynetbox. In this page: Getting started Creating and changing something Retrieving objects Deleting objects Handling object status Using tags Referring to other objects Here we assume that you already have NetBox running (I have NetBox 2.8.6 in this demo), […]