I found a plugin to check various SNMP stats for IBM Bladecenters. The script works perfectly via command line, but once it gets inside the Nagios config it returns “CRITICAL: (null)”. Any ideas? I’ve tried various different ideas in the commands.cfg file, with no luck. More details below (of course, SNMP community information and IP addresses have been redacted…)
Usage: check_snmp_IBM_Bladecenter.pl -H -C <snmp_community> -t <test_name> -n ] -w ,] -c ,] -o ]
-v, --verbose
print extra debugging information
-h, --help
print this help message
-H, --hostname=HOST
name or IP address of host to check
-C, --community=COMMUNITY NAME
community name for the host’s SNMP agent
-w, --warning=INTEGER
percent of disk used to generate WARNING state (Default: 99)
-c, --critical=INTEGER
percent of disk used to generate CRITICAL state (Default: 100)
-T, --test-help=TEST NAME
print Test Specific help for A Specific Test
-t, --test=TEST NAME
test to run
-n, --ele-number=ELEMEMNT NUM
Number of blade/blower/power module
POSSIBLE TESTS:
System-State
System-Temp-Ambient
System-Temp-MM
System-Ethernet-Backplane
System-Primary-Bus
make a script which calls your plugin with the -v switch (verbose) send the output to a file like /tmp/myoutput, have the script called from crontab and keep all consoles closed while the file is run.
check the output, probably there’s some user configuration missing… using -v might show what it is
I tried running it from my script before I added the cronjob, but I got an error. Just for fun, I tried running the script from another folder, and it got the same error–I’m thinking this is what the issue is.
If I run the program from its containing folder, it works perfectly. Ex:
In ~/Desktop:
$ /usr/local/nagios/libexec/check_snmp_IBM_Bladecenter.pl -H 192.168.12.49 -C nagios -t System-State -v
Can't locate utils.pm in @INC (@INC contains: /opt/nagios/libexec /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/local/nagios/libexec/check_snmp_IBM_Bladecenter.pl line 13.
BEGIN failed--compilation aborted at /usr/local/nagios/libexec/check_snmp_IBM_Bladecenter.pl line 13.
In /usr/local/nagios/libexec:
$ ./check_snmp_IBM_Bladecenter.pl -H 192.168.12.49 -C nagios -t System-State -v
OK System-State (255) Normal