[Nagiosplug-help] Web interface shows UNKNOWN although Perl pluginsreturn exit code 0

Thomas Guyot-Sionnest dermoth at aei.ca
Sat Apr 14 03:47:25 CEST 2007


On 13/04/07 02:24 PM, Christoph Haas wrote:
> Peter,
> 
> On Fri, Apr 13, 2007 at 06:40:25PM +0200, Fetzer, Peter wrote:
>> do you have embedded perl turned on in your nagios installation?
>> If you do so or if you don't know, because you installed from a binary
>> package, try to change your command definition from
>>
>> command_line    /path/to/script.pl ...
>> to
>> command_line    /usr/bin/perl -w /path/to/script.pl ...
> 
> Perfectly - it works! I didn't know a shebang-introduced script is
> handled differently than calling perl explicitly with the script's name.
> But I don't claim to understand all the gears of the embedded Perl
> interpreter yet.

Using the embedded Perl interpretor requires that the scripts follows
very strict programming standards. Generally they should not print any
warning when you use "use strict;" and "use warnings;", but even with
that you may run into troubles.

There's also a few CPAN modules that can cause the embedded Perl
interpretor to fail.

Calling "/usr/bin/perl" bypass the embedded Perl interpretor since the
first argument is a binary; i.e. not a Perl script.

Thomas




More information about the Help mailing list