[Nagiosplug-devel] [ nagiosplug-Bugs-2081810 ] check_rpc return code on false libpath

SourceForge.net noreply at sourceforge.net
Mon Sep 1 09:02:20 CEST 2008

Bugs item #2081810, was opened at 2008-08-29 05:45
Message generated for change (Comment added) made by neuntoeter
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: None
>Status: Open
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Volker (neuntoeter)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_rpc return code on false libpath

Initial Comment:

I noticed a problem with check_rpc.

If check_rpc can't find the utils.pm package in the given libpath (e.g. the utils.pm is not in lib "/usr/local/nagios/libexec";) and check_rpc is executed in nagios, the return code in Nagios is 2 -> Critical and the Plugin Output shown in Nagios only shows (null).

The correct behaviour should be:
Status: Unknown (3)
Output: Can't find utils.pm in lib path.

I spent nearly a whole day finding the reason why check_rpc did not work. 
It took so long to find out, because I didn't get any error when executing it manually in the shell (the utils.pm was in the working directory). 

A perl error message an a status Unknown could have saved me a lot of time.

PS: I used version from 1.4.9




>Comment By: Volker (neuntoeter)
Date: 2008-09-01 07:02

Logged In: YES 
Originator: YES

Yes, I executed the plugin by hands. Unfortunately I executed it in the
/usr/local/nagios/plugins directory where also the utils.pm exists. So I
didn't get any error and the plugin works fine. 

The working directory is different when the plugin is executed by nagios
and the utils.pm isn't found then, because the lib path in the script is

Is there a way to change the behaviour of the script to send the plugins
STDERR to STDOUT, so that at least some error messages shows up in Nagios?


Comment By: Thomas Guyot (dermoth)
Date: 2008-08-29 16:25

Logged In: YES 
Originator: NO

Did you try running the plugin by hands? It should print a clear error
about missing utils.pm. This is Perl's error code and message, not the

IMO it make absolutely no sense to add an eval in there to catch this
error, especially since it shouldn't happen under normal circumstances and
the error message is clear from the command line. It's also the job of
utils.pm to define Nagios error codes, so handling that would also require
duplicate "fallback" definitions.


You can respond by visiting: 

More information about the Devel mailing list