[Nagiosplug-help] how to make plugin

Dmitriy Kropivnitskiy jeld at bnl.gov
Fri Oct 24 09:30:04 CEST 2003

If it is a perl script here is a recipe:

At the top of the script do:

use libs qw(/usr/nagios/libexec); # or wherever your nagios is installed
use utils;

At the place where your script returns result, do something like

if (test() eq FAILED) { print "The failure message"; exit 
else { print "The OK message"; exit $ERRORS{'OK'}; }

Do not forget that only 1 line of output will be captured by nagios and 
that there is a hard-coded limit of 3 hundred something bytes
for that line. Whatever your plugin does, it should always exit with 
appropriate status, it should never freeze (pay attention to timeouts)
and it should generate some output.

For more info see Nagios Plugins web site.

Ajay Mohanty wrote:

> Hi ,
> I  use a small script in servers ( linux servers) to view status of a 
> particular service .
> I want the same as a plugin .
> If anyone can help.
> Ajay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20031024/442fe62d/attachment.html>

More information about the Help mailing list