Page 1 of 2

snmp dont work with nagios "Cannot find module"

Posted: Thu Jul 02, 2015 2:09 pm
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?

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

Posted: Thu Jul 02, 2015 2:21 pm
by ssax
Try testing the command and post the full output of the test.

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

Posted: Thu Jul 02, 2015 2:32 pm
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

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

Posted: Thu Jul 02, 2015 3:00 pm
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

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

Posted: Thu Jul 02, 2015 3:45 pm
by ssax
Do you have it set in your environment?

Code: Select all

env | grep MIB

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

Posted: Thu Jul 02, 2015 3:48 pm
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?

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

Posted: Thu Jul 02, 2015 4:10 pm
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.

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

Posted: Fri Jul 03, 2015 11:11 am
by Jessuzz94
sorry, cant work :s, i dont understand, all runs fine, i installed pnp4nagios and now snmp commands dont work :c

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

Posted: Fri Jul 03, 2015 2:58 pm
by Jessuzz94
So i think that is bug of net-snmp package, i search and search and no one have the solution.

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

Posted: Mon Jul 06, 2015 11:52 am
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