perl plug-in problem

Steven Hajducko Steven.Hajducko at DigitalInsight.com
Wed Dec 8 19:26:58 CET 2004


Remember that you have to exit with an actual exit code.

You could print out 'CRITICAL' and exit with an exit code of 0 and nagios
will see the plugin as being alright.

Just for reference.
0 = OK
1 = WARNING
2 = CRITICAL 
3 = UNKNOWN

If you're using the %ERRORS hash, you'd have to call in the appropriate
module that defines that hash.  I believe it's the utils.pm for nagios,
where as $ERRORS{'OK'} would simply be returning an exit code of 0.

--
sh

-----Original Message-----
From: Jacob Walcik [mailto:jwalcik at gmail.com] 
Sent: Wednesday, December 08, 2004 10:08 AM
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?


-- 
jacob walcik
jwalcik at gmail.com


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


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