question about notifications

Jim Avery jim at jimavery.me.uk
Mon Aug 9 20:12:11 CEST 2010


On 9 August 2010 18:31, Joel Brooks <jbrooks at oddelement.com> wrote:
> hey all,
>
> is there a way to include the WARNING and CRITICAL thresholds in a
> notification (without including the perfdata)?
>
> There doesn't seem to be a macro for this.
>
> i.e., i'd like my notification to show something like:
>
> <body of email notification>
> $SERVICEDESC$ is in $SERVICESTATE$ condition.
>
> $SERVICEOUTPUT$
> Current: $SERVICEVAL$ (Warning: $SERVICEWARNING$, Critical:
> $SERVICECRITICAL$)
>
> is there a way to do something like that?


If only ...

Seriously though, a warning or critical state in Nagios isn't
necessarily anything to do with a threshold.  For example, you could
have a check_groovy plugin which warns if the colour is silver or
white and is critical if the colour is navy or grey.  There's no
threshold so nothing to store in a macro.

If you want to output both warning and critical values, you will need
to re-write the plugin to show them explicitly.  So, for example if
you have a check_mydisk plugin which outputs "warning: disk is 82%
(>80%)"  you will need to re-code it to say "warning: disk is 82% (>
80% < 90%)" or somesuch instead.  Most people who write plugins prefer
brevity so you'll rarely see a plugin which (except in the performance
data) outputs both.

Push comes to shove you could write a wrapper script around an
existing plugin which scrapes the warning and critical thresholds from
the performance data, but personally I think that would be overkill.

hth,

Jim

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
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