Host/service acknowledgement template?

Aaron M. Segura aaron.segura at cabelas.com
Mon Sep 17 18:50:16 CEST 2007


http://www.nagiosexchange.org/Notifications.35.0.html?&tx_netnagext_pi1[p_view]=627

There is an example in the documentation on how to do exactly what you
want...

#IF NOTIFICATIONTYPE=ACKNOWLEDGEMENT
This problem has been acknowledged by $SERVICEACKAUTHOR$: $SERVICEACKCOMMENT$
#ELSE
#IF NOTIFICATIONNUMBER>=5
#IF NOTIFICATIONTYPE!=RECOVERY
*** PLEASE ACKNOWLEDGE THIS PROBLEM IF YOU ARE WORKING ON IT
#ENDIF
#ENDIF
#ENDIF 

The package comes with a couple of example templates for you to modify if you don't
want to create your own from scratch.

Let me know if you have any questions.

On Mon, 2007-09-17 at 10:37 -0600, Boeckman, Matthew wrote:
> 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

-------------------------------------------------------------------------
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