[icinga-checkins] icinga.org: icinga2/master: compat: add current_notification_number

git at icinga.org git at icinga.org
Thu Jul 18 17:33:13 CEST 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Jul 18 17:23:48 2013 +0200

compat: add current_notification_number

---

 components/compat/compatcomponent.cpp |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp
index 79fedb6..c12180f 100644
--- a/components/compat/compatcomponent.cpp
+++ b/components/compat/compatcomponent.cpp
@@ -480,12 +480,16 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
 
 	double last_notification = 0;
 	double next_notification = 0;
+	int notification_number = 0;
 	BOOST_FOREACH(const Notification::Ptr& notification, service->GetNotifications()) {
 		if (notification->GetLastNotification() > last_notification)
 			last_notification = notification->GetLastNotification();
 
 		if (notification->GetNextNotification() < next_notification)
 			next_notification = notification->GetNextNotification();
+
+		if (notification->GetNotificationNumber() > notification_number)
+			notification_number = notification->GetNotificationNumber();
 	}
 
 	CheckCommand::Ptr checkcommand = service->GetCheckCommand();
@@ -526,7 +530,8 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
 	   << "\t" << "acknowledgement_end_time=" << service->GetAcknowledgementExpiry() << "\n"
 	   << "\t" << "scheduled_downtime_depth=" << (service->IsInDowntime() ? 1 : 0) << "\n"
 	   << "\t" << "last_notification=" << last_notification << "\n"
-	   << "\t" << "next_notification=" << next_notification << "\n";
+	   << "\t" << "next_notification=" << next_notification << "\n"
+	   << "\t" << "current_notification_number=" << notification_number << "\n";
 }
 
 void CompatComponent::DumpServiceStatus(std::ostream& fp, const Service::Ptr& service)





More information about the icinga-checkins mailing list