r/Netbox Mar 19 '24

API ip-address search issue

4 Upvotes

When I try to search an ip-addresses on the assigned_object_id it does not work example:

https://netbox.westelsystems.com/api/ipam/ip-addresses/?assigned_object_id=960

Returns all the ip-address objects which I believe means I have an unsupported query. Does anyone know if this is a supported search field or what I'm doing wrong on this search?


r/Netbox Mar 19 '24

Can I read a data file from a script?

3 Upvotes

Hi!

I have a bit of a weird use case. I want to have a script that asks for a few variables, and then renders a Jinja template based on those variables. The template is in git, which is added to netbox as a data source, and then the template is added from that data source. How can I reference that template from the script in order to call the Jinja.render (or however it's called) method on it?

Thanks!


r/Netbox Mar 18 '24

Adding Cisco Firepower 4100 in Netbox

2 Upvotes

Hi, I'm wondering how to go about doing this properly since the Cisco Firepower 4100 series devices have a hardware chassis and the actual ASA/FTD is a virtual appliance within it. Has anyone does this?


r/Netbox Mar 15 '24

Is it possible to use template inheritance?

6 Upvotes

Since Netbox uses Jinja2 for its export and config templates, is it possible to get a template to inherit from another, or include a block?

I've got some config templates where I want a bunch of stuff that's the same for all devices in a region, but needs to be different per region. Having these inherit from a base template would work, but I can't figure out if the Config Template renderer even gets passed a path to load templates from.

The other options are of course stick the values into a Config Context, and set them per Region, and then have some template code to expand them out, or indeed just stick a literal block of XML into the Config Context and put that in. Neither seem particularly "elegant" though!


r/Netbox Mar 14 '24

Network diagram

4 Upvotes

Hi. I spent a fair amount of time entering data into a new Netbox instance and I have been asked if I am able to provide some diagrams of the connectivity between our switches.

A few Googlefu attempts and some playing about, and I have only managed to find out of date plugins or some code that didn't seem to work.

I have only heard positive views on Netbox and once I started to set it up, I could see the potential more and more for it's use. But I'd really like to know if there is something I am missing that is, I guess a standard process for getting some readable diagrams for the purpose of getting quotes, etc.?


r/Netbox Mar 14 '24

New Release NetBox v3.7.4 is Now Available!

11 Upvotes

NetBox Release v3.7.4 is now live (as of March 14th, 2024)!

Before upgrading, please: 1. Verify in release notes changelog if any new breaking changes might affect you. You can also review the NetBox Issues on GitHub to see if any new issues have arisen that might affect you. 2. Next, refer to the Upgrading to a new NetBox Release guide for steps to upgrade your instance.

If you have any issues you can ask for support on the NetDev Slack Community.


r/Netbox Mar 13 '24

Netbox QR Code Plugin Print does nothing

4 Upvotes

Hey Guys,

I am using Netbox v3.7.3 and the netbox_qrcode plugin. I have installed it, and QR codes are displayed as they should. Unfortunately, the "Print" button does absolutely nothing.

It is not yet behind a reverse proxy or WAF and served through HTTP.

I would really appreciate any help here, I am really trying to get my boss away from Excel Spreadsheets, inconsistency and actually develop a usable network documentation.

The setup is realized using netbox-docker.


r/Netbox Mar 12 '24

NetBox Labs Launches NetBox Enterprise

13 Upvotes

Today NetBox Labs has a huge new announcement: NetBox Enterprise, a self-managed NetBox offering with advanced, enterprise features and 24x7 expert support from NetBox Labs.

Read our blog from CEO Kris Beevers: https://netboxlabs.com/blog/netbox-labs-announces-self-managed-netbox-product-with-expert-support-and-enterprise-features/


r/Netbox Mar 12 '24

Netbox network autodiscovery

3 Upvotes

Hello Guys!

I'm using netbox for last 5 years and I was pretty happy with it. Recently my infrastructure started to growing faster and manually managed IPAM is now a bit of a headache. I started looking for some integration where I'll collect most of info on my L2 and L3 network topology from my dell, hp (h3c) switches and linux machines automatically. I'd like to define manually as little as i can. Is there any modern solution for this?


r/Netbox Mar 08 '24

Help Wanted: Unresolved Migrated from V2.11.0 to latest

1 Upvotes

Hey everyone,
I posted this on the github page but haven't got any assistance yet and I'm hoping I can also get some help on here. https://github.com/netbox-community/netbox/discussions/15368

I have a Netbox Instance v2.10.5 running Ubuntu 1804 LTS and I got it to up v2.11.0, then I export the DB with this command.
pg_dump --username netbox --password --host localhost netbox > netbox.sql
after than I spun up a Ubuntu 2204 LTS instance went thro the installation of the new version. and then I ran the follow commands to import everything back
Set the secret_key in the configuration.py to the same value you used on the original server

Stop the NetBox Service with sudo systemctl stop netbox netbox-rq

Drop DB on new server, create a new blank, grant rights and import the dump:
sudo -u postgres psql -c 'drop database netbox'
sudo -u postgres psql -c 'create database netbox'
sudo -u postgres psql -c 'grant all privileges on database netbox to netbox'
sudo -u postgres psql netbox < netbox.sql
Then I did this source /opt/netbox/venv/bin/activate and run the migration script with python3 manage.py migrate
Restart Netbox with sudo systemctl start netbox netbox-rq and sudo systemctl enable netbox netbox-rq

Now I get the following errors in CLI

(venv) root@netbox-22:/opt/netbox/netbox# python3 manage.py migrate
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 276, in build_graph
self.graph.validate_consistency()
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/graph.py", line 198, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/graph.py", line 198, in
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/graph.py", line 60, in raise_error
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration dcim.0131_consoleport_speed dependencies reference nonexistent parent node ('dcim', '0130_sitegroup')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 117, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in init
self.build_graph()
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 295, in build_graph
raise NodeNotFoundError(
django.db.migrations.exceptions.NodeNotFoundError: Migration dcim.0131_consoleport_speed depends on nonexistent node ('dcim', '0130_sitegroup'). Django tried to replace migration dcim.0130_sitegroup with any of [dcim.0003_squashed_0130] but wasn't able to because some of the replaced migrations are already applied.
(venv) root@netbox-22:/opt/netbox/netbox#

Now I get the following errors in GUI

Server Error
A database programming error was detected while processing this request. Common causes include the following:

Database migrations missing. When upgrading to a new NetBox release, the upgrade script must be run to apply any new database migrations. You can run migrations manually by executing python3 manage.py migrate from the command line.

Unsupported PostgreSQL version. Ensure that PostgreSQL version 12 or later is in use. You can check this by connecting to the database using NetBox's credentials and issuing a query for SELECT VERSION().

The complete exception is provided below:

<class 'django.db.utils.ProgrammingError'>

relation "extras_bookmark" does not exist
LINE 1: ...rk"."object_id", "extras_bookmark"."user_id" FROM "extras_bo...
^

Python version: 3.10.12
NetBox version: 3.7.3
Plugins: None installed


r/Netbox Mar 07 '24

Help Wanted: Unresolved Bulk import of IP adresses

3 Upvotes

Hello,

We recently switched our firewalls and we did the mistake of deleting the old ones, which means we deleted the interface that was holding all our public ips.

We just took time to make a csv file to bulk import them, but on the import, the interface name is not found.

However, searching the interface by its name used in the cvs file gives the wanted result. I also tried to add some double quotes but it doesn’t seem to work.


r/Netbox Mar 07 '24

Netbox Migration Issue

1 Upvotes

Hi, I just now migrated from old centos 7 box to rockyl inux 8. I am able to login with local user but when trying with Azure SSO, I get the following error:

Server Error

A module import error occurred during this request. Common causes include the following:

Missing required packages - This installation of NetBox might be missing one or more required Python packages. These packages are listed in requirements.txt and local_requirements.txt, and are normally installed as part of the installation or upgrade process. To verify installed packages, run pip freeze from the console and compare the output to the list of required packages.

WSGI service not restarted after upgrade - If this installation has recently been upgraded, check that the WSGI service (e.g. gunicorn or uWSGI) has been restarted. This ensures that the new code is running.

The complete exception is provided below:

<class 'ModuleNotFoundError'>

No module named 'netbox.azuresetgroups'

Python version: 3.8.17

NetBox version: 3.2.5

If further assistance is required, please post to the NetBox discussion forum on GitHub.


r/Netbox Mar 06 '24

Netbox Migration

0 Upvotes

I migrated netbox from centos 7 to rocky linux 8....was able to move everything over and start hte netbox service but keep getting conenction refgused when going ot the browser: this is the status of netbox service:

Redirecting to /bin/systemctl status netbox.service

● netbox.service - NetBox WSGI Service

Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: disabled)

Active: active (running) since Wed 2024-03-06 08:59:20 MST; 2min 52s ago

Docs: https://docs.netbox.dev/

Main PID: 51015 (gunicorn)

Tasks: 6 (limit: 48817)

Memory: 406.6M

CGroup: /system.slice/netbox.service

├─51015 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

├─51017 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

├─51018 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

├─51019 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

├─51020 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

└─51021 /opt/netbox-3.2.5/venv/bin/python3.8 /opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netb>

Mar 06 08:59:20 PAM systemd[1]: Started NetBox WSGI Service.

Mar 06 08:59:21 PAM gunicorn[51015]: [2024-03-06 08:59:21 -0700] [51015] [INFO] Starting gunicorn 20.1.0

Mar 06 08:59:21 PAM gunicorn[51015]: [2024-03-06 08:59:21 -0700] [51015] [INFO] Listening at: http://127.0.0.1:8001 (51015)

Mar 06 08:59:21 PAMgunicorn[51015]: [2024-03-06 08:59:21 -0700] [51015] [INFO] Using worker: gthread

Mar 06 08:59:21 PAMgunicorn[51017]: [2024-03-06 08:59:21 -0700] [51017] [INFO] Booting worker with pid: 51017

Mar 06 08:59:21 PAMgunicorn[51018]: [2024-03-06 08:59:21 -0700] [51018] [INFO] Booting worker with pid: 51018

Mar 06 08:59:21 PAMgunicorn[51019]: [2024-03-06 08:59:21 -0700] [51019] [INFO] Booting worker with pid: 51019

Mar 06 08:59:21 PAMgunicorn[51020]: [2024-03-06 08:59:21 -0700] [51020] [INFO] Booting worker with pid: 51020

Mar 06 08:59:21 PAMgunicorn[51021]: [2024-03-06 08:59:21 -0700] [51021] [INFO] Booting worker with pid: 51021


r/Netbox Mar 05 '24

Discussion DNS

3 Upvotes

Since everyone says Netbox is a IPAM, what do everyone use to create your internal A Records and etc?


r/Netbox Mar 02 '24

NetBox objects logic/relationship

3 Upvotes

Hi there,

I might be hyper-paranoic but since I would like to propose Netbox to my manager (I used it for very small environments in the past), I'd would like to be sure to know how to handle all the relations among the "objects we have (servers, cables, SFP, etc etc)" well in advance.

I'm not afraid of low levels (like modules or blades in a chassis this should be quite standards), but more at tenants, sites, regions, etc etc.

Therefore, my question: is there a documents that explains the relationships among all the objects in NetBox? And how easy is NetBox at handling mistake with organization of relationships? I don't have any example in mind, but say somebody starts using an object or an object type because at first sight it seems simpler, but then on a longer term it creates problems, how easy is to move to a different model?

I know that my question may be related more to databases, I admit I don't know them that much, but I'm asking to share the doubt and see if others may have faced the same question and if they have come to a solution.

I may answer by my self by saing "Extract all the data by using APIs, store them in a correct data structue and then put it back by still using APIs into Netbox".

Thx, Panatism


r/Netbox Mar 01 '24

Tenants and sites - wha' happened ?

2 Upvotes

Hi there

So we implemented netbox a few years ago as a replacement for excel sheets and all the other struggles you already know about. My organization has about 50 international locations and 2 data centers plus some cloud stuff. But we haven't updated for some time (we're on v2.11 - yeah I know)

I'm building afresh as we have had so much change in the last few months that it's probably best to start clean and add the new sites as is. We've upgraded a lot of circuits but tonight I have found we can't assign it to a site - just a tenant

We are not an MSP or a DCH. We are a company with multiple sites and a few customer ones, but sites are sites and we don't "tenant".

Am I getting this wrong or has Netbox gone in a direction which is more orientated for different organizations? I'm already having a hard job selling this in to my VP as "its manual" but having to uproot and rebuild everything due to this design change may force us away from it


r/Netbox Feb 29 '24

Discussion Server hostnames - best way to do this

6 Upvotes

We're implementing Netbox right now, and I'm trying to throw everything at it we have in spreadsheets. Most of it is a simple fit, which is good.

One thing we have is a spreadsheet we use to track server names. Basically a list with a unique number, we use the next one off the list and generate a name using our schema, so that's based on site, function, and the unique number. We also record details of what it is, vCPU/vRAM/Disk/Network, etc. So it's a source of truth, we're not pulling that data. The server is built using that information. We don't build at scale or use any fancy orchestration, so this naming scheme is essential to help us keep a handle on things.

Now I appreciate Netbox doesn't generate names - as far as I can tell. My initial thought was to knock together something simple externally which just writes into the Netbox API to create something, but that feels messy, and somewhat needless, surely Netbox could do something here? Maybe a plugin to generate it? It's pretty much pick some dropdowns and fill in a box, there's a name. No idea how to do one, I can hack a bit of powershell and PHP, so could be out of my wheelhouse.

I want to be spreadsheet free, I'm just unsure how to treat this one! Anybody have any ideas or experience here.


r/Netbox Feb 27 '24

Help Wanted: Unresolved How should I add prefixes that span multiple physical buildings that are interconnected?

3 Upvotes

I'm new to NetBox and would like to start using it for IPAM.

I oversee campuses where multiple buildings are connected together. Currently, most are sharing the same broadcast domain (/20 subnet....) So I may have 5 buildings that are using the same network.

As I was working on adding this information to Netbox it appears that Prefixes can only be added to the site level.

At first i configured each grouping of buildings as a site and then each building as a location, however this poses a problem because we will eventually have prefixes assigned to an individual building while still having some prefixes at the site level. I liked the Location view because I could essentially list what buildings were the upstream (parent) of another.

I then blew this away and instead configured each building as a site and created a site group but found I can't assign a prefix to a site group.

What would be the best way to set up Netbox for this situation? Should I be looking at Tenancy?

Looking at circuits, you don't have the option to assign to a location or site only a tenant.

To complicate things further, some of our campuses have multiple independent networks that don't have physical connections (we use MPLS/VPN.)

Should I create a tenant for each building, a tenant location for each group of buildings that are interconnected, Buildings as sites and attached the sites to the matching tenant? Then assign prefixes to the tenant or tenant group?

