[icinga-checkins] icinga.org: icinga2/master: Cluster: Fix notified users for NotificationSentToAllUsers event

git at icinga.org git at icinga.org
Mon Aug 22 10:48:13 CEST 2016


Module: icinga2
Branch: master
Commit: b8d3bcad6a9d4ed759de7622ba1f91b30cbbb7d0
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=b8d3bcad6a9d4ed759de7622ba1f91b30cbbb7d0

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Aug 22 10:47:09 2016 +0200

Cluster: Fix notified users for NotificationSentToAllUsers event

refs #12449
refs #12444

---

 lib/icinga/clusterevents.cpp |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/icinga/clusterevents.cpp b/lib/icinga/clusterevents.cpp
index d14b755..1898cd8 100644
--- a/lib/icinga/clusterevents.cpp
+++ b/lib/icinga/clusterevents.cpp
@@ -957,7 +957,11 @@ void ClusterEvents::NotificationSentToAllUsersHandler(const Notification::Ptr& n
 		params->Set("service", service->GetShortName());
 	params->Set("notification", notification->GetName());
 
-	params->Set("users", Array::FromSet(users));
+	Array::Ptr ausers = new Array();
+	BOOST_FOREACH(const User::Ptr& user, users) {
+		ausers->Add(user->GetName());
+	}
+	params->Set("users", ausers);
 
 	params->Set("type", notificationType);
 	params->Set("cr", Serialize(cr));
@@ -1053,7 +1057,13 @@ Value ClusterEvents::NotificationSentToAllUsersAPIHandler(const MessageOrigin::P
 	notification->SetNotificationNumber(params->Get("notification_number"));
 	notification->SetLastProblemNotification(params->Get("last_problem_notification"));
 	notification->SetNoMoreNotifications(params->Get("no_more_notifications"));
-	notification->SetNotifiedUsers(Array::FromSet(users));
+
+	Array::Ptr notifiedUsers = new Array();
+	BOOST_FOREACH(const User::Ptr& user, users) {
+		notifiedUsers->Add(user->GetName());
+	}
+
+	notification->SetNotifiedUsers(notifiedUsers);
 
 	Checkable::OnNotificationSentToAllUsers(notification, checkable, users, type, cr, author, text, origin);
 



More information about the icinga-checkins mailing list