troubleshooting NAPALM integration v2.1.0

1,684 views
Skip to first unread message

Jamie Patmore

unread,
Jul 30, 2017, 1:26:00 PM7/30/17
to NetBox

We've updated to latest version, and installed NAPALM as per the instructions, added username/password etc.  

However, when we try and obtain the status of a device (JUNOS device), we get error messages that the napalm device driver isnt able to be located (see attached) ;




Do we need to be modifying anything else to point to the NAPALM driver other than the device platform?








John Anderson

unread,
Jul 30, 2017, 5:37:13 PM7/30/17
to NetBox
I ran into the same thing. Im my case, I upgrade to 2.1.0 and then installed napalm on the netbox server. At this point, I was running into the same thing yo are currently seeing. The solution was just to restart the netbox service again after the napalm install. If this fixes the issue for you, it way be worth adding a note in the docs. 

-John

Jamie Patmore

unread,
Jul 31, 2017, 8:42:53 AM7/31/17
to NetBox
Excellent - that did the trick, thanks for the reply.  I had restarted the process as part of the upgrade, but doing it again cleared the Napalm issue

Brandon Hurrle

unread,
Aug 2, 2017, 9:00:58 AM8/2/17
to NetBox

This didn't seem to work for me, I installed napalm, changed configuration.py; rebooted, and restarted netbox. I get the following now: {"detail":"NAPALM is not installed. Please see the documentation for instructions."} Went back and verified napalm was installed it was. I rebuilt my netbox environment using the upgrade.sh. Also I am on 2.1.0. Still no go. What else can I try or am I just doing something wrong? Thanks.

Jeremy Stretch

unread,
Aug 2, 2017, 9:36:24 AM8/2/17
to Brandon Hurrle, NetBox
You can try importing napalm within the NetBox Python shell to verify whether it is installed:

$ ./manage.py nbshell
### NetBox interactive shell (jstretch-laptop)
### Python 2.7.6 | Django 1.11.3 | NetBox 2.1.1-dev
### lsmodels() will show available models. Use help(<model>) for more info.
>>> import napalm
>>>

If the import returns an error, napalm has not been installed.

Jeremy


--
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-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/8424ddcf-18fb-492a-958e-43bd3ad4692a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

John Anderson

unread,
Aug 2, 2017, 9:41:07 AM8/2/17
to Jeremy Stretch, Brandon Hurrle, NetBox
Yeah I would give what Jeremy suggestion a try. This smells like napalm didn't get installed in the same place netbox is. Maybe a python 2 vs 3 issue? Just thinking out loud... 
Is netbox running in a virtualenv or the other way around?

-John

On Wed, Aug 2, 2017 at 9:35 AM, 'Jeremy Stretch' via NetBox <netbox-...@googlegroups.com> wrote:
You can try importing napalm within the NetBox Python shell to verify whether it is installed:

$ ./manage.py nbshell
### NetBox interactive shell (jstretch-laptop)
### Python 2.7.6 | Django 1.11.3 | NetBox 2.1.1-dev
### lsmodels() will show available models. Use help(<model>) for more info.
>>> import napalm
>>>

If the import returns an error, napalm has not been installed.

Jeremy

On Wed, Aug 2, 2017 at 9:00 AM, Brandon Hurrle <hubr...@gmail.com> wrote:

This didn't seem to work for me, I installed napalm, changed configuration.py; rebooted, and restarted netbox. I get the following now: {"detail":"NAPALM is not installed. Please see the documentation for instructions."} Went back and verified napalm was installed it was. I rebuilt my netbox environment using the upgrade.sh. Also I am on 2.1.0. Still no go. What else can I try or am I just doing something wrong? Thanks.

On Sunday, July 30, 2017 at 4:37:13 PM UTC-5, John Anderson wrote:
I ran into the same thing. Im my case, I upgrade to 2.1.0 and then installed napalm on the netbox server. At this point, I was running into the same thing yo are currently seeing. The solution was just to restart the netbox service again after the napalm install. If this fixes the issue for you, it way be worth adding a note in the docs. 

