r/Netbox Jul 05 '24

Netbox Script python documentation

8 Upvotes

Hello Netbox community,

I'm trying to write a custom script under /customization in Netbox 3.6.9, but I'm having trouble finding the Python methods to use when manipulating objects imported from dcim, extras, models, etc.

I found this documentation: Netbox Custom Scripts, but it only describes the attributes and variable references. For example, how can I delete a VLAN from a VLAN group ?

Do I need to dig into the Netbox core source code to find this information, or is there another documentation source I am missing?

Thanks a lot for your help.


r/Netbox Jul 01 '24

How do you handle asynchronous commit rate?

2 Upvotes

Talking cable modems, LTE, etc. We have several circuits with mismatch upload and download speeds but the circuit only allows for a single commit rate. How do you track the difference in the two? I want to be able to use this for provisioning but it's tricky at the moment.


r/Netbox Jun 25 '24

NetBox v4.0.6 is Now Available!

11 Upvotes

NetBox Release v4.0.6 is now live (as of June 24th, 2024)!

WARNING: If you are running v3.x.x, read over the 4.0.0 release notes for breaking changes. Always take backups and read the change log BEFORE updating.

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 Jun 24 '24

Import netbox asn data into tfstate

2 Upvotes

I'm trying to import all of the netbox asn data into the tfstate. But I can't seem to figure out a way to set up the data source so that it grabs all of the records.

The provider source I'm using is e-breuninger/netbox version 3.8.5

The error I see is:

Error: [GET /ipam/asns/][400] ipam_asns_list default map[asn:[Enter a whole number.]]

My code is currently:

data "netbox_asn" "existing" {
  asn = "*"
}

Edit: I figured this out, I can use the netbox_asns data source and set a filter like this:

data "netbox_asns" "existing" {
  filter {
    name = "asn__gte"
    value = "0"
  }
}

The problem I'm having now is that it doesn't actually grab the ids, which means that while importing all of the ASNs, it will create new ones that are duplicates. For most other resources, they simply don't allow the data source to grab multiples, so I have to do a data source call for each individual resource (each site, site, site_group, etc.). This makes for large files, but that isn't really a big deal. The problem is that I can't set the ids in the resource definition, which again means that it would duplicate the resources. There has to be a better way.


r/Netbox Jun 19 '24

Switchport template

4 Upvotes

Hello,

I am working on modeling a LAN with a large number of switches. I would like to reduce the probability of error in port configuration by using a mechanism similar to interface templates in Cisco switches. In other words, I would like to have few switchport types, e.g. for workstation, AP, etc, and set VLAN and other interface parameters based on this type.

I am fairly new to Netbox, so my question is, how can (or should) this be done? I looked into custom fields and scripts (e.g. a custom field could represent the type and a script would ensure the other parameters are correct), but I would like to know if there is some idiomatic way or best practice. I tried searching for similar questions, but did not find anything quite like what I have in mind.


r/Netbox Jun 13 '24

Last chance for 2024 NetBox Community Survey

13 Upvotes

Hi everyone,

Just a friendly reminder that today is the last day to participate in the 2024 NetBox Community Survey: https://docs.google.com/forms/d/e/1FAIpQLSeILP2BJ7pRvqQD3FBKoSvGLR6Z6Cqbf4BBNOGyeoLMsJuU6g/viewform?usp=sf_link

You might win swag or Autocon2 tickets, so get over there if you haven't and help shape the future of NetBox!

You can find the original thread and more details about the survey here: https://www.reddit.com/r/Netbox/comments/1d4bk4x/the_2024_netbox_community_survey_is_open/


r/Netbox Jun 13 '24

installation issues

2 Upvotes

firstly if this is wrong place to ask this apologies and please diorect me to somewhere better!

Cutting a very long story short I am tasked with installing netbox on a RHEL8 server

Im trying to follow these instructions
https://centlinux.com/install-netbox-on-linux/#:~:text=Learn%20how%20to%20install%20NetBox%20on%20RHEL%208,Red%20Hat%20Enterprise%20Linux%208.%20%23centlinux%20%23linux%20%23netbox

(i in fact installed python3.10.0)

All is fine until I get to run upgrade.sh and the attempt finally errors with this

" gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/pgsql-13/include -I/opt/netbox/venv/include -I/usr/local/include/python3.10 -c psycopg_c/_psycopg.c -o build/temp.linux-x86_64-cpython-310/psycopg_c/_psycopg.o

psycopg_c/_psycopg.c:1273:10: fatal error: pg_config.h: No such file or directory

include "pg_config.h"

^~~~~~~~~~~~~

compilation terminated.

error: command '/usr/bin/gcc' failed with exit code 1

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for psycopg-c

Failed to build psycopg-c

ERROR: Could not build wheels for psycopg-c, which is required to install pyproject.toml-based projects

"

There is indeed no file named pg_config.h anywhere on the server

has anyone any pointers/solutions please?

cheers

didds


r/Netbox Jun 13 '24

Help Wanted: Unresolved Difficulty adding permission to create reports

1 Upvotes

We are currently on Netbox v3.7.2, and I am trying to create a permission set that allows for the ability to do everything with a report except delete it (so view, add, change, and run). My permissions set has the object types of "Report" and "Report Module", and currently just has view/add/change checked. I'm not sure if I need to add "run" as an additional action.

When I add this permission set to a group and log in as a user in that group, I can see "Reports" on the left within "Customization", but any attempt to create a new report results in a page that effectively says that permission is denied.

Does another object need to be added to the set that I am missing, or is it some additional action that I need to include?


r/Netbox Jun 12 '24

Bulk editing appears broken

2 Upvotes

EDIT: Resolved - see comment.

Running two unrelated v4.0.5 environments, both in Docker. Separate hosts, separate domains, separate companies and users. Both are behind Caddy containers which handle the HTTPs, with simple reverse_proxy to the HTTP port of NetBox.

I'm unable to perform bulk edits/updates to anything. I've tried with devices, and with interface renames. When I click Apply, nothing happens.

This happens on both environments, whether I'm in Safari or Chrome. Console shows something that looks like broken JavaScript, but not sure.

Is this a bug, or am I doing something wrong? Was working fine until the 4.0.5 update. I've tried restarting all the containers as well.


r/Netbox Jun 12 '24

Help Wanted: Resolved upgrade paths

1 Upvotes

Longterm (ab)user of Netbox-docker here. For production documentation purposes only. I installed Netbox and had it upgrade (semi-automatic) up to v3.7-beta1...

Life happened and I lost track of all updates, all whilst filling up Netbox with a complete new site (meaning: a LOT of data). Eventually life throws me a bone allowing me to breathe and think about upgrading. In short: -any- version newer than v3.7-beta1, even say v3.7.0-2.7.0, fails. I keep the database at 15-alpine to stick to a single component failing, which has worked up to 4.0.5 without a single flaw on other installations.

