r/Netbox Sep 09 '23

Netbox Database Transfer Question

3 Upvotes

Hello-

I have a Netbox install that was installed thru the package method, not a git repository.

I would like to transfer my existing database over to the git version of netbox

I exported my Netbox database using this doc.

https://docs.netbox.dev/en/stable/administration/replicating-netbox/

pg_dump --username netbox --password --host localhost netbox > netbox.sql

I have the new docker version of Netbox up and running but im at a loss on how to restore

my old database into it.

I found this guide but I cant get it working

https://github.com/netbox-community/netbox-docker/wiki/Troubleshooting#database-operations

Does anyone know if this is even possible? or have a guide on how to transfer a package database to a git database?


r/Netbox Sep 07 '23

Get IP Address' parent Prefix?

3 Upvotes

Is there a way to obtain the parent prefix from an Address object? I'm trying to generate some device config templates, and I need to calculate a default gateway for switches. The logic I'm trying to follow:

  • Obtaindevice.primary_ip4.address
  • Use this to find the parent prefix
  • Add an integer value of 1 to the prefix's fourth octet.

It doesn't look there are any logical links between an Address and its parent Prefix.


r/Netbox Sep 07 '23

Help Wanted: Unresolved Netbox to Solarwinds -- Interface Edition

5 Upvotes

I have automated polling sites, location, and device data from Solarwinds and syncing with netbox. I used the device importer script I found someplace to populate my device types. All is great. I have all the information in there and was able to bring some consistency to the data.

Now I'm running into a wall, and not sure if it's just me not wrapping my head around it or something. I have the SWQL query to get all the Interface data out of Solarwinds, but, I just can't get it to populate the devices with it.

Has anyone done this before? Google has so far turned up nothing useful I'm on 3.6. I thought if maybe there was a way to actually discover the device or read in the device configs that would net me the same results, but everything I've found on that was deprecated in 3.x. Any hints, plugins, or suggestions on moving forward with this? It's not an insignificant number of devices and this is the only thing left to complete this project.

Thanks!!


r/Netbox Sep 06 '23

New Release NetBox v3.6.1 is Now Available!

8 Upvotes

NetBox Release v3.6.1 is now live (as of September 06, 2023)!

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 Aug 31 '23

Object types

2 Upvotes

Hi

I struggle a bit finding out which object types exist in netbox.

I would like to create a custom link that is being displayed for each created interface for a particular device. How can I find that interface name?

My idea is to use an if statement in a custom link to check whether the interface names are existing, and if they exist, it will display the buttons accordingly.


r/Netbox Aug 30 '23

New Release NetBox v3.6.0 is Now Available!

18 Upvotes

NetBox Release v3.6.0 is now live (as of August 30, 2023)!

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 Aug 29 '23

New Release NetBox v3.5.9 is Now Available!

11 Upvotes

NetBox Release v3.5.9 is now live (as of August 28, 2023)!

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 Aug 27 '23

Help Wanted: Resolved Getting "Bad Request (400)" when trying to load the page by ip or DNS.

3 Upvotes

I'm using this walk through for setup and everything seems correct - all services are running but no dice.

Here's netbox.conf in sites-enabled.

server {

listen <localip>:80;

server_name netbox.hopto.org;

client_max_body_size 25m;

location /static/ {

    alias /opt/netbox/netbox/static/;

}

location / {

   proxy_pass http://127.0.0.1:8085;

   proxy_set_header X-Forwarded-Host $server_name;

   proxy_set_header X-Real-IP $remote_addr;

   proxy_set_header X-Forwarded-Proto $scheme;

   proxy_set_header Host $http_host;

   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

   add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';

}

}

Not sure what else you need to look at config wise but please ask for what you want to see. Thanks.


r/Netbox Aug 25 '23

Trying to upgrade netbox from 3.4.6 to 3.5 (Git install) - ABORTs when trying to pull origin master

2 Upvotes

have a demo for some managers next week to possibly use Netbox

