Hello,
I'm trying to add the user name of the person acknowledging a service check. Right now if you acknowledge a check you get a email like this:
From: nagios@abc.com [mailto:nagios@abc.com]
Sent: Thursday, January 03, 2013 12:32 PM
To: Me
Subject: ACKNOWLEDGEMENT:Server-name/Ping Check is CRITICAL
T:Thu Jan 3 12:31:43 EST 2013
I:PING CRITICAL - Packet loss = 100%
I want it changed to add the last line:
From: nagios@abc.com [mailto:nagios@abc.com]
Sent: Thursday, January 03, 2013 12:32 PM
To: Me
Subject: ACKNOWLEDGEMENT:Server-name/Ping Check is CRITICAL
T:Thu Jan 3 12:31:43 EST 2013
I:PING CRITICAL - Packet loss = 100%
ACK by:User-acknowledging-this-check
In my /etc/nagio/commands.cfg i have:
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "T:$LONGDATETIME$\nI:$SERVICEOUTPUT$" | /bin/mail -s "$NOTIFICATIONTYPE$:$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
}
What would I add or am i looking in the wrong place?
Dennis
How do i add the acknowledge username to email notifications
Re: How do i add the acknowledge username to email notificat
Here's a list of the macros available in Nagios: http://nagios.sourceforge.net/docs/3_0/macrolist.html
The ones you are probably looking for are:
$SERVICEACKAUTHOR$
$HOSTACKAUTHOR$
As an example you would update it like:
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "T:$LONGDATETIME$\nI:$SERVICEOUTPUT$\nACK by:$SERVICEACKAUTHOR$" | /bin/mail -s "$NOTIFICATIONTYPE$:$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
}
The ones you are probably looking for are:
$SERVICEACKAUTHOR$
$HOSTACKAUTHOR$
As an example you would update it like:
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "T:$LONGDATETIME$\nI:$SERVICEOUTPUT$\nACK by:$SERVICEACKAUTHOR$" | /bin/mail -s "$NOTIFICATIONTYPE$:$HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTEMAIL$
}
Re: How do i add the acknowledge username to email notificat
jsmurphy,
You are the man! Thanks for the great answer, for showing me where to look( I feel so dumb for missing that) and an example on what to do. That made it really easy to update and test and also show me a little more of what Nagios could do.
If i could rate this you would got 5 out of 5 stars,
if i could like this I would!
You are the man! Thanks for the great answer, for showing me where to look( I feel so dumb for missing that) and an example on what to do. That made it really easy to update and test and also show me a little more of what Nagios could do.
If i could rate this you would got 5 out of 5 stars,
if i could like this I would!