Closed kam1sh closed 7 years ago
Enable the debug log and check that the given host changes to a HARD state thus triggering the notification event. Post your findings here.
Yes! With hard state it works! [2017-03-24 16:00:38 +0300] notice/Process: Running command '/etc/icinga2/scripts/notification-to-email.sh' '--host-address' '<...> '--host-alias' '<...>' '--host-displayname' 'TEST' '--host-output' 'PING OK - Packet loss = 0%, RTA = 45.94 ms' '--host-state' 'UP' '--icingaweb-url' '<...>' '--long-datetime' '2017-03-24 16:00:38 +0300' '--mail-from' '<...> '--mail-to' '<...>' '--notification-comment' '' '--notification-type' 'PROBLEM' '--plugin-mode' 'service-mode' '--service-desc' 'DISK' '--service-displayname' 'DISK' '--service-output' 'DISK CRITICAL - free space: / 2975 MB (66% inode=97%); ' '--service-state' 'CRITICAL': PID 24178 [2017-03-24 16:00:38 +0300] debug/DbEvents: add log entry history for '<...>!DISK' But i still don't understand why it doesn't send custom notifications. I dunno, maybe it's a problem of icinga web?
Ok, and if you send in a custom notification command, trace the log lines down and post them here.
icinga web 2:
2017-03-28T13:46:54+03:00 - DEBUG - Sending external Icinga command "[1490698014] SEND_CUSTOM_SVC_NOTIFICATION;
;CPU;2;<...>;another test" to the local command file "/var/run/icinga2/cmd/icinga2.cmd"
icinga 2:
[2017-03-28 13:46:54 +0300] information/Notification: Sending 'Custom' notification '
!CPU!<...> notification for user '<...>' [2017-03-28 13:46:54 +0300] information/Notification: Completed sending 'Custom' notification ' !CPU!<...> notification' for checkable ' !CPU' and user '<...>'.
OK, i think the problem was in some disabled features. Right now i have enabled notifications and commands, and everything is good.
I'm having an issue with setting up notifications in Icinga 2. Notification successfuly applies to services, and users have email fields and they could receive notifications, i have custom notification command, but the problem is not in it, notification command just doesn't even execute. All code and info are below. Also, Icinga Web 2 shows my contact some.user under button "Send notification" in the service description. It just doesn't send anything
The problem is: when i execute custom notification in Icinga Web 2 or the service in warn/crit state, icinga does not execute NotificationCommand (and don't even write this in icinga log (and debug log too)). It write nothing about this notification at all. Also, i'm using Icinga Director, but i wrote it here, because the problem in icinga itself.