If you would like to see acknowledgement comments
in the Nagios email alerts that get sent so that the other admins do not need
to login to Nagios GUI and view the comment, You need to do some changes in the
commands.cfg file.
What to do?
Modify the command “notify-service-by-email” in
the commands.cfg file.
You just need to add “\nNotes:
$SERVICEACKCOMMENT$” before “/bin/mail” as shown in below command
definition:
# vim /usr/local/nagios/etc/objects/commands.cfg
# 'notify-service-by-email' command definition
define command{
command_name notify-service-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$\n\nNotes: $SERVICEACKCOMMENT$" | /bin/mail
-s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$ **" $CONTACTEMAIL$
}
Save and exit.
Thats it, reload nagios service - /etc/init.d/nagios reload
Now acknowledge any WARNING/CRITICAL alert and
check the mail along with the comment/acknowledgement.