Page 1 of 1

Nagios XI Status Information coming back as 'null'

Posted: Thu Aug 22, 2013 5:22 am
by logix88
Hi,

I have an issue where the command runs fine on CLI but Nagios XI keeps reporting it as 'null'. I can't see any differences in the way the services are defined...

Its based on a custom plugin available on the Exchange.

define host {
host_name IBM SAN
use xiwizard_generic_host
address XX.XX.XX.XX
max_check_attempts 5
check_period 24x7
contacts support
notification_interval 60
notification_period 24x7
notifications_enabled 1
register 1
}

define service {
host_name IBM SAN
service_description IBM STORAGE SUBSYSTEM TOTALS
use generic-service
check_command check_IBM_DS_performance_overall!!!!!!!!
max_check_attempts 5
check_period 24x7
event_handler notify-service-by-email
event_handler_enabled 1
notification_period 24x7
notifications_enabled 1
contacts support
register 1
}


define command {
command_name check_IBM_DS_performance_overall
command_line /usr/local/nagios/libexec/check_IBM_performance_v1.5.2 -i "XX.XX.XX.XX" -j "XX.XX.XX.XX"
}

Running same command in CLI as nagios user:

[nagios@nagios libexec]$ /usr/local/nagios/libexec/check_IBM_performance_v1.5.2 -i "XX.XX.XX.XX" -j "XX.XX.XX.XX"
OK STORAGE SUBSYSTEM TOTALS KBps=53725, IOPS=2807, Reads 12%, Cache Hits 17% | Bps=55014400 IOPS=2807 Read_pct=12% CacheHit_pct=17%

I have Nagios XI coming back as null:

Date / Time Host Service State State Type Attempt Information
2013-08-22 10:19:04 IBM SAN IBM STORAGE SUBSYSTEM TOTALS CRITICAL HARD 5 of 5 (null)
2013-08-22 10:17:04 IBM SAN IBM STORAGE SUBSYSTEM TOTALS CRITICAL SOFT 4 of 5 (null)
2013-08-22 10:15:04 IBM SAN IBM STORAGE SUBSYSTEM TOTALS CRITICAL SOFT 3 of 5 (null)
2013-08-22 10:13:04 IBM SAN IBM STORAGE SUBSYSTEM TOTALS CRITICAL SOFT 2 of 5 (null)
2013-08-22 10:11:04 IBM SAN IBM STORAGE SUBSYSTEM TOTALS CRITICAL SOFT 1 of 5 (null)

I have other services defined similarly that work just fine... A bit confused as to what I am missing here.

Re: Nagios XI Status Information coming back as 'null'

Posted: Thu Aug 22, 2013 10:37 am
by abrist
What are the permissions on the plugin?

Code: Select all

ls -la /usr/local/nagios/libexec/check_IBM_performance_v1.5.2

Re: Nagios XI Status Information coming back as 'null'

Posted: Fri Aug 23, 2013 2:48 am
by logix88
Gave it 777:

# ls -la /usr/local/nagios/libexec/check_IBM_performance_v1.5.2
-rwxrwxrwx 1 nagios nagios 9211 Aug 20 16:00 /usr/local/nagios/libexec/check_IBM_performance_v1.5.2

Re: Nagios XI Status Information coming back as 'null'

Posted: Fri Aug 23, 2013 1:15 pm
by lmiltchev
When you run the check from the command line, do you always run it within the "libexec" directory? Does it work if you run the check from a different directory?

Code: Select all

cd /tmp
/usr/local/nagios/libexec/check_IBM_performance_v1.5.2 -i "XX.XX.XX.XX" -j "XX.XX.XX.XX"
Have you modified the path from:

Code: Select all

use lib "/usr/lib/nagios/plugins";
to

Code: Select all

use lib "/usr/local/nagios/libexec";
Have you tried adding the "perl" to the command line?

Code: Select all

command_line perl /usr/local/nagios/libexec/check_IBM_performance_v1.5.2 -i "XX.XX.XX.XX" -j "XX.XX.XX.XX"
or

Code: Select all

command_line /usr/bin/perl /usr/local/nagios/libexec/check_IBM_performance_v1.5.2 -i "XX.XX.XX.XX" -j "XX.XX.XX.XX"
Note: your path may be different.

Re: Nagios XI Status Information coming back as 'null'

Posted: Fri Aug 23, 2013 2:35 pm
by logix88
Hi,

Issue was due to incorrect lib directory and it does now work fine. I scanned the script over and over but missed that bit, I guess I was concentrating on exit codes but the fact that CLI was returning back results made me convince myself it wasn't the script. Thanks a lot for your help...

Re: Nagios XI Status Information coming back as 'null'

Posted: Fri Aug 23, 2013 2:39 pm
by sreinhardt
You're welcome, thanks for letting us know!