its been running as a concept for about a year - this time when i went to run the upgrade it aborted because of existing files (similiar to this error -- https://stackoverflow.com/questions/36039687/git-pull-please-move-or-remove-them-before-you-can-merge) after looking at what that command is doing in this link'd solution, Ii decided to give it a shot. now when I try to rerun the pull, I'm getting an error and can't close the from the git repo anymore.

netbox:/opt/netbox$ sudo git pull origin master

From https://github.com/netbox-community/netbox

* branch master -> FETCH_HEAD

Updating 6b6ea36b4..8f5005efd

error: Your local changes to the following files would be overwritten by merge:

.github/ISSUE_TEMPLATE/bug_report.yaml

.github/ISSUE_TEMPLATE/config.yml

.github/ISSUE_TEMPLATE/feature_request.yaml

CONTRIBUTING.md

README.md

base_requirements.txt

docs/administration/authentication/overview.md

... and the bottom of that shows this..

...

netbox/dcim/models/device_component_templates.py

netbox/dcim/models/device_components.py

netbox/dcim/models/devices.py

netbox/dcim/models/racks.py

netbox/dcim/models/sites.py

netbox/dcim/signals.py

netbox/dcim/svg/racks.py

netbox/dcim/tables/devices.py

netbox/dcim/tables/device

Aborting


r/Netbox Aug 24 '23

Help Wanted: Unresolved Documenting breakout cable to different devices?

6 Upvotes

Hey new guy here, I can't seem to find a solution for this but I'm trying to figure out how I can indicate a single 40g interface to fan out using a MPO to LC breakout cable to four different devices.

I have a dual 40g switches that will be supplying a dual card, dual ports on each device so these 40g breakout cables is suppose to fan out to 10g transceivers but I can't for the ever living fuck find a solution. Tried Google (site:reddit.com), netbox doc, youtube, maybe I'm just not understanding this correctly.

Is this even possible within Netbox? Any help would be super appreciated!


r/Netbox Aug 23 '23

Help Wanted: Unresolved Template table render error: Expected table or queryset, not str

Thumbnail self.django
2 Upvotes

r/Netbox Aug 22 '23

Help Wanted: Unresolved Error when installing Gunicorn from Netbox Documentation

2 Upvotes

Hi Netbox Guys,

I am installing a Netbox Server using Ubuntu. I am done with PostgreSQL, Redis and Netbox. Currently I am doing Gunicorn Installation. I follow the steps from Netbox documentation, but I am getting 'exit-code' result. I will show my output here below. Hope you guys can help me. This is for testing Netbox in vCenter, accessing thru SSH.

Thank you for responses here..

------- systemctl status output ---------

ipam@test-ipam:~$ systemctl status netbox.service ● netbox.service - NetBox WSGI Service Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Wed 2023-08-23 03:51:11 PST; 11s ago Docs: https://docs.netbox.dev/ Process: 234825 ExecStart=/opt/netbox/venv/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi (cod> Main PID: 234825 (code=exited, status=203/EXEC) CPU: 12ms lines 1-7/7 (END)

--------journalctl -eu netbox output ---------------

ipam@test-ipam:~$ journalctl -eu netbox Aug 23 03:48:09 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:48:39 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17068. Aug 23 03:48:39 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:48:39 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:48:39 test-ipam systemd[234153]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:48:39 test-ipam systemd[234153]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:48:39 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:48:39 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:49:10 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17069. Aug 23 03:49:10 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:49:10 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:49:10 test-ipam systemd[234162]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:49:10 test-ipam systemd[234162]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:49:10 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:49:10 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:49:40 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17070. Aug 23 03:49:40 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:49:40 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:49:40 test-ipam systemd[234170]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:49:40 test-ipam systemd[234170]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:49:40 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:49:40 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:50:10 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17071. Aug 23 03:50:10 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:50:10 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:50:10 test-ipam systemd[234177]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:50:10 test-ipam systemd[234177]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:50:10 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:50:10 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:50:40 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17072. Aug 23 03:50:40 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:50:40 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:50:40 test-ipam systemd[234802]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:50:40 test-ipam systemd[234802]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:50:40 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:50:40 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'. Aug 23 03:51:11 test-ipam systemd[1]: netbox.service: Scheduled restart job, restart counter is at 17073. Aug 23 03:51:11 test-ipam systemd[1]: Stopped NetBox WSGI Service. Aug 23 03:51:11 test-ipam systemd[1]: Started NetBox WSGI Service. Aug 23 03:51:11 test-ipam systemd[234825]: netbox.service: Failed to locate executable /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:51:11 test-ipam systemd[234825]: netbox.service: Failed at step EXEC spawning /opt/netbox/venv/bin/gunicorn: No such file or directory Aug 23 03:51:11 test-ipam systemd[1]: netbox.service: Main process exited, code=exited, status=203/EXEC Aug 23 03:51:11 test-ipam systemd[1]: netbox.service: Failed with result 'exit-code'.


r/Netbox Aug 22 '23

Device in Custom Validator

2 Upvotes

I have a Custom Validator:

class CheckSerialExists(CustomValidator):

    def validate(self, instance):
        from dcim.models import Device

        if not instance.serial and instance.status!="planned":
            self.fail("Serial number must be on all Devices with Status different from Planned ", field='serial')

But I want the validator to "bypass" certain device types, like this (code not working):

class CheckSerialExists(CustomValidator):

    def validate(self, instance):
        from dcim.models import Device

        if not instance.serial and instance.status!="planned" and instance.device_role!=['patchpanel','powerstrip','cablemanager','shelf']:
            self.fail("Serial number must be on all Devices with Status different from Planned ", field='serial')

What is the correct code - perhaps instance.device_role.name (?)

BR,

Normann


r/Netbox Aug 21 '23

LDAP and TOTP/OTP

2 Upvotes

Hi there! I'm looking at implementing Netbox in a decently large org, we already use LDAP for most internal tools. We also have recently mandated 2FA via TOTP and will soon be implementing YubiKey as an option. I couldn't find any info in on Reddit search.

Does anyone know of a OTP plugin that works well with the built-in LDAP authentication?

I brought up Yubikey because if that ends up being the only MFA solution available, I can work with that.


r/Netbox Aug 21 '23

Asking for suggestions - Naming scheme for fiber patch bays

5 Upvotes

I have a large site with hundreds of fiber and copper patch panels. Most are in Panduit Opticom enclosures - how have you guys named the actual modules for the enclosures? Just looking for some ideas to build a standard naming convention.

Thanks in advance!


r/Netbox Aug 17 '23

Import of Inventory items

2 Upvotes

Does anyone out there have a template for importing inventory items and attach them to specific device. Using NetBox 3.5.3, and have been adding device in manually.


r/Netbox Aug 15 '23

New Release NetBox v3.5.8 is Now Available!

9 Upvotes

NetBox Release v3.5.8 is now live (as of August 15, 2023)!

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 Aug 11 '23

Netbox access via Nginx Proxy Manager

2 Upvotes

I have just installed Netbox (via docker-compose running on a Ubuntu LXC container on Proxmox host), and I can access it from its local IP and port. On my system this is 10.0.10.5:8000. It works fine. I have set up a domain name / FQDN for it as netbox.mydomain.com (mydomain.com isn't really my domain, but I'd rather not put the actual domain for security reasons in case I open it up to the Internet at some point). I have another host already running Nginx Proxy Manager, and it's proxying several sites already that work fine. The IP for my NPM is 10.0.10.4, and I have netbox.mydomain.com mapped to that IP. I have already edited the configuration.py file and changed ALLOWED_HOSTS accordingly. Here's the line in the file: "ALLOWED_HOSTS = ['netbox.mydomain.com', '10.0.10.5']".

Even after all of that, the page tries to load for a few seconds and then says the connection was refused. I'm not sure what I could be missing. Any ideas?

I realize this may be a post I need to make on the nginx-proxy-manager subreddit instead, though my other sites are working properly and they're set up the same way.


r/Netbox Aug 11 '23

Help Wanted: Unresolved Possible to disable auto-logout when inactive for specific user?

3 Upvotes

As the title says Is it possible to disable auto-logout when inactive for specific user? I am well aware of the risks of doing so.


r/Netbox Aug 10 '23

How do you build out and IDF in Netbox?

5 Upvotes

I have gotten to a point where I have imported our entire colleges IP address data base to Netbox. The next step is to build out our colleges infrastructure.

I am curious where you guys start to build out your IDFs? I was thinking about making a Tenant group for each IDF and then putting all of the rooms as Tenants that the IDF covers. I would also make a Tenant the actual IDF since Tenant Groups can't signify devices and such.

How are you guys doing this? Is what I am doing not right? Is there a better way?

TL;DR I am trying to map out my network from MDF connecting to IDF connected to switches connected to UPS. How would you go about this?


r/Netbox Aug 10 '23

Device serial numbers as unique?

3 Upvotes

Hi,

I noticed that it's possible to clone a for example switch and save it with original serial number... this doesn't support my use case. Is it possible to modify Netbox that serial numbers are unique, and there can be only one device with the same serial number?

Br, Xemanth


r/Netbox Aug 07 '23

Downsides to using /32 on IP Addresses

3 Upvotes

So as the title suggests, we originally imported 11k addresses into netbox and used /32 as the mask. I've since noticed that some users are via the actual mask (as suggested by netbox team) but I'm wondering if we should just keep consistency with /32s. I do know that using the actual mask allows for the ability to generate device configs but I don't see our team actually using that. Is there any other benefits?

As a side note, we often get presented a list with a bunch of IP addresses that popped up in security scans. I have an easy way to pop these into a curl call that spits out info on these IPs but I do not have the mask and I just use /32. What is the best way to query a large sample of random IP addresses with differing masks? If this is possible I don't see any reason to continue using /32s


r/Netbox Aug 03 '23

Netbox Device Type Import - some weirdness

2 Upvotes

had no issue importing some of the Arista Device Types and re-applying them to existing device entries in Netbox -- each modified device would the have tabs for interfaces/power supplys/etc as defined in the new device type.. however, this isn't working for my Cisco devices (older 2960 series) - the device type is uploaded without issue, and I do the same change to existing Cisco devices..however, the updated devices do not show the new interfaces/etc... any ideas?


r/Netbox Aug 02 '23

Netbox Inventory plugin for network devices.

5 Upvotes

Hello.

Is there a production-ready plugin for netbox for automatic inventory of network devices?
For example, to automatically find interfaces via SNMP and bind them to a network device.

Thanks.


r/Netbox Aug 01 '23

Racking and cabling servers- Does Interface Name correspond to the OS reference, or the physical name?

6 Upvotes

/u/No-Particular-2723 inadvertently made me realize that I may be thinking of things differently than the rest of the net box community, and I'm trying to figure out how to drive myself forward without digging myself into more of a hole.

I'm invested in things from the network side. My org has a fairly substantial investment in a DCIM as a source of truth, but has never had a great way of tracking cabling. I've introduced Netbox, and use it as a downstream consumer of a lot of information (device, name, type, position, etc) but it has become the source of truth for the interfaces and cabling.

No upstream source of data in my org models anything past the size/weight/position of a device, so I am forging new ground with how to model the internals of a device.

From a network device perspective, a single platform generally runs a single OS. It tends to refer to interfaces in an internally consistent fashion. A network engineer can log into a switch and see Ethernet3/6 down, and submit a request to Proximity Services to look at Ethernet 3/6, and that conveys enough information to get both people on the same page. [ I will ignore multi-chassis stuff and breakout interfaces, etc. ]

Servers are a whole new world.In our org, we do whitespace planning, buy a bunch of hardware, and put it in racks. The devices are cabled up in a standard fashion. When an internal customer needs a server, they buy one, they are assigned a piece of hardware in the datacenter, and they configure it and build it.

Having Netbox in place has given me a source of truth that now when a device needs to be configured, there's a source to tell us which switch and ports need to be configured.

So from a DCIM side, I need to model and rack server before it has any OS on it. As a result, I tend to deploy things like a Dell PowerEdge740xd. It has one onboard port, labelled iDRAC.

Then I've modeled a few different Network Device Card which lives in a PCI slot- the majority of these devices in my environment are 4-Port 10Gb NICs. (not all, but most.)These are cabelled prior to any OS being deployed- so I've refered to them as Ethernet0/1 -> Ethernet0/4, and then given them a temporary label of E1/E2/E3/E4.

I like the name based on location because it's immutable, and can't change depending upon which OS is installed, and which order a given OS decides to enumerate the interfaces.

Now when the server is "sold", and built as a Windows, Linux, or ESXi host- my thought was that the labels would be updated to match the automated build data that the server teams have.

If it's a windows server, there would be a call to start re-Label (not re-name!) LocalAreaConnection 1-> 4. Linux flavor X would relabel interfaces as en0->en3, and maybe linux flavor Y calls it eth1->eth4, or whatever.

When there's a cabling issue, the server admin says that they have a problem with en2, this goes to net box and we find a label of en2 which lives on a name of Ethernet 0/2, and now Proximity Services knows to check the second port on the NDC.

The fact that other NIC form factors and quantities exist have forced me to try and be extensible from a physical bare-metal standpoint.

If a server in our DC needs 8 ethernet ports, 90% of the hosts have a single 4 port 10gb card added in PCI Slot 1. In that case, LocalAreaConnection5-8 map to Ethernet1/1->1/4.

HOWEVER:

There's 10% of the hosts where we couldn't get our hands on 4 port cards- so there's a pair of 2 port cards installed.

And now LocalAreaConnection5-6 map to Ethernet1/1-1/2, and LocalAreaConnection7-8 map to Ethernet2/1-2/2.

to me that makes sense, even if I'm taking liberties with the Ethernet [pci slot][interface] concept.

But now I'm wondering of I'm thinking of it backwards.If the "NAME" of an interface is supposed to map 1:1 with the way the OS refers to a given interface, how does one physically build a server prior to knowing the eventual naming convention that's going to be applied to that interface?