Page 1 of 1
Modifying the default e-mail
Posted: Fri Oct 19, 2012 11:18 am
by jronin
I looked through the admin console, and made changes to commands.cfg for the notify host/service by e-mail command, but it doesn't seem to affect the e-mails that are sent out. What do I need to modify to change the default notification e-mail?
Re: Modifying the default e-mail
Posted: Fri Oct 19, 2012 11:42 am
by 455157
Do you mean the actual alert message content?
This can be changed per user by clicking your username on the upper right of the interface ("Logged in as: username"), then clicking the notification message menu on the left.
Re: Modifying the default e-mail
Posted: Fri Oct 19, 2012 11:46 am
by jronin
Yes I do mean the message content. I want to change it globally and not per user though.
Re: Modifying the default e-mail
Posted: Fri Oct 19, 2012 11:53 am
by 455157
I don't think this is part of the standard XI, but in the Enterprise version you can mkae notification templates in the Admin -> Users -> Notification Management menu.
Re: Modifying the default e-mail
Posted: Fri Oct 19, 2012 12:22 pm
by scottwilkerson
455157 is correct, this is a new feature in the 2012 Enterprise version, and you can lock them down as well if you don't want users to be able to change them.
Re: Modifying the default e-mail
Posted: Tue Oct 23, 2012 1:51 pm
by jronin
On a related note is there any way to modify the notify-host-by-email commad to truncate/remove the domain when sending e-mails? I would rather have host1 is UP instead of host1.domain.com is UP.
Re: Modifying the default e-mail
Posted: Tue Oct 23, 2012 7:25 pm
by scottwilkerson
I haven't tested this but you may be able to change the command from this
Code: Select all
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
to something like this
Code: Select all
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: `echo '$HOSTNAME$' |cut -d'.' -f1`\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Re: Modifying the default e-mail
Posted: Wed Oct 24, 2012 2:05 pm
by jronin
That worked for the body of the e-mail, but doesn't work for the subject. I'm still receiving workstation1.domain.test.com is Down. Having the full domain name in there makes it hard to identify key issues on a blackberry. Any suggestions?
Re: Modifying the default e-mail
Posted: Wed Oct 24, 2012 3:23 pm
by scottwilkerson
Ok, to do the subject too
Code: Select all
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: `echo '$HOSTNAME$' |cut -d'.' -f1`\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: `echo '$HOSTNAME$' |cut -d'.' -f1` is $HOSTSTATE$ **" $CONTACTEMAIL$
Re: Modifying the default e-mail
Posted: Thu Oct 25, 2012 12:32 pm
by jronin
Thanks! That works great.