mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-21 16:57:58 +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;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (command_type == "notification_command") {
|
} else if (command_type == "notification_command" && params->Contains("source")) {
|
||||||
/* Get user */
|
/* Get user */
|
||||||
User::Ptr user = new User();
|
User::Ptr user = new User();
|
||||||
Dictionary::Ptr attrs = new Dictionary();
|
Dictionary::Ptr attrs = new Dictionary();
|
||||||
@ -324,7 +324,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
|||||||
notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom,
|
notificationCommand->Execute(notification, user, cr, NotificationType::NotificationCustom,
|
||||||
author, "");
|
author, "");
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
if (params->Contains("source")) {
|
|
||||||
String output = "Exception occurred during notification '" + notification->GetName()
|
String output = "Exception occurred during notification '" + notification->GetName()
|
||||||
+ "' for checkable '" + notification->GetCheckable()->GetName()
|
+ "' for checkable '" + notification->GetCheckable()->GetName()
|
||||||
+ "' and user '" + user->GetName() + "' using command '" + command + "': "
|
+ "' and user '" + user->GetName() + "' using command '" + command + "': "
|
||||||
@ -334,7 +333,6 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int ClusterEvents::GetCheckRequestQueueSize()
|
int ClusterEvents::GetCheckRequestQueueSize()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user