Host/service acknowledgement template?

Boeckman, Matthew mboeckman at servicemagic.com
Mon Sep 17 18:37:18 CEST 2007


Hello list!

Is there a way to configure a custom notification email for
acknowledgements? What I have currently is a lightly modified version of
notify-host-by-email and notify-service-by-email to include the ACK
macro's:

define command{
        command_name    notify-host-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\n
$HOSTACKAUTHOR$ ack'd the alarm with message
$HOSTACKCOMMENT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "**
$NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
$CONTACTEMAIL$
        }

This works, but of course my text "ack'd the alarm with message" appears
in all types of notifications with nothing in the macro fields, and for
ACK's it works just fine. 

I'm wondering if there is something do-able like notify-ack-by-email
that would only function on NOTIFICATIONTYPE=ACKNOWLEDGEMENT and thus
use a specific printf statement about the ack. I see how I could
configure another command definition and include it, but I'm not clear
how to do the IF-THEN type logic. 

Any pointers are appreciated, thanks!

Matthew

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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