notify-{host, service}-by-email command resistant to changes
Marcus
adesperateuser at googlemail.com
Thu Sep 4 10:09:22 CEST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Folks,
I just tried to get the Macro $HOSTNOTESURL$ below my notification-email
for an enhanced usability experience.
However, the changes I made to the command-definition are not taken into
account, when nagios makes my mta send me a mail.
Example:
I just changed "State" to german "Status" just to see if it works, then
restarted nagios and klicked on "Send custom host notification" for one
of the servers.
However, I still see "State" instead of "Status", and I don't see a
URL-representation anywhere.
I grepped for Date/Time, to see if there are maybe overlapping commands
defined, but there aren't.
I use the generic-contact template:
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
and the custom mail-commands, slightly enhanced for URL-sending:
The command-definitions are:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost:
$HOSTNAME$\nStatus: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:
$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nURL: $HOSTNOTESURL$\n" |
/usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is
$HOSTSTATE$ **" $CONTACTEMAIL$
}
# '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$\nStatus:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$\n\n $HOSTNOTESURL$\n $SERVICENOTESURL$" |
/usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert:
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
The mail then looks like this:
***** Nagios *****
Notification Type: RECOVERY
Host: OpenVPN1
State: UP
Address: ovpn1.somedomain.de
Info: WARNING - ovpn1.somedomain.de: rta 0.839ms, lost 0%
Date/Time: Thu Sept 4 09:44:01 CEST 2008
No URL anywhere, ...
Please be so kind to guide me to the solution of this occurence.
Thanks in advance,
Marcus
P.S.:
using Nagios 3.03 with pnp4nagios
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIv5ey+qVaNRZYOakRAhkzAKCatHjlYqQDw+WIcIC2o94xeivH6gCgkhEQ
WP9YupLEtSj4cikwhjIg4K8=
=vWKX
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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