Manipulation of email notifications

Deborah Martin Deborah.Martin at Kognitio.com
Wed Nov 30 11:03:46 CET 2005


Hi, 
 
Is there a way to manipulate the content of an email by type of email
notification ? For example, if I acknowledge a Critical alert with the text
'Under Investigation', I want to include that text in the 
email notification. However, if I receive a recovery notification I don't
need to have the acknowledgement text included. 
 
I've configured the following in miscommands.cfg 
 
# 'notify-by-email' command definition
define command{
        command_name    notify-by-email
        command_line    /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$
\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$\nAcknowledgements: $SERVICEACKCOMMENT$" |
/usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$ **" $CONTACTEMAIL$
        }
 
But I do not want ` \nAcknowledgements: $SERVICEACKCOMMENT$ ` on Recovery
alerts. The alternative would be to have a default value set of N/A which is
overridden with a value if an acknowledgement
has been set but I don't see an easy way to do this either. 
 
Does anyone have any ideas if it can be done (and how) or that it can't be
done like this ? 
 
thanks,
 
deborah 
 

************************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorised distribution or copying is strictly 
prohibited.

Whilst Kognitio Limited takes steps to prevent the transmission of 
viruses via e-mail, we can not guarantee that any email or 
attachment is free from computer viruses and you are strongly
advised to undertake your own anti-virus precautions.

Kognitio grants no warranties regarding performance,
use or quality of any e-mail or attachment and undertakes no 
liability for loss or damage, howsoever caused.
***********************************************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051130/070ef2e8/attachment.html>


More information about the Users mailing list