[icinga-users] host is up notifications

Simon Oosthoek soosthoek at nieuwland.nl
Fri Feb 8 15:49:03 CET 2013


On 02/08/2013 03:27 PM, Wolfgang wrote:
> It seems that it is NOT sent by Icinga but another process (crontab, eventhandler?) using values from Icinga. Who is the sender of the mails?

They are sent by user icinga, but there is no crontab for icinga (user) 
or any crontab in /etc/cron*/ containing icinga.

I'm kind of glad I'm not the only one flabbergasted by this ;-)

BTW, the mails are coming today at hour:01, but I seem to recall 
yesterday they came at hour:04, so a crontab wouldn't be likely.

Perhaps it's in my contact settings?

        use                             generic-contact         ;
        host_notification_commands      notify-host-by-email-advanced
         service_notification_commands   notify-service-by-email-advanced
         host_notification_period        workhours
         service_notification_period     workhours
         host_notification_options       d,u,r
         service_notification_options    c,r


  command_line    /usr/local/icinga/libexec/notify_email

Ah, right, that's my script :-)

That seems to work, but a little too well perhaps?

It's doing this:
#!/bin/bash

set |grep ICINGA >/tmp/icinga-debug

if [[ -z "$ICINGA_CONTACTEMAIL" ]]; then
         exit 1
fi

mutt -s "$ICINGA_NOTIFICATIONTYPE - $ICINGA_HOSTNAME is 
$ICINGA_HOSTSTATE" "$ICINGA_CONTACTEMAIL" <<EOF

Info: $ICINGA_HOSTOUTPUT

$ICINGA_NOTIFICATIONTYPE - Host $ICINGA_HOSTNAME is $ICINGA_HOSTSTATE

Address: $ICINGA_HOSTADDRESS
Displayname: $ICINGA_HOSTDISPLAYNAME

Notes: $ICINGA_NOTIFICATIONAUTHOR $ICINGA_NOTIFICATIONCOMMENT
$ICINGA_HOSTNOTESURL

Url: http://blacky/icinga/cgi-bin/extinfo.cgi?type=1&host=$ICINGA_HOSTNAME"

EOF

Whenever it's called, it will send out an e-mail, regardless of the 
state, but I guess that using a printf like construction, that will also 
be the case?

/Simon






More information about the icinga-users mailing list