Nagios XI Status Information coming back as 'null'

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

Nagios XI Status Information coming back as 'null'

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

What are the permissions on the plugin?

Code: Select all

ls -la /usr/local/nagios/libexec/check_IBM_performance_v1.5.2
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

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

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
logix88
Posts: 20
Joined: Fri Jun 15, 2012 5:27 am

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

Post 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...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post by sreinhardt »

You're welcome, thanks for letting us know!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked