-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event Commands not actually executing #10094
Comments
Hello and thank you for reporting!
Please share those log messages.
The complete service config would be interesting, especially whether there's a command endpoint. Best, |
Here's the service definition as well as the log output:
|
Just another tidbit - I ran strace against my running icinga2 processes following forks, and don't find the string 'test_event' anywhere, making me think that it's never actually being sent. Looking at the source file lib/icinga/checkable-event.cpp, I suspect it may have something to do with the if statement on line 52:
If that conditional is somehow false, no message gets sent to the listener to perform the check. That said, based on my digging of the code, it looks like the "agent_check" extension only get set in lib/icinga/clusterevents-check.cpp:ClusterEvents::ExecuteCheckFromQueue, but I don't know enough about icinga2's internals to understand if that's involved here or not. For reference, I'm running a master/satellite/endpoint setup, but the issue in question is happening on the master itself. Interestingly, I just tried it on both one of my satellites and one of my endpoints, and it works on both of them, so it's only on the master that the event handlers are failing (and, coincidentally, that's where I need them to run the most...) |
It looks like this may be related to #9259, which looks like it's designed to make sure commands don't run on both masters in a HA situation. But it may also be preventing event handlers from running locally on a single host master... |
Describe the bug
I have an event handler set up to restart a service when a particular check fails. It doesn't actually execute, no matter what I've tried. When I enable debuglog, I get log messages that it's executing the EventCommand, but the actual command never executes. I have used inotifywait to watch the directory with the script and nothing touches it, I have used strace to trace the Icinga2 daemon and it never tries to execute the command, it's as though the whole event handler system only exists as window-dressing with nothing underneath it. I even set up a test event handler to just log that it ran and nothing happens.
To Reproduce
Expected behavior
The event handler should run (in the above case, it should create/append to /var/log/icinga2/test_event_handler.log.
Your Environment
Running on RHEL 8 using the Icinga2 packages from the Icinga software repository subscription.
I do run a Master/Satellite/Server setup, but the affected service and event handler are all on the master.
The text was updated successfully, but these errors were encountered: