mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Add try catch for ExecuteEventHandler
This commit is contained in:
parent
14c02ec654
commit
b30960fda5
@ -295,7 +295,18 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
|||||||
Log(LogCritical, "checker", output);
|
Log(LogCritical, "checker", output);
|
||||||
}
|
}
|
||||||
} else if (command_type == "event_command") {
|
} else if (command_type == "event_command") {
|
||||||
host->ExecuteEventHandler(macros, true);
|
try {
|
||||||
|
host->ExecuteEventHandler(macros, true);
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
if (params->Contains("source")) {
|
||||||
|
String output = "Exception occurred while executing event command '" + command + "' for '" +
|
||||||
|
host->GetName() + "': " + DiagnosticInformation(ex);
|
||||||
|
|
||||||
|
double now = Utility::GetTime();
|
||||||
|
ServiceState state = ServiceUnknown;
|
||||||
|
SendEventExecuteCommand(params, state, output, now, now, listener, origin, sourceEndpoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (command_type == "notification_command") {
|
} else if (command_type == "notification_command") {
|
||||||
/* Get user */
|
/* Get user */
|
||||||
User::Ptr user = new User();
|
User::Ptr user = new User();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user