Page 1 of 1
Check_snmp plugin not reading MIB file
Posted: Fri Jan 27, 2017 9:35 am
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?
Re: Check_snmp plugin not reading MIB file
Posted: Fri Jan 27, 2017 1:14 pm
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.
Re: Check_snmp plugin not reading MIB file
Posted: Fri Jan 27, 2017 2:53 pm
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
}
Re: Check_snmp plugin not reading MIB file
Posted: Fri Jan 27, 2017 3:08 pm
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.
Re: Check_snmp plugin not reading MIB file
Posted: Fri Jan 27, 2017 3:13 pm
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"
Re: Check_snmp plugin not reading MIB file
Posted: Mon Jan 30, 2017 1:31 pm
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.
Re: Check_snmp plugin not reading MIB file
Posted: Tue Jan 31, 2017 9:37 am
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.
Re: Check_snmp plugin not reading MIB file
Posted: Tue Jan 31, 2017 5:04 pm
by dwhitfield
It sounds like this issue has been resolved. Is it okay if we lock this thread? Thanks for choosing the Nagios forums!