-John

On Sunday, July 30, 2017 at 1:26:00 PM UTC-4, Jamie Patmore wrote:

We've updated to latest version, and installed NAPALM as per the instructions, added username/password etc.  

However, when we try and obtain the status of a device (JUNOS device), we get error messages that the napalm device driver isnt able to be located (see attached) ;




Do we need to be modifying anything else to point to the NAPALM driver other than the device platform?








--
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-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to netbox-...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "NetBox" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/netbox-discuss/rDMEy052yP0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to netbox-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to netbox-discuss@googlegroups.com.

Brandon Hurrle

unread,
Aug 2, 2017, 10:15:17 AM8/2/17
to NetBox

So I did as Jeremy said and it didn't throw any errors.
### NetBox interactive shell (netbox)
### Python 2.7.12 | Django 1.11.3 | NetBox 2.1.0

### lsmodels() will show available models. Use help(<model>) for more info.
>>> import napalm
>>>

So it looks like its installed. My entire netbox install is on a ubuntu VM. Maybe I just have my test device setup wrong.... I created a "platform" called IOS and set the napalm driver to ios; then edited the device to set its platform to that. Is there anything beyond that I need to do. I double checked my credentials I created, and I can manually login to my device with them. I added them to the configuration.py; They were read-only at first but I changed it so they can use the enable prompt. Any other ideas?

Jeremy Stretch

unread,
Aug 2, 2017, 10:24:19 AM8/2/17
to Brandon Hurrle, NetBox
I can confirm that this has nothing to do with the platform or authentication settings. The code causing the error is here:
# Check that NAPALM is installed and verify the configured driver
try:
import napalm
from napalm_base.exceptions import ConnectAuthError, ModuleImportError
except ImportError:
raise ServiceUnavailable("NAPALM is not installed. Please see the documentation for instructions.")
For whatever reason, NetBox is unable to import the library and/or the two exceptions listed. What version of napalm do you have installed?

$ pip freeze | grep napalm
napalm==1.2.0
napalm-base==0.24.3
napalm-eos==0.6.0
napalm-fortios==0.4.0
napalm-ios==0.7.0
napalm-iosxr==0.5.4
napalm-junos==0.12.0
napalm-nxos==0.6.0
napalm-panos==0.4.0
napalm-pluribus==0.5.1
napalm-ros==0.2.2
napalm-vyos==0.1.3





--
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-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.

Brandon Hurrle

unread,
Aug 2, 2017, 10:26:25 AM8/2/17
to NetBox
napalm==1.2.0
napalm-base==0.24.3
napalm-eos==0.6.0
napalm-fortios==0.4.0
napalm-ios==0.7.0
napalm-iosxr==0.5.4
napalm-junos==0.11.0
napalm-nxos==0.5.3
napalm-panos==0.4.0
napalm-pluribus==0.5.1
napalm-ros==0.2.2
napalm-vyos==0.1.3

Brandon Hurrle

unread,
Aug 2, 2017, 4:51:50 PM8/2/17
to NetBox
Just to try it I upgraded to 2.1.1 and switched to the newer version of the configuration.py, still same result, says Napalm is not installed when I try to use the additional functionality like status or LLDP. Tried uninstalling napalm and reinstalling, still no luck. Not sure what else to look at. Any other suggestions?

TM

unread,
Aug 3, 2017, 1:03:56 PM8/3/17
to NetBox
Maybe remove the quotes from the NAPALM driver name? According to this, the driver names are without quotes...

Brandon Hurrle

unread,
Aug 15, 2017, 4:46:44 PM8/15/17
to NetBox
So I figured this our finally, is that when I installed napalm, I used the command sudo pip install napalm; which looked like it installed everything correctly, what I failed to notice is a little comment that recommends running sudo with -H, so I ran the command sudo -H pip install napalm and lo and behold it worked.
Reply all
Reply to author
Forward
0 new messages