ACK url inside problem notification message
Marc Powell
marc at ena.com
Wed Aug 26 21:55:13 CEST 2009
On Aug 26, 2009, at 12:23 PM, Eric Pearce wrote:
> I did some searching, but I only found people talking about ack'ing
> via email reply. I'd like to have the problem email or SMS message
> contain a URL that I can click on to ack the problem. The idea is
> that everything is self-contained and you don't have to leave your
> email client or SMS message display to ack the problem. Has
> someone implemented this? I'm currently using Nagios 3.0.6 on
> CentOS 5.3.
It's easy to do this unless you have some unusual requirement. You can
include any URL you want in the notifications; just edit the
notification command. For example, to include a link to the
Acknowledgement screen change your notification command to add "http://your.nagios.host/cgi-bin/cmd.cgi?cmd_typ=34&host=$HOSTNAME$&service=$SERVICEDESC$
". For example --
define command {
command_name service-notify-by-email
command_line /bin/echo -e "Subject: Service
$SERVICEDESC$ $SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$
\nState: $SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService:
$SERVICEDESC$\nInfo: $SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n
\nAcknowledged by: $SERVICEACKAUTHOR$\nAcknowledgement:
$SERVICEACKCOMMENT$\n" | /bin/mail -s '** $NOTIFICATIONTYPE$ alert -
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$
}
becomes
define command {
command_name service-notify-by-email
command_line /bin/echo -e "Subject: Service
$SERVICEDESC$ $SERVICESTATE$ alert for $HOSTNAME$!\n\n***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$
\nState: $SERVICESTATE$\nAddress: $HOSTADDRESS$\n\nService:
$SERVICEDESC$\nInfo: $SERVICEOUTPUT$\n\nDate/Time: $LONGDATETIME$\n
\nAcknowledged by: $SERVICEACKAUTHOR$\nAcknowledgement:
$SERVICEACKCOMMENT$\nAcknowledgment URL:http://your.nagios.host/cgi-bin/cmd.cgi?cmd_typ=34&host=$HOSTNAME$&service=$SERVICEDESC$
\n" | /bin/mail -s '** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/
$SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$ &
}
--
Marc
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list