NetBox Napalm multiple users, passwords (one pass to rule them all)

504 views
Skip to first unread message

Buffer Overflow

unread,
Apr 7, 2020, 8:43:31 AM4/7/20
to NetBox

Hello.


Is there a way to define multiple napalm user/pass credentials within netbox config file? Not all devices on my network have the same username/password. I know you can call Netbox API and define custom credentials, but I need this functionality only for status of the devices on Netbox webGUI.


Part of the netbox config:

 #Credentials that NetBox will uses to authenticate to devices when connecting via NAPALM.
 NAPALM_USERNAME = 'admin'
 NAPALM_PASSWORD = 'admin'


Regards

Jeremy Stretch

unread,
Apr 7, 2020, 9:02:22 AM4/7/20
to Buffer Overflow, NetBox
You cannot configure NetBox to try different credentials, but you can pass credentials in an API request yourself using the X-NAPALM-Username and X-NAPALM-Password headers.

Or, alternatively, create a common read-only user for NetBox to use.

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/1c3a0cc6-409c-4427-b8b5-c7d468573528%40googlegroups.com.


--
Jeremy Stretch
Sr. Network Automation Engineer
Network to Code, LLC

Buffer Overflow

unread,
Apr 7, 2020, 9:24:11 AM4/7/20
to NetBox
Hello.

Thank you for the reply. Yeah, creating a user would be the best option, but another team is managing credentials and I don't want to nag them.

Is it possible to pass API request via config context?

For example:

{
    "headers": {
        "Accept": "application/json; indent=4",
        "Authorization": "Token 635cf5c26e6532161310ab4fbfc1340e89768707",
        "Content-Type": "application/json",
        "X-NAPALM-Password": "admin",
        "X-NAPALM-Username": "admin"
    },
    "method": "get",
    "queries": {
        "method": "get_environment"
    },
    "raw_url": "http://netbox/api/dcim/devices/1/napalm/?method=get_environment",
    "url": "http://netbox/api/dcim/devices/1/napalm"
}

Regards.

On Tuesday, April 7, 2020 at 3:02:22 PM UTC+2, Jeremy Stretch wrote:
You cannot configure NetBox to try different credentials, but you can pass credentials in an API request yourself using the X-NAPALM-Username and X-NAPALM-Password headers.

Or, alternatively, create a common read-only user for NetBox to use.

On Tue, Apr 7, 2020 at 8:43 AM Buffer Overflow <rebr...@gmail.com> wrote:

Hello.


Is there a way to define multiple napalm user/pass credentials within netbox config file? Not all devices on my network have the same username/password. I know you can call Netbox API and define custom credentials, but I need this functionality only for status of the devices on Netbox webGUI.


Part of the netbox config:

 #Credentials that NetBox will uses to authenticate to devices when connecting via NAPALM.
 NAPALM_USERNAME = 'admin'
 NAPALM_PASSWORD = 'admin'


Regards

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages