snmp dont work with nagios "Cannot find module"

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

snmp dont work with nagios "Cannot find module"

Post by Jessuzz94 »

Yesterday snmp worked fine, uptime, bandwidth, por status, all, now i run a command to check uptime and cannot find any mib, my mibs are in /usr/share/snmp/mibs, and when i put the command of check uptime it tel me the mib path /usr/local/share/snmp/mibs, and i dont have any directory of snmp in /usr/local/share, how can i change the mib path?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: snmp dont work with nagios "Cannot find module"

Post by ssax »

Try testing the command and post the full output of the test.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: snmp dont work with nagios "Cannot find module"

Post by abrist »

You can run the following to find out what the default mib path for the net-snmp is:

Code: Select all

net-snmp-config --default-mibdirs
Your version of snmp was probably configured with a different default '--datadir=' than is assumed. What is the output of:

Code: Select all

net-snmp-config --configure-options
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: snmp dont work with nagios "Cannot find module"

Post by Jessuzz94 »

Code: Select all

MIB search path: /home/nagios/.snmp/mibs:/usr/local/share/snmp/mibs
Cannot find module (SNMPv2-MIB): At line 0 in (none)
Cannot find module (IF-MIB): At line 0 in (none)
Cannot find module (IP-MIB): At line 0 in (none)
Cannot find module (TCP-MIB): At line 0 in (none)
Cannot find module (UDP-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-MIB): At line 0 in (none)
Cannot find module (NOTIFICATION-LOG-MIB): At line 0 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 0 in (none)
Cannot find module (DISMAN-SCHEDULE-MIB): At line 0 in (none)
Cannot find module (UCD-SNMP-MIB): At line 0 in (none)
Cannot find module (UCD-DEMO-MIB): At line 0 in (none)
Cannot find module (SNMP-TARGET-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 0 in (none)
Cannot find module (HOST-RESOURCES-TYPES): At line 0 in (none)
Cannot find module (SNMP-MPD-MIB): At line 0 in (none)
Cannot find module (SNMP-USER-BASED-SM-MIB): At line 0 in (none)
Cannot find module (SNMP-FRAMEWORK-MIB): At line 0 in (none)
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 0 in (none)
Cannot find module (SNMP-COMMUNITY-MIB): At line 0 in (none)
Cannot find module (IP-FORWARD-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-PASS-MIB): At line 0 in (none)
Cannot find module (NET-SNMP-EXTEND-MIB): At line 0 in (none)
Cannot find module (UCD-DLMOD-MIB): At line 0 in (none)
Cannot find module (SNMP-NOTIFICATION-MIB): At line 0 in (none)
Cannot find module (SNMPv2-TM): At line 0 in (none)
Cannot find module (NET-SNMP-VACM-MIB): At line 0 in (none)
sysUpTime.0: Unknown Object Identifier (Sub-id not found: (top) -> sysUpTime)
Abrist, these commands dont work :c

Code: Select all

$ net-snmp-config --default-mibdirs
-sh: 43: net-snmp-config: not found
$ sudo net-snmp-config --default-mibdirs
sudo: net-snmp-config: command not found
$ net-snmp-config --configure-options
-sh: 45: net-snmp-config: not found
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: snmp dont work with nagios "Cannot find module"

Post by ssax »

Do you have it set in your environment?

Code: Select all

env | grep MIB
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: snmp dont work with nagios "Cannot find module"

Post by Jessuzz94 »

It show me nothing, all happened when i installed pnp4nagios D:! its some thing that pnp4nagios change the path to view the mibs or something?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: snmp dont work with nagios "Cannot find module"

Post by ssax »

Try this:

Create a new file:

Code: Select all

/usr/share/snmp/snmp.conf
Add this line in it and save it:

Code: Select all

mibdirs  +/usr/share/snmp/mibs
Now run this command and it should show you it will now look in the proper directory as well:

Code: Select all

snmptranslate -Dinit_mib .1.3 2>&1 |grep MIBDIR
Try your command again.
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: snmp dont work with nagios "Cannot find module"

Post by Jessuzz94 »

sorry, cant work :s, i dont understand, all runs fine, i installed pnp4nagios and now snmp commands dont work :c
Jessuzz94
Posts: 162
Joined: Thu Jun 04, 2015 12:08 pm

Re: snmp dont work with nagios "Cannot find module"

Post by Jessuzz94 »

So i think that is bug of net-snmp package, i search and search and no one have the solution.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: snmp dont work with nagios "Cannot find module"

Post by tgriep »

Can you post how you are running the check showing the errors?
Where did you get the plugin?
Please run the following and post the output here.

Code: Select all

yum list |grep snmp
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked