Check_snmp plugin not reading MIB file

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.
Locked
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Check_snmp plugin not reading MIB file

Post by pradeepanan »

Folks,

I am using check_snmp plugin to monitor cisco device. I managed to install MIB files and obtain proper OIDs for my monitoring. However when I call check_snmp to use mib file, its showing the proper string("online" in my case") value through cli. However on nagios frontend its parsing only the Integer value.

This is the command I am using.
/usr/lib64/nagios/plugins/check_snmp -m /usr/share/snmp/mibs/CISCO-UNIFIED-COMPUTING-STORAGE-MIB.my -H X.X.X.X -C opennms-Priv -P 2c -o .1.3.6.1.4.1.9.9.719.1.45.4.1.18.1 -R "online" -l Device
SNMP OK - Device online(1)
However once configuring host and service, it parsing only the integer value (1) but not "online". Looks like its not using the MIB file. Any idea what I am missing?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_snmp plugin not reading MIB file

Post by rkennedy »

Are you executing over the CLI as the root user? It may be permissions. What happens if you run check_snmp as the nagios user? What is the output of ls -la /usr/share/snmp/mibs/CISCO-UNIFIED-COMPUTING-STORAGE-MIB.my?

If that's not it, please post the service definition + related command definition for us to compare your configurations.
Former Nagios Employee
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Re: Check_snmp plugin not reading MIB file

Post by pradeepanan »

Yes, I was running as root through CLI. I gave full permission to the mib file to see how it works.
ls -lh | grep -i storage
-rwxrwxrwx 1 root root 222K Jun 16 2014 CISCO-UNIFIED-COMPUTING-STORAGE-MIB.my
Here the service and command definition.
define command{
command_name UCS-CIMC-DRIVE-Stats
command_line $USER1$/check_snmp -m /usr/share/snmp/mibs/CISCO-UNIFIED-COMPUTING-STORAGE-MIB.my -H $HOSTADDRESS$ -C opennms-Priv -P 2c -o .1.3.6.1.4.1.9.9.719.1.45.4.1.18.1 -R "online" -o .1.3.6.1.4.1.9.9.719.1.45.4.1.18.2 -R "online" -o .1.3.6.1.4.1.9.9.719.1.45.4.1.18.3 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.4 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.5 -R "online" -o .1.3.6.1.4.1.9.9.719.1.45.4.1.18.6 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.7 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.8 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.9 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.10 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.11 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.12 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.13 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.14 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.15 -R "online" -o.1.3.6.1.4.1.9.9.719.1.45.4.1.18.16 -R "online" -l "Drive 1" -l "Drive 2" -l "Drive 3" -l "Drive 4" -l "Drive 5" -l "Drive 6" -l "Drive 7" -l "Drive 8" -l "Drive 9" -l "Drive 10" -l "Drive 11" -l "Drive 12" -l "Drive 13" -l "Drive 14" -l "Drive 15" -l "Drive 16"
}


Service Definition,
define service {
use UCS-Drive-Stats
service_description Drive_Status
check_command UCS-CIMC-DRIVE-Stats
host_name Toronto-HSS-CIMC-2
servicegroups All_Services
contact_groups Users
}
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_snmp plugin not reading MIB file

Post by rkennedy »

What output are you seeing in the Nagios interface? I don't know if it can check that many OID's at a time.
Former Nagios Employee
pradeepanan
Posts: 41
Joined: Wed Sep 30, 2015 1:58 pm

Re: Check_snmp plugin not reading MIB file

Post by pradeepanan »

I am seeing below from nagios. The reason its showing critical is, my command is configured to se OK state when it find "online" . But its returning the integer value "1" which by MIB is for "online"

Capture.JPG
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_snmp plugin not reading MIB file

Post by tgriep »

When you poll an OID that returns an integer, that is what it will return, an integer.
If the OID is a string, then it will return a string.
Since what you are polling is an integer, you cannot compare it to a string.
Try changing the -R "online" to -R "1" and see if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pradeeps
Posts: 38
Joined: Thu Dec 22, 2016 11:05 am

Re: Check_snmp plugin not reading MIB file

Post by Pradeeps »

I figured out the issue. I was expecting "online" as per mib and got it installed on master server. However the workers which does the check have no mib installed. So installed one over there which fixed the issue. Thanks for your time helping me in this.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check_snmp plugin not reading MIB file

Post by dwhitfield »

It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!
Locked