perl plug-in problem

Marc Powell marc at ena.com
Wed Dec 8 19:18:27 CET 2004



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Jacob Walcik
> Sent: Wednesday, December 08, 2004 12:08 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] perl plug-in problem
> 
> i'm trying to write a very basic test script in perl that always
> returns a status of "OK".  the script is very basic, and i've based
> the output on the code i see in some of the existing perl-based
> plugins.  however, whenever i configure nagios to execute it, it
> always fails with the status information "(No output!)".
> 
> the script is globally executable, it's in the nagios libexec
> directory, and i've tested it under the nagios user to be sure that
> the output is correct on the command line.  the contents of the script
> are pasted in below, can anyone tell me what i've done wrong?
> 
> ------------------------------------
> #!/usr/bin/perl
> 
> print "dummy plugin\n";
> exit $ERRORS{'OK'};
> ------------------------------------
> 
> that's it.  any suggestions?

$ERRORS{'OK'} is completely meaningless to your script as it is and will
likely result in an arbitrary or undefined exit code. You either need to
define $ERRORS{'OK'} to be the proper exit code or better yet, add the
following to your script --

use lib "/usr/local/nagios/libexec";
use utils qw(%ERRORS &print_revision &support &usage);

http://nagiosplug.sourceforge.net/developer-guidelines.html#PERLPLUGIN

--
Marc



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list