[icinga-checkins] icinga.org: icinga2/master: compat: add next_notification to status.dat

git at icinga.org git at icinga.org
Tue Jul 16 18:00:34 CEST 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Jul 16 16:51:02 2013 +0200

compat: add next_notification to status.dat

---

 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 b31a0e0..79fedb6 100644
--- a/components/compat/compatcomponent.cpp
+++ b/components/compat/compatcomponent.cpp
@@ -479,9 +479,13 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
 	}
 
 	double last_notification = 0;
+	double next_notification = 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();
 	}
 
 	CheckCommand::Ptr checkcommand = service->GetCheckCommand();
@@ -521,7 +525,8 @@ void CompatComponent::DumpServiceStatusAttrs(std::ostream& fp, const Service::Pt
 	   << "\t" << "acknowledgement_type=" << static_cast<int>(service->GetAcknowledgement()) << "\n"
 	   << "\t" << "acknowledgement_end_time=" << service->GetAcknowledgementExpiry() << "\n"
 	   << "\t" << "scheduled_downtime_depth=" << (service->IsInDowntime() ? 1 : 0) << "\n"
-	   << "\t" << "last_notification=" << last_notification << "\n";
+	   << "\t" << "last_notification=" << last_notification << "\n"
+	   << "\t" << "next_notification=" << next_notification << "\n";
 }
 
 void CompatComponent::DumpServiceStatus(std::ostream& fp, const Service::Ptr& service)





More information about the icinga-checkins mailing list