Is this critical or not for Nagios?

Andreas Ericsson ae at op5.se
Mon Jun 14 10:05:25 CEST 2004


Gürhan Koçak wrote:
> Hi all,
> 
> I prepared a script to return description of the queried slot with its
> temperature for Redback BRAS devices. Everything seems to be ok, but Nagios
> does not think the service is critical although the return value is as the
> following?
> 
> Slot Temperature  OK 14-06-2004 10:23:18 2d 17h 56m 25s 1/3 SNMP CRITICAL -
> *38* Temperature sensor on slot 2  
> 

That's not the return value. That's the output of the script. The return 
value is the exit status of the script/program.

> How can I make Nagios to see this service is critical? Is the format or
> content of the return value is wrong?
> 

By having it exit with a status other than 0.
In shell-scripts, this is done with
exit 1
for critical.
In C, it's done by
exit(1);
(again, for critical), or, from the 'main()' function,
return(1);
(parentheses are optional to the return call).
Read nagiosplugin development guidelines. It's at http://www.nagios.org 
or http://sourceforge.net/projects/nagiosplug
Browse around a little, and I'm sure you'll find it one place or another.

> Kind regards.
> 

-- 
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
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