[icinga-users] Icinga sends email to $@itpassion.com

Joel Salas Joel.Salas at technicolor.com
Sun Jan 13 22:25:40 CET 2013


Michael,

I have also observed that Icinga logs an error in the event that notifications are enabled and contacts are defined with emails, but notifications are disabled for the contact. The macro does not expand correctly and it shows that contactemail is not defined (even though it is).

Best,
Joel Salas
Support Engineer

----- Original Message -----
From: Michael Friedrich [mailto:michael.friedrich at gmail.com]
Sent: Sunday, January 13, 2013 12:21 PM
To: icinga-users at lists.sourceforge.net <icinga-users at lists.sourceforge.net>
Subject: Re: [icinga-users] Icinga sends email to $@itpassion.com

On 13.01.2013 20:50, Guus Leeuw jr wrote:
> Michael,
>
> Having left debugging on for the day, I can confirm that $CONTACTEMAIL$
> seems to be a problem for some services:
>
> [1358064635.395239] [256.1] [pid=971] Running command '/usr/bin/printf "%b"
> "***** Icinga *****\n\nNotification Type: \n\nService: Check Apponotec
> Windows Updates\nHost: Apponotec FIA-CORE1\nAddress: 82.153.129.66\nState:
> UNKNOWN\n\nDate/Time: Sun Jan 13 08:10:35 GMT 2013\n\nAdditional
> Info:\n\nCHECK_NRPE: Received 0 bytes from daemon.  Check the remote server
> logs for error messages.\n" | /bin/mail -s "**  Service Alert: Apponotec
> FIA-CORE1/Check Apponotec Windows Updates is UNKNOWN **" $CONTACTEMAIL$'...

Matching that with the given config

define command {
         command_name                    notify-service-by-email
         command_line                    /usr/bin/printf "%b" "***** Icinga
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service
Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
         register                        1
}

you can extract all the details to look for your host and service 
affected, and then look up the config for the service definition. Likely 
there's are contacts missing. Question aside - during config 
verification of Icinga core, it should warn about hosts/services with no 
contacts defined - is that the case?

> [...]
>
> So, I'll go through them and make sure that there is a contact email
> available for Icinga in the command / service / generic service definitions.
>
> Would I need to have these services against a person or is a contact group
> good enough for Icinga 1.6.1 to figure out $CONTACTEMAIL$?

A contactgroup consists of contactgroup members (contacts), so Icinga 
will figure out who to notify if you just put a contactgroup instead of 
a single contact to your service definition. This behaviour is part of 
the notification event, also checking if a contact is viable to be 
notified (notification_period, etc).

So you're safe after fixing your configuration in 1.6.x - that being 
said, you probably now figure why that change was made to 1.8 - it will 
remove the macrostring, not sending any mail (and your (mail) log will 
alarm you that the command invocation to /bin/mail is missing a 
recipient too), as well as the core will output a warning to syslog that 
this happened. It may be annoying as f*ck, but better fix the configs in 
the first place, before hunting this 'feature' down ;-)

kind regards,
Michael

>
> Regards,
> Guus
>
>> -----Original Message-----
>> From: Michael Friedrich [mailto:michael.friedrich at gmail.com]
>> Sent: 13 January 2013 11:17
>> To: icinga-users at lists.sourceforge.net
>> Subject: Re: [icinga-users] Icinga sends email to $@itpassion.com
>>
>> On 13.01.2013 08:08, Guus Leeuw jr wrote:
>>> [...]
>>>
>>> I cannot see a problem with the usage of the notification commands,
>>> really, as the email addresses all seem to be valid...
>> Then trace the notification command on the debug log with commands and
>> macros enable in debug_level, concurring with the timestamp of your faulty
>> mail being sent.
>>
>> https://wiki.icinga.org/display/Dev/Icinga+Core+Debug+Config#IcingaCoreD
>> ebugConfig-DebugLevel
>> likely 2305 is what you need, but I'll leave that up to you.
>>
>> It might be an empty $CONTACTEMAIL$ macro somewhere, and then your
>> MTA just adds the missing domain to the user (@itpassion.com) itsself.
>> What's the output of your MTA anyways when sending such a mail? Which
>> type of MTA is used, how does it it treat local aliases?
>>
>>> Fixed in 1.8.1, you say?
>> More of a behavioural change, in what I believe, that a macro was
>> wrongly used within a command. Your description led to this assumption,
>> but still, without debug logs I cannot confirm that one for sure.
>>
>> kind regards,
>> Michael
>>
>>
>>
>>> Maybe it's time to upgrade... I'll put that on the
>>> calendar anyhow, but it would be good to confirm that my case indeed is
>>> covered by the fix.
>>>
>>> Best regards,
>>> Guus
>>>
>>>
>>>
> ----------------------------------------------------------------------------
> --
>>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>>> MVPs and experts. ON SALE this month only -- learn more at:
>>> http://p.sf.net/sfu/learnmore_123012
>>> _______________________________________________
>>> icinga-users mailing list
>>> icinga-users at lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/icinga-users
>>
>> --
>> DI (FH) Michael Friedrich
>>
>> mail:     michael.friedrich at gmail.com
>> twitter:  https://twitter.com/dnsmichi
>> jabber:   dnsmichi at jabber.ccc.de
>> irc:      irc.freenode.net/icinga dnsmichi
>>
>> icinga open source monitoring
>> position: lead core developer
>> url:      https://www.icinga.org
>>
>>
>>
> ----------------------------------------------------------------------------
> --
>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> MVPs and experts. ON SALE this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_123012
>> _______________________________________________
>> icinga-users mailing list
>> icinga-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/icinga-users
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_123012
> _______________________________________________
> icinga-users mailing list
> icinga-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/icinga-users


-- 
DI (FH) Michael Friedrich

mail:     michael.friedrich at gmail.com
twitter:  https://twitter.com/dnsmichi
jabber:   dnsmichi at jabber.ccc.de
irc:      irc.freenode.net/icinga dnsmichi

icinga open source monitoring
position: lead core developer
url:      https://www.icinga.org


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
icinga-users mailing list
icinga-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users




More information about the icinga-users mailing list