I have searched this forum as well as Google, and haven't been able to find the answer to my question.
I was wondering if you could have one email that is defined in commands.cfg send more information about the host. For instance, currently when we have a host down the email lists the hostname, I would like it to include the alias as well. I have played around with this, but haven't been able to get it to work correctly. The reason why I want to include it in one defined command is to prevent multiple emails about the same host going down.
This is what my commands.cfg looks like
command_line /usr/bin/printf "%b" "Host: $HOSTNAME$ - $HOSTADDRESS$\nState: $HOSTSTATE$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ $Alias$ is $HOSTSTATE$ **" $CONTACTEMAIL$
command_line /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$ - $HOSTADDRESS$\nAdditional Info:\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$-$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Example of one of my host.
alias Test Alias
An email appears like this
** PROBLEM Host Alert: Test5 is DOWN **
Host: Test5 - 126.96.36.199
What I would like is something similar to this,
** PROBLEM Host Alert: Test5 (TestAlias) is DOWN **
Host: Test5 (Test Alias) - 188.8.131.52
Please Help. Thanks in advance.