Page 1 of 1
SNMP CPU Temperature Check Not Graphing
Posted: Thu Jun 20, 2019 1:59 pm
by maglaubig
Up until a few months ago I had an SNMP check setup on a Supermicro server for CPU temperature from the IPMI device. It was using one of the NagiosXI checks that maps to check_snmp.
Code: Select all
/usr/local/nagios/libexec/check_snmp -H HOST -p 161 -o sensorReading.1 -C *** -P 2c -m ATEN-IPMI-MIB
SNMP OK - "33.000" |
The ATEN-IPMI-MIB is from Supermicro, the actual OID for the CPU 1 temperature sensor is ".1.3.6.1.4.1.21317.1.3.1.2.1". I already know what the problem is, There isn't any data after the pipe to graph. I attempted to recreate the check and the wizard wouldn't let me complete it without a warning/critical setting in the check. When I add those to the command it outputs as expected:
Code: Select all
SNMP OK - CPU Temp 33 C | 'CPU Temp'=33C;40;;
Must I have a warning and critical threshold set for any SNMP values for this to work? I have other checks that don't have thresholds set, but they're also being calculated as a --rate for packet info on a switch port using IF-MIB.
I'd like to understand if I just implemented something based on a bug that's been fixed or if I found one. In other words, what's the way I should do this check?
Re: SNMP CPU Temperature Check Not Graphing
Posted: Thu Jun 20, 2019 4:24 pm
by tgriep
When running the SNMP Wizard, if you leave the Match Type to none, that the requirements for adding a warning or critical thresholds is not needed.
Re: SNMP CPU Temperature Check Not Graphing
Posted: Fri Jun 21, 2019 8:28 am
by maglaubig
That solves the mystery about why the wizard required the warning/critical thresholds.
I also realize I did a terrible job asking the question I really wanted to know, only stating that I know why it's not working. Graphing stopped working on this SNMP check. From what I can tell it's because check_snmp isn't returning any information after the pipe unless I specify a warning or critical threshold for the check.
I performed the check with the --verbose option. Here's the output:
Code: Select all
/usr/local/nagios/libexec/check_snmp -H HOST -p 161 -o sensorReading.1 -C ... -P 2c -m ATEN-IPMI-MIB --verbose
/usr/bin/snmpget -Le -t 10 -r 5 -m ATEN-IPMI-MIB -v 2c [context] [authpriv] s2d01-r.ofst.local:161 sensorReading.1
ATEN-IPMI-MIB::sensorReading.1 = Wrong Type (should be INTEGER): STRING: "33.000"
SNMP OK - "33.000" |
Any chance this type mismatch is the source of the lack of graphing?
Re: SNMP CPU Temperature Check Not Graphing
Posted: Fri Jun 21, 2019 2:02 pm
by lmiltchev
Perhaps the perfdata is not shown as the plugin outputs a string instead of an integer, and in order to "do the math", thresholds are needed. I would recommend that you use thresholds in your check in order to get the perfdata. You can use something that is not going to set an alert (if you don't want one).
Re: SNMP CPU Temperature Check Not Graphing
Posted: Fri Jun 21, 2019 3:18 pm
by maglaubig
That is what I was suspecting and I think the info is being returned as a string since I don't believe floating point is possible. The only thing I can think of is that something changed in a firmware update of the IPMI device that changed this behavior within the time frame of when the graphing stopped working. Casting the string as a numeric doesn't seem to be worthwhile either.
I'm marking it as a solution, use thresholds and suppress alerts instead. Thanks!!
Re: SNMP CPU Temperature Check Not Graphing
Posted: Fri Jun 21, 2019 3:47 pm
by lmiltchev
Sounds good! I am closing this topic then and making it as resolved. If you have any further questions/issues, please start a new thread. Thanks!