Page 1 of 1

plugin output null in Xi, works fine from CLI

Posted: Thu Jun 14, 2012 4:20 am
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

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

Posted: Thu Jun 14, 2012 9:02 am
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/";

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

Posted: Thu Jun 14, 2012 9:14 am
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.