Modifying the default e-mail
Modifying the default e-mail
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
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.
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
Yes I do mean the message content. I want to change it globally and not per user though.
Re: Modifying the default e-mail
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Modifying the default e-mail
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
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Modifying the default e-mail
I haven't tested this but you may be able to change the command from this
to something like 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$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
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?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Modifying the default e-mail
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
Thanks! That works great.