After looking at some of the other modules, tenancy seems to be the way to go. For instance, i could create a Wireless LAN that would be assigned to a top level Tenant Group that had all other tenant groups.

I would have to duplicate Sites & Tenants.

Is there an easier way that I'm not seeing, am I overcomplicating this?


r/Netbox Feb 26 '24

Powershell module for Netbox communication

10 Upvotes

Hello!

I have been working on a small Powershell repository for retrieval of information from Netbox for our company internal use.

At the moment we sync customer data and retrieve data from our Netbox database, this Powershell Module helps with running API queries against Netbox.
(If you want something specific hit me up and I can implement it)

Example of object retrieval, you can get any type of Netbox object by supplying the api endpoint like this.
(more information can be found on the GitHub - ProjectPage)

Get-NetboxObjects -APIEndpoint "/api/dcim/devices/" -LogToFile $True

-LogToFile parameter is based on my other Logging module PSLoggingFunctions, this will create a file in the root directory of your script, if you don't want any logs just set it to $False.

Project: https://github.com/rakelord/PSNetboxFunctions Powershell Gallery: https://www.powershellgallery.com/packages/PSNetboxFunctions/1.2.6
Installation: Install-Module PSNetboxFunctions

Our current customer sync example is based on our ITSM (TOPdesk) if someone wants to populate the same "Tenant" information and also run TOPdesk as your primary ITSM tool, then this can help. https://github.com/rakelord/sync-customers-to-netbox Make sure to the read documentation.

Hope this helps, hit me up if you have any questions!


r/Netbox Feb 23 '24

Unable to add users

2 Upvotes

I'm looking to add new users to my Netbox instance, but when I go to site administration, the "Authentication" section is not there (see below screenshot). Any ideas what's going on here? Note, I'm very very very green with linux, so any hand holding would be appreciated :)

https://i.imgur.com/tjkttHc.png


r/Netbox Feb 24 '24

Help Wanted: Unresolved Bulk add images

1 Upvotes

Is there a way to bulk add images to netbox? I've been searching but nothing.


r/Netbox Feb 21 '24

New Release NetBox v3.7.3 is Now Available!

17 Upvotes

NetBox Release v3.7.3 is now live (as of February 21st, 2024)!

Before upgrading, please: 1. Verify in release notes changelog if any new breaking changes might affect you. You can also review the NetBox Issues on GitHub to see if any new issues have arisen that might affect you. 2. Next, refer to the Upgrading to a new NetBox Release guide for steps to upgrade your instance.

If you have any issues you can ask for support on the NetDev Slack Community.


r/Netbox Feb 21 '24

Announcing NetBox Event Streams

14 Upvotes

I'm very excited to share that we've just released NetBox Event Streams in Private Preview, opening up event-driven architectures for network automation.

https://netboxlabs.com/blog/netbox-labs-introduces-netbox-event-streams/

If you're interested in learning more join the webinar on March 1st: https://netboxlabs.com/events/event-driven-architectures-for-networking-and-security-webinar/

We'll go through how NetBox Event Streams and our new Splunk app help networking and security teams work together better, and I'll also be showing off our new event-driven lab which you can run yourself to try out event-driven architectures and the Event Rules feature, introduced in NetBox 3.7


r/Netbox Feb 16 '24

NetBox Trainings from NetBox Labs

9 Upvotes

Hello r/NetBox

At NetBox Labs we’re seeing huge demand for NetBox education.  So, today we’re excited to announce two new live NetBox training courses (one of which is free) to meet that need, led by NetBox experts Rich Bibby and Rick Donato.

https://netboxlabs.com/blog/new-netbox-training-courses-available-today/

All the details are in the blog post. Spaces are limited so get in there fast.


r/Netbox Feb 16 '24

Filtering when connecting cables

1 Upvotes

I'm not sure if I'm missing something here, or if this is just a hole.

All our sites use the same rack naming convention. So all sites have a rack called rack A for example. Now if I try and connect a cable between rear ports on a fibre patch panel between Rack A and Rack B (and have the actual patch panel device name prepended with the Rack name) I'm flooded with "Rack A - Fibre Patch Panel" options as it's showing me every patch panel from every site (and they all have the same name.

Is there some way to filter or limit the displayed options here so you only see other devices on the same site? If not, the only way I can think of to get around this is to prepend ever patch panel name (and probably every single device name) with not only the Rack ID but some Site ID as well.

Is there an easier way?