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
define command{
command_name notify-host-by-email
command_line /usr/bin/printf “%b” “Host: $HOSTNAME$ - $HOSTADDRESS$\nState: $HOSTSTATE$” | /bin/mail -s “** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ $Alias$ is $HOSTSTATE$ **” $CONTACTEMAIL$
}
define command{
command_name notify-service-by-email
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.
define host{
use windows-server
host_name Test5
alias Test Alias
address 192.168.5.10
contact_groups networking
}
An email appears like this
** PROBLEM Host Alert: Test5 is DOWN **
Host: Test5 - 192.196.32.12
State: DOWN
What I would like is something similar to this,
** PROBLEM Host Alert: Test5 (TestAlias) is DOWN **
Host: Test5 (Test Alias) - 192.196.32.12
State: DOWN
Please Help. Thanks in advance.