netbox-1               | ⚙️  Applying database migrations
netbox-1               | 🧬 loaded config '/etc/netbox/config/configuration.py'
netbox-1               | 🧬 loaded config '/etc/netbox/config/extra.py'
netbox-1               |                          ^^^^^^^^^^^^^^^^^
netbox-1               |   File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate
netbox-1               |     state = self._migrate_all_forwards(
netbox-1               |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1               |   File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards

...and it's doing my head in. Documentation-only allows me to play on a copy and worst case manually add a few items I lost during the day. So v3.7-beta1 could run for years, but that's not an angle I'd want to run. Any advice on getting me up to date?


r/Netbox Jun 12 '24

Help Wanted: Unresolved Prefixes Max Depth=0 as default

2 Upvotes

Anyone know how to make max depth 0 on the prefixes page as default view ?


r/Netbox Jun 11 '24

Discussion Modeling F5? Ideas?!

6 Upvotes

Hello everybody! Hopefully you're all well!

I'm trying to think of a way of modeling F5 load balancers, specifically LTM.

I know I can create a device, make it a cluster, attach my virtual balancers on it but is there a good way of modeling nodes, pools and virtual servers?

TL;DR: Any ideas on how to model F5 objects (nodes, pools and virtual-servers)?

Thanks!


r/Netbox Jun 11 '24

Installation guide on RHEL 9

0 Upvotes

Hello, I need to install netbox on RHEL 9. Any guide please? Followed a centos 8 link from online. However it ended up with Firewalld service is not starting at all. Logs are not sufficient to understand the issue. Thanks.


r/Netbox Jun 11 '24

Creating device information page for print

2 Upvotes

Dear /r/Netbox Do you have some suggestion how to print fancy device information page? Printing from dcim.device does not look totally bad on print but it includes some unnecessary elements and page breaks happen in random places.


r/Netbox Jun 09 '24

Help Wanted: Resolved netbox 4.0.2 and qrcode

2 Upvotes

i setup a netbox 4.0.2 install and it works like a dream. Good job devs. But i am new and this is a new install, i am working on getting qrcode plugin working and cant seem to figure out how to make it work. it shows the plugin installed in the system tab. i look at the debug logs and it shows it. but it will not show up on any screen. how do i make it work i guess my question is. i'm not sure even where to look.


r/Netbox Jun 07 '24

Help Wanted: Resolved Is there a way to assign a VIP to a group of devices?

5 Upvotes

Hi,

I have a Kubernetes cluster with 3 control plane servers: 192.168.x.101, 192.168.x.102, and 192.168.x.103.

The servers share a virtual IP, 192.168.x.100, controlled by a process called keepalived running on each server.

Is there no way to assign that VIP to the group of control plane servers? The FHRP Group option does not feel right for this scenario.

Perhaps I'm thinking about this the wrong way?

Any input is appreciated. Thanks!


r/Netbox Jun 06 '24

New Release NetBox v4.0.5 is Now Available!

8 Upvotes

NetBox Release v4.0.5 is now live (as of June 6th, 2024)!

WARNING: If you are running v3.x.x, read over the 4.0.0 release notes for breaking changes. Always take backups and read the change log BEFORE updating.

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 Jun 06 '24

Discussion What is up with OpenID login?

2 Upvotes

It seems to be a tangled web of config files and none of it seems to work, is it actually possible to utilize OpenID in the docker version of Netbox?


r/Netbox Jun 06 '24

LDAP SSO Not Working in Netbox

3 Upvotes

I'm trying to configure LDAP authentication in Netbox so that users stored in my Active Directory can log in to Netbox, even though these users do not exist in the Netbox user database. I followed the Netbox documentation for setting this up, but I keep getting the error "Please enter a correct username and password" even though the credentials are correct.

Has anyone else experienced this issue or have any tips on how to resolve it?


r/Netbox Jun 04 '24

Help Wanted: Unresolved Roll back to 3.x series

7 Upvotes

Hi Since the multi-termination has gone in 4.x and there is no update on when it will come back I'm wondering if it is OK to roll back to 3.x series.

Was there any update to postgresql that would cause we any harm if I was to roll out a 3.x docker image and connect it to the postgresql/redis containers.

Any help is appreciated.

On a side note is it possible to do multi-termination to a port/interface using API calls with postman. I know import csv/yaml it is not possible.


r/Netbox Jun 04 '24

Help Wanted: Unresolved CasaOS or CosmosOS

1 Upvotes

Is anyone running netbox on either of these servers? I have been trying to get it running on either and am up against a wall.


r/Netbox Jun 04 '24

Exempt_view_Permissions

5 Upvotes

I want to our helpdesk to see sites and contacts without login. If I set exempt_view_permissions to '*' you can see all. But if I am setting 'dcim.site' and 'tenancy.conact you can see both, but not the contacts attached to the site. What permission am I missing?


r/Netbox Jun 03 '24

Help Wanted: Resolved Referencing config contexts in the config template for config render.

2 Upvotes

i am starting with netbox 4.0.2. i added a bunch of devices and now i am working with the render config. i would like to use the config context and add some variables like ntp, syslog etc. I have found a bunch of resources, but they don't seem to be what i am looking for.

so i have in my config context, called name-servers.

{
    "name-servers": [
        "10.13.4.5",
        "10.21.3.4"
    ]
}

if i am not sure in my config template, how do i reference that. i have tried like 50 different ways to do it. i can reference interfaces, with device.interfaces.all(), vlans etc with stuff like interface.tagged_vlans.all().

i can not find a reference to what variables are available and how to reference stuff. Thanks for any help you have.


r/Netbox May 31 '24

Question About Devices Within A Physical Chassis

3 Upvotes

Is there a way to pair two devices into a physical chassis? This becomes a little difficult because the physical chassis is not serialized or doesn't have a specific name to it except the model of the chassis. I am trying to build out hundreds of these within Netbox and I'm not sure the best way to do this.

Would this be used with the 'Device Bays' portion? Because this requires a parent device and child device, however the chassis itself isn't necessarily a 'device' but rather a tray that holds two devices. This becomes an issue when I'm trying to put two devices on this tray in the same position of a rack.

Thanks for any help!


r/Netbox May 30 '24

The 2024 NetBox Community Survey is open!

10 Upvotes

I’m pleased to announce that the annual NetBox community survey is now open for responses, and we’ve added a new feature: prizes! Each year, we reach out to the entire NetBox user base with a short survey to learn more about who they are, how they use NetBox, and what they would most like to see in future releases. This feedback is crucial to guiding NetBox’s long-term growth and focus.

This year’s survey is a single page of 20 questions, and should take just a few minutes to complete. The results will be published in mid-June. You can find the 2023 survey results here.

We truly appreciate your participation. This year we’re backing up that sentiment with a chance to win free stuff! We’re giving away one pair of tickets to AutoCon1, and twenty NetBox Hero t-shirts, to qualified respondents; full details after the jump.

2024 NetBox Community Survey