Perl Nagios::Plugin module use NAGIOS_PLUGIN environment variable to display plugin name in the plugin output.
For instance check_esx3.pl result:
CHECK_ESX3.PL OK - cpu usage=2.37 %
Unfortunately mod_gearman_p1.pl doesn't set that environment variable and output is like that :
MOD_GEARMAN_P1.PL OK - cpu usage=1.70 %
I've check original Nagios perl compiler "p1.pl" and found this code:
sub hndlr {
\@ARGV = \@_ ;
local \$^W = 1 ;
\$ENV{NAGIOS_PLUGIN} = '$filename' ;
# <<< START of PLUGIN (first line of plugin is line 8 in the text) >>>
$sub
# <<< END of PLUGIN >>>
}
I guess you need to add a line similar to "\$ENV{NAGIOS_PLUGIN} = '$filename' ;" in mod_gearman_p1.pl
Hi,
Perl Nagios::Plugin module use NAGIOS_PLUGIN environment variable to display plugin name in the plugin output.
For instance check_esx3.pl result:
CHECK_ESX3.PL OK - cpu usage=2.37 %
Unfortunately mod_gearman_p1.pl doesn't set that environment variable and output is like that :
MOD_GEARMAN_P1.PL OK - cpu usage=1.70 %
I've check original Nagios perl compiler "p1.pl" and found this code:
I guess you need to add a line similar to "\$ENV{NAGIOS_PLUGIN} = '$filename' ;" in mod_gearman_p1.pl
Regards