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.
Nagios XI Status Information coming back as 'null'
Re: Nagios XI Status Information coming back as 'null'
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.
"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.
Re: Nagios XI Status Information coming back as 'null'
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
# 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'
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?
Have you modified the path from:
to
Have you tried adding the "perl" to the command line?
or
Note: your path may be different.
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"
Code: Select all
use lib "/usr/lib/nagios/plugins";
Code: Select all
use lib "/usr/local/nagios/libexec";
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"
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"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI Status Information coming back as 'null'
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...
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...
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios XI Status Information coming back as 'null'
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.