plugin output null in xi, works fine from CLI

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
Brian_M
Posts: 43
Joined: Wed Apr 04, 2012 8:08 am

plugin output null in xi, works fine from CLI

Post by Brian_M »

Hello All,

I'm currently trying to use the "check_catalyst_cpu" plugin found in the exchange. When I run the check command from terminal I get the output as expected - running the check within xi I get "null".

I've created the check with the following command:

$USER1$/check_catalyst_load.pl -s $ARG1$ -C $ARG2$ -w $ARG3$ -c $ARG4$

CLI: ./check_catalyst_load.pl -s 10.43.128.101 -C cz-pwc-read -w 0,0,0 -c 0,0,0 returns the CPU load for all processors.
Critical "null" is all i can manage from within Nagiosxi.

I've found several similar threads and have tried suggestions there to no avail:

disabled embedded perl
made sure nagios user can execute script

Any ideas?

Thanks,
Brian
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: plugin output null in xi, works fine from CLI

Post by scottwilkerson »

This runs fine from the terminal, but only if you are in the plugin directory, when Nagios executes the command it doesn't change into the directory first

You should be able to resolve this by changing the following:

On line 7 of check_catalyst_load.pl change

Code: Select all

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

Code: Select all

use lib "/usr/local/nagios/libexec/";
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Brian_M
Posts: 43
Joined: Wed Apr 04, 2012 8:08 am

Re: plugin output null in xi, works fine from CLI

Post by Brian_M »

Sorry, forgot to mention that I saw that this morning and tried already with the same results.

I just modified it again, restarted to confirm and still no dice :-(

Works from CLI regardless, but no output in xi.

Correction: I just noticed that i had only changed the /libexec/ and not the rest of the path. Now that i've changed it all is working.

Thanks for the heads up! Can't believe I overlooked this...lol.