check_KAMP_sensors.pl Problem with sensors > 9


(Henning Krause) #1

Hi Everybody,

I got the script “check_KAMP_sensors.pl” from https://exchange.icinga.com/exchange/check_kamp.
Had to change “Nagios::Plugin” to “Monitoring::Plugin”
but now it works fine as long as i only pass single-digit Sensors (… --sensor 1 -9).
Using 10 and above i get

Use of uninitialized value within %sensortypes_id2string in hash element at 
/usr/lib/nagios/plugins/check_KAMP_sensors.pl line 217.
Use of uninitialized value $type in hash element at /usr/lib/nagios/plugins/check_KAMP_sensors.pl line 217.
Use of uninitialized value within %sensortypes_id2string in hash element at 
/usr/lib/nagios/plugins/check_KAMP_sensors.pl line 217.

#2

I’d try to change line 213 in check_KAMP_sensors.pl to

$key =~ /$OIDdef\.(\d+)\.(\d+)\.0/;

If that doesn’ t work then please show an snmpwalk on these OIDs.


(Henning Krause) #3

It works right away, thank you !
Just learned something about perl-regex :wink: