conditional statments in alerts

Marc Powell marc at ena.com
Fri Sep 25 17:09:58 CEST 2009


On Sep 25, 2009, at 8:40 AM, Terry L. Inzauro wrote:

> Does nagios support (in one way or another) the support to checking  
> of the existence of a defined macro and then including it
> if it does?
>
> Example (in alert command definition):
>
> if $HOSTACKCOMMENT$
> the
> include $HOSTACKCOMMENT$ in email alert?


Well, there is either a value for the macro (exists) or the there is  
no value and it is null (doesn't exist), so, yes ;) If you include  
just the $MACRO$ in your e-mail then you'll only see the text when  
there is an Ack Comment.

If, however, your real goal is to include *other text* only if the  
macro has a value then no, you'd have to implement that logic in your  
notification script.

--
Marc


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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