Hi Michael

icinga2 - The Icinga 2 network monitoring daemon (version: r2.3.2-1)

Here are lines in the log file that I can see pertains to the event.

[2015-03-24 10:19:59 +0200] information/ExternalCommandListener: Executing
external command: [1427185199]
SEND_CUSTOM_SVC_NOTIFICATION;hostname.domain;http;0;company_name;asdds
[2015-03-24 10:19:59 +0200] debug/DbEvents: add external command history
[2015-03-24 10:19:59 +0200] notice/ExternalCommandProcessor: Sending custom
notification for service hostname.domain!http
[2015-03-24 10:19:59 +0200] information/Checkable: Checking for configured
notifications for object 'hostname.domain!http'
[2015-03-24 10:19:59 +0200] debug/Checkable: Checkable
'hostname.domain!http' has 2 notification(s).
[2015-03-24 10:19:59 +0200] information/Notification: Attempting to send
notifications for notification object 'hostname.domain!http!mail-support'.
[2015-03-24 10:19:59 +0200] debug/Notification: FType=8, TypeFilter=8
[2015-03-24 10:19:59 +0200] information/Notification: Sending notification
'hostname.domain!http!mail-support' for user 'infra'
[2015-03-24 10:19:59 +0200] debug/DbEvents: add notification history for
'hostname.domain!http'
[2015-03-24 10:19:59 +0200] debug/DbEvents: add contact notification
history for service 'hostname.domain!http' and user 'infra'.
[2015-03-24 10:19:59 +0200] information/Notification: Attempting to send
notifications for notification object 'hostname.domain!http!mail-infra'.
[2015-03-24 10:19:59 +0200] debug/Notification: FType=8, TypeFilter=511
[2015-03-24 10:19:59 +0200] notice/Notification: Not sending notifications
for notification object 'hostname.domain!http!mail-infra': state filter
does not match
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: Query: INSERT INTO
icinga_externalcommands (command_args, command_name, command_type,
endpoint_object_id, entry_time, instance_id) VALUES
('hostname.domain;http;0;company_name;asdds',
'SEND_CUSTOM_SVC_NOTIFICATION', '160', 1, FROM_UNIXTIME(1427185199), 1)
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: Query: UPDATE
icinga_servicestatus SET current_notification_number = '5',
 last_notification = FROM_UNIXTIME(1427185199),  next_notification =
FROM_UNIXTIME(1427186702) WHERE instance_id = 1 AND service_object_id = 572
[2015-03-24 10:19:59 +0200] notice/Process: Running command
'/etc/icinga2/scripts/mail-service-notification.sh': PID 26188
[2015-03-24 10:19:59 +0200] debug/DbEvents: add log entry history for
'hostname.domain!http'
[2015-03-24 10:19:59 +0200] information/Notification: Completed sending
notification 'hostname.domain!http!mail-support' for checkable
'hostname.domain!http'
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: Query: INSERT INTO
icinga_notifications (contacts_notified, end_time, end_time_usec,
endpoint_object_id, escalated, instance_id, long_output,
notification_reason, notification_type, object_id, output, start_time,
start_time_usec, state) VALUES ('1', FROM_UNIXTIME(1427185199), '395965',
1, '0', 1, '', '8', '1', 572, 'Command \"C:\\Program Files
(x86)\\ICINGA2/sbin/check_http\" \"-I\" \"127.0.0.1\" \"-u\" \"/\" failed
to execute: 2, \"The system cannot find the file specified.\"',
FROM_UNIXTIME(1427185199), '395965', '3')
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: saving
contactnotification notification_id=1556
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: Query: INSERT INTO
icinga_contactnotifications (contact_object_id, end_time, end_time_usec,
instance_id, notification_id, start_time, start_time_usec) VALUES (453,
FROM_UNIXTIME(1427185199), '395965', 1, 1556, FROM_UNIXTIME(1427185199),
'395965')
[2015-03-24 10:19:59 +0200] debug/IdoMysqlConnection: Query: INSERT INTO
icinga_logentries (endpoint_object_id, entry_time, entry_time_usec,
instance_id, logentry_data, logentry_time, logentry_type, object_id) VALUES
(1, FROM_UNIXTIME(1427185199), '398607', 1, 'SERVICE NOTIFICATION:
infra;hostname.domain;http;CUSTOM (UNKNOWN);dummy;Command \"C:\\Program
Files (x86)\\ICINGA2/sbin/check_http\" \"-I\" \"127.0.0.1\" \"-u\" \"/\"
failed to execute: 2, \"The system cannot find the file
specified.\";company_name;asdds', FROM_UNIXTIME(1427185199), '524288', 572)

Regards
Henti

On Tue, Mar 24, 2015 at 10:13 AM, Michael Friedrich <
michael.friedr...@netways.de> wrote:

> Am 24.03.2015 um 08:26 schrieb Henti Smith:
>
>> Hi Michael,
>>
>> You are correct as was Jurgen, The configs for when to notify is
>> incorrect and I'll fix those, as those will only affect when
>> notifications are sent,however misconfigured  templates and
>> notifications won't trigger sending to the wrong user, which is the core
>> problem I'm having.
>>
>> In my original mail I pasted the debug message :
>>
>> information/Notification: Sending notification
>> 'hostname!http!mail-support' for user 'infra'
>>
>> Which clearly shows that the notification is being triggered for
>> mail-support, but send for user "infra" which is not correct.
>>
>
> That depends on the version used. Previous versions accidently had that
> message being put, even if the notification filters prevented sending
> the notification later on.
>
> The reason is simple - that message occurs before the notification is
> put into the queue for asynchronous processing. Newer versions changed
> that to "notice" severity and "Attempting to send" while only the real
> notification being sent is then logged.
>
> You'll also recognize improved logging for notice/debug in the upcoming
> 2.3.3 release (snapshot packages already have it).
>
>
>> My understanding of the processes is as follows.
>>
>> I have a service called "http" on host "hostname" that is in Unknown
>> state.
>>
>> notification "mail-support" is applied to Service,
>> importing custom-service-notification which will trigger command
>> "mail-service-notification" when states = [ Warning, Critical, Unknown ]
>> and types = [ Custom ]
>>
>> I then log into tjhe web interface and click on the host and service and
>> then on "Send notification"
>>
>> I enter a custom message and the mail is sent to the infra user, instead
>> of the support user as configured above.
>>
>> The debug message above confirms this.
>>
>
> Hm. So it's a custom notification which is different to what the core
> actually schedules.
>
> The debug log entry is only one line, and does not help much
> understanding the issue. Could you paste everything related to the
> process of generating that notification, including the external command
> being triggered at first?
>
> Further, please post the output of
>
> icinga2 --version
>
> Regards,
> Michael
>
>
>
>
>> H
>>
>> On Mon, Mar 23, 2015 at 11:08 PM, Michael Friedrich
>> <michael.friedr...@netways.de <mailto:michael.friedr...@netways.de>>
>> wrote:
>>
>>     Hmmm. Your host notification templates use the wrong state filters
>>     (Down instead of Warning, Critical).
>>
>>     Enable debug log and check that filters don't match currently.
>>
>>     Kind regards,
>>     Michael
>>
>>     Von meinem iPhone gesendet
>>
>>     Am 23.03.2015 um 20:13 schrieb Henti Smith <he...@geekware.co.za
>>     <mailto:he...@geekware.co.za><mailto:he...@geekware.co.za
>>     <mailto:he...@geekware.co.za>>>:
>>
>>     Hi Michael,
>>
>>     The host config is from the client as per the documentation. There
>>     is no host object appart from the dummy ones created in the
>> repository.
>>
>>     I'll mail them tomorrow as well.
>>
>>     H
>>
>>     On Mon, Mar 23, 2015 at 5:46 PM, Michael Friedrich
>>     <michael.friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de><mailto:michael.
>> friedr...@netways.de
>>
>>     <mailto:michael.friedr...@netways.de>>> wrote:
>>     Am 23.03.2015 um 14:15 schrieb Henti Smith:
>>     Hi there,
>>
>>     All configs below:
>>
>>     The Host object is enough, and that's not listed below.
>>
>>
>>
>>     /* users.conf */
>>
>>     object User "infra" {
>>        import "generic-user"
>>        display_name = "Infra"
>>        groups = [ "infra" ]
>>          email= "infra@hostname"
>>     }
>>
>>     object User "support" {
>>        import "generic-user"
>>        display_name = "Support"
>>        groups = [ "support" ]
>>        email = "support@hostnmae"
>>     }
>>
>>     object UserGroup "support" {
>>        display_name = "Support Group"
>>     }
>>
>>     object UserGroup "infra" {
>>        display_name = "Infra Group"
>>     }
>>
>>     /* notifications.conf */
>>
>>     apply Notification "mail-infra" to Host {
>>        import "infra-host-notification"
>>        user_groups = host.vars.notification.mail.groups
>>        assign where host.vars.notification.mail
>>     }
>>
>>     apply Notification "mail-infra" to Service {
>>        import "infra-service-notification"
>>        user_groups = host.vars.notification.mail.groups
>>        assign where host.vars.notification.mail
>>     }
>>
>>     apply Notification "mail-support" to Host {
>>        import "support-host-notification"
>>        import "custom-host-notification"
>>        user_groups = host.vars.notification.mail.groups
>>        assign where host.vars.notification.mail
>>     }
>>
>>     apply Notification "mail-support" to Service {
>>        import "support-service-notification"
>>        import "custom-service-notification"
>>        user_groups = host.vars.notification.mail.groups
>>        assign where host.vars.notification.mail
>>     }
>>
>>     /* templates.conf */
>>
>>     template Notification "support-host-notification" {
>>        command = "mail-host-notification"
>>        states = [ Warning, Critical ]
>>        types = [ Problem, Custom ]
>>        period = "24x7"
>>     }
>>
>>     template Notification "custom-host-notification" {
>>        command = "mail-host-notification"
>>        states = [ Warning, Critical, Unknown ]
>>        types = [ Custom ]
>>        period = "24x7"
>>     }
>>
>>     template Notification "support-service-notification" {
>>        command = "mail-service-notification"
>>        states = [ Warning, Critical ]
>>        types = [ Problem, Custom ]
>>        period = "24x7"
>>     }
>>
>>     template Notification "custom-service-notification" {
>>        command = "mail-service-notification"
>>        states = [ Warning, Critical, Unknown ]
>>        types = [ Custom ]
>>        period = "24x7"
>>     }
>>
>>     template Notification "infra-host-notification" {
>>        command = "mail-host-notification"
>>        states = [ Up ]
>>        types = [ Problem, Acknowledgement, Recovery, Custom,
>>                  FlappingStart, FlappingEnd,
>>                  DowntimeStart, DowntimeEnd, DowntimeRemoved ]
>>        period = "24x7"
>>     }
>>
>>     template Notification "infra-service-notification" {
>>        command = "mail-service-notification"
>>        states = [ OK ]
>>        types = [ Problem, Acknowledgement, Recovery, Custom,
>>                  FlappingStart, FlappingEnd,
>>                  DowntimeStart, DowntimeEnd, DowntimeRemoved ]
>>        period = "24x7"
>>     }
>>
>>
>>     On Mon, Mar 23, 2015 at 3:02 PM, Michael Friedrich
>>     <michael.friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de><mailto:michael.
>> friedr...@netways.de
>>
>>     <mailto:michael.friedr...@netways.de>>> wrote:
>>     Am 23.03.2015 um 13:33 schrieb Henti Smith:
>>     Good day all.
>>
>>     I'm struggling to get my notification working as expected and
>>     getting a strange behaviour where notification mail is sent using
>>     the wrong user.
>>
>>     The check in question (http) is from a windows client discovered
>>     from the master.
>>     The check is Unknown in the web interface.
>>
>>     First off the relevant configs.
>>
>>     users.conf has two users support and infra each in a group with the
>>     same name.
>>
>>     apply Notification "mail-support" to Host { import
>>     "support-host-notification" import "custom-host-notification"
>>     user_groups = host.vars.notification.mail.groups assign where
>>     host.vars.notification.mail}
>>     apply Notification "mail-support" to Service { import
>>     "support-service-notification" import "custom-service-notification"
>>     user_groups = host.vars.notification.mail.groups assign where
>>     host.vars.notification.mail }
>>     apply Notification "mail-infra" to Host { import
>>     "infra-host-notification" user_groups =
>>     host.vars.notification.mail.groups assign where
>>     host.vars.notification.mail }
>>     apply Notification "mail-infra" to Service { import
>>     "infra-service-notification" user_groups =
>>     host.vars.notification.mail.groups assign where
>>     host.vars.notification.mail }
>>
>>     Please paste them line by line, it's pretty much unreadable currently.
>>
>>
>>     The behaviour I'm seeing is the support user never gets a mail, but
>>     the infra user does and in the debug log I see :
>>
>>     information/Notification: Sending notification
>>     'hostname!http!mail-support' for user 'infra'
>>
>>     At first I thought it's a last match scenario so I swapped the
>>     notifications around. This had no affect. The only other thought I
>>     had is that Notification cannot support multiple imports.
>>
>>     I'm pretty sure I'm getting the logic of using apply wrong here.
>>
>>     Your host object definition would be interesting. This is referenced
>>     as user_groups source in your notification apply rules.
>>
>>
>>     What I'm trying to achieve is as follows:
>>
>>     Two users called support and infra.
>>
>>     mail support when services and hosts states = [ Warning, Critical ]
>>     and types = [ Problem, Custom ]
>>     mail infra when services and hosts states = [ Warning, Critical,
>>     Unknown ] and types = [ Custom ]
>>
>>     Am I missing something ?
>>
>>     H
>>
>>     --
>>     --
>>
>>
>>
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org><mailto:icinga-
>> us...@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org>>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>
>>     --
>>     Michael Friedrich, DI (FH)
>>     Application Developer
>>
>>     NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
>>     Tel: +49 911 92885-0 <tel:%2B49%20911%2092885-0> | Fax: +49 911
>>     92885-77 <tel:%2B49%20911%2092885-77><tel:%2B49%20911%2092885-77>
>>     GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
>>     http://www.netways.de | michael.friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de><mailto:Michael.
>> friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de>>
>>
>>     ** OSDC 2015 - April - osdc.de <http://osdc.de><http://osdc.de> **
>>     ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp
>>     <http://netways.de/puppetcamp><http://netways.de/puppetcamp> **
>>     ** OSBConf 2015 - September - osbconf.org
>>     <http://osbconf.org><http://osbconf.org> **
>>
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org><mailto:icinga-
>> us...@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org>>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>
>>
>>     --
>>     --
>>
>>
>>
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org><mailto:icinga-
>> us...@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org>>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>
>>     --
>>     Michael Friedrich, DI (FH)
>>     Application Developer
>>
>>     NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
>>     Tel: +49 911 92885-0 <tel:%2B49%20911%2092885-0> | Fax: +49 911
>>     92885-77 <tel:%2B49%20911%2092885-77><tel:%2B49%20911%2092885-77>
>>     GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
>>     http://www.netways.de | michael.friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de><mailto:Michael.
>> friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de>>
>>
>>     ** OSDC 2015 - April - osdc.de <http://osdc.de><http://osdc.de> **
>>     ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp
>>     <http://netways.de/puppetcamp><http://netways.de/puppetcamp> **
>>     ** OSBConf 2015 - September - osbconf.org
>>     <http://osbconf.org><http://osbconf.org> **
>>
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org><mailto:icinga-
>> us...@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org>>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org><mailto:icinga-
>> us...@lists.icinga.org
>>     <mailto:icinga-users@lists.icinga.org>>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>     --
>>     Michael Friedrich, DI (FH)
>>     Application Developer
>>
>>     NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
>>     Tel: +49 911 92885-0 <tel:%2B49%20911%2092885-0> | Fax: +49 911
>>     92885-77 <tel:%2B49%20911%2092885-77>
>>     GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
>>     http://www.netways.de | michael.friedr...@netways.de
>>     <mailto:michael.friedr...@netways.de>
>>
>>     ** OSDC 2015 - April - osdc.de <http://osdc.de> **
>>     ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp
>>     <http://netways.de/puppetcamp> **
>>     ** OSBConf 2015 - September - osbconf.org <http://osbconf.org> **
>>     _______________________________________________
>>     icinga-users mailing list
>>     icinga-users@lists.icinga.org <mailto:icinga-users@lists.icinga.org>
>>     https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>>
>>
>> --
>> -- <X-Clacks-Overhead: GNU Terry Pratchett>
>>
>>
>> _______________________________________________
>> icinga-users mailing list
>> icinga-users@lists.icinga.org
>> https://lists.icinga.org/mailman/listinfo/icinga-users
>>
>>
>
> --
> Michael Friedrich, DI (FH)
> Application Developer
>
> NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
> Tel: +49 911 92885-0 | Fax: +49 911 92885-77
> GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
> http://www.netways.de | michael.friedr...@netways.de
>
> ** OSDC 2015 - April - osdc.de **
> ** Puppet Camp Berlin 2015 - April - netways.de/puppetcamp **
> ** OSBConf 2015 - September - osbconf.org **
> _______________________________________________
> icinga-users mailing list
> icinga-users@lists.icinga.org
> https://lists.icinga.org/mailman/listinfo/icinga-users
>



-- 
-- <X-Clacks-Overhead: GNU Terry Pratchett>
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to