diff --git a/lib/icinga/notification.cpp b/lib/icinga/notification.cpp index 9379cf40a..ad33fc319 100644 --- a/lib/icinga/notification.cpp +++ b/lib/icinga/notification.cpp @@ -22,6 +22,7 @@ std::map Notification::m_StateFilterMap; std::map Notification::m_TypeFilterMap; boost::signals2::signal Notification::OnNextNotificationChanged; +boost::signals2::signal Notification::OnNewNotificationResult; String NotificationNameComposer::MakeName(const String& shortName, const Object::Ptr& context) const { @@ -550,6 +551,15 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User:: } } +void Notification::ProcessNotificationResult(const NotificationResult::Ptr& nr, const MessageOrigin::Ptr& origin) +{ + if (!nr) + return; + + /* Notify cluster, API and feature events. */ + OnNewNotificationResult(this, nr, origin); +} + int icinga::ServiceStateToFilter(ServiceState state) { switch (state) { diff --git a/lib/icinga/notification.hpp b/lib/icinga/notification.hpp index 32333a559..e22786799 100644 --- a/lib/icinga/notification.hpp +++ b/lib/icinga/notification.hpp @@ -10,6 +10,7 @@ #include "icinga/usergroup.hpp" #include "icinga/timeperiod.hpp" #include "icinga/checkresult.hpp" +#include "icinga/notificationresult.hpp" #include "remote/endpoint.hpp" #include "remote/messageorigin.hpp" #include "base/array.hpp" @@ -82,10 +83,13 @@ public: Endpoint::Ptr GetCommandEndpoint() const; + void ProcessNotificationResult(const NotificationResult::Ptr& nr, const MessageOrigin::Ptr& origin); + static String NotificationTypeToString(NotificationType type); static String NotificationFilterToString(int filter, const std::map& filterMap); static boost::signals2::signal OnNextNotificationChanged; + static boost::signals2::signal OnNewNotificationResult; void Validate(int types, const ValidationUtils& utils) override;