perform event handler before notification
Posted: Tue Apr 07, 2015 6:17 am
I have problem with eventhandler and notification order. I try to use event handler uptool_handler. When there isn't notification sent (SOFT states event handler is invoked just after check perform - perfect)
but: when there's problem with sending email I haveto wait 30 seconds for timeout. I know, that I can lower the timeout value but it is not the solution. Even if sending mail will lats 4 seconds it is too much to wait for executing event handler.
It would be perfect if I can configure notifications to be sent AFTER executing event handler. Is it possible?
Informational Message[2015-04-07 10:54:02] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;HARD;3;uptool_handler
Informational Message[2015-04-07 10:54:02] Warning: Contact 'nagios' service notification command '/usr/bin/printf "%b" "From: nnn \nSubject: ** PROBLEM alert - onet3/HTTP is CRITICAL **\nTo: root\n\n***** nnn *****\n\nNotification Type: PROBLEM\n\nService: HTTP\nHost: onet3 (onet3)\nAddress: onet.pl\nState: CRITICAL\n [.....] root' timed out after 30 seconds
Service Notification[2015-04-07 10:53:31] SERVICE NOTIFICATION: nagios;onet3;HTTP;CRITICAL;notify-by-email;STATUS_NUMBER: 2
Service Notification[2015-04-07 10:53:29] SERVICE NOTIFICATION: michal;onet3;HTTP;CRITICAL;notify-by-sms;STATUS_NUMBER: 2
Service Critical[2015-04-07 10:53:29] SERVICE ALERT: onet3;HTTP;CRITICAL;HARD;3;STATUS_NUMBER: 2
Informational Message[2015-04-07 10:52:29] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;SOFT;2;uptool_handler
Service Critical[2015-04-07 10:52:29] SERVICE ALERT: onet3;HTTP;CRITICAL;SOFT;2;STATUS_NUMBER: 2
Informational Message[2015-04-07 10:51:29] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;SOFT;1;uptool_handler
Service Critical[2015-04-07 10:51:29] SERVICE ALERT: onet3;HTTP;CRITICAL;SOFT;1;STATUS_NUMBER: 2
but: when there's problem with sending email I haveto wait 30 seconds for timeout. I know, that I can lower the timeout value but it is not the solution. Even if sending mail will lats 4 seconds it is too much to wait for executing event handler.
It would be perfect if I can configure notifications to be sent AFTER executing event handler. Is it possible?
Informational Message[2015-04-07 10:54:02] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;HARD;3;uptool_handler
Informational Message[2015-04-07 10:54:02] Warning: Contact 'nagios' service notification command '/usr/bin/printf "%b" "From: nnn \nSubject: ** PROBLEM alert - onet3/HTTP is CRITICAL **\nTo: root\n\n***** nnn *****\n\nNotification Type: PROBLEM\n\nService: HTTP\nHost: onet3 (onet3)\nAddress: onet.pl\nState: CRITICAL\n [.....] root' timed out after 30 seconds
Service Notification[2015-04-07 10:53:31] SERVICE NOTIFICATION: nagios;onet3;HTTP;CRITICAL;notify-by-email;STATUS_NUMBER: 2
Service Notification[2015-04-07 10:53:29] SERVICE NOTIFICATION: michal;onet3;HTTP;CRITICAL;notify-by-sms;STATUS_NUMBER: 2
Service Critical[2015-04-07 10:53:29] SERVICE ALERT: onet3;HTTP;CRITICAL;HARD;3;STATUS_NUMBER: 2
Informational Message[2015-04-07 10:52:29] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;SOFT;2;uptool_handler
Service Critical[2015-04-07 10:52:29] SERVICE ALERT: onet3;HTTP;CRITICAL;SOFT;2;STATUS_NUMBER: 2
Informational Message[2015-04-07 10:51:29] SERVICE EVENT HANDLER: onet3;HTTP;CRITICAL;SOFT;1;uptool_handler
Service Critical[2015-04-07 10:51:29] SERVICE ALERT: onet3;HTTP;CRITICAL;SOFT;1;STATUS_NUMBER: 2