mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-21 08:47:42 +02:00
Execute notification command only if there is a source param
This commit is contained in:
parent
c019dc9f90
commit
3d85492b9a
@ -298,7 +298,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
||||
throw;
|
||||
}
|
||||
}
|
||||
} else if (command_type == "notification_command") {
|
||||
} else if (command_type == "notification_command" && params->Contains("source")) {
|
||||
/* Get user */
|
||||
User::Ptr user = new User();
|
||||
Dictionary::Ptr attrs = new Dictionary();
|
||||
@ -324,7 +324,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
||||
notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom,
|
||||
author, "");
|
||||
} catch (const std::exception& ex) {
|
||||
if (params->Contains("source")) {
|
||||
String output = "Exception occurred during notification '" + notification->GetName()
|
||||
+ "' for checkable '" + notification->GetCheckable()->GetName()
|
||||
+ "' and user '" + user->GetName() + "' using command '" + command + "': "
|
||||
@ -334,7 +333,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ClusterEvents::GetCheckRequestQueueSize()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user