sni/mod_gearman — Issue #25: mod_gearman_p1.pl should set NAGIOS_PLUGIN env
Author: sprudhomme
Created: 2012-01-24 09:21:36+00:00
State: open

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:

```perl
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

Regards