[icinga-checkins] icinga.org: icinga2/master: Bugfix: Output dummy check data for hosts that don't have a hostcheck.

git at icinga.org git at icinga.org
Thu Feb 28 10:27:47 CET 2013


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu Feb 28 10:26:01 2013 +0100

Bugfix: Output dummy check data for hosts that don't have a hostcheck.

---

 components/compat/compatcomponent.cpp |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/components/compat/compatcomponent.cpp b/components/compat/compatcomponent.cpp
index 229fe35..8e4841c 100644
--- a/components/compat/compatcomponent.cpp
+++ b/components/compat/compatcomponent.cpp
@@ -323,6 +323,14 @@ void CompatComponent::DumpHostObject(ostream& fp, const Host::Ptr& host)
 		   << "\t" << "notification_options" << "\t" << "d,u,r" << "\n"
 		   << "\t" << "notification_interval" << "\t" << hc->GetNotificationInterval() << "\n"
 		   << "\t" << "notification_period" << "\t" << "24x7" << "\n";
+	} else {
+		fp << "\t" << "check_interval" << "\t" << 60 << "\n"
+		   << "\t" << "retry_interval" << "\t" << 60 << "\n"
+		   << "\t" << "max_check_attempts" << "\t" << 1 << "\n"
+		   << "\t" << "active_checks_enabled" << "\t" << 0 << "\n"
+		   << "\t" << "passive_checks_enabled" << "\t" << 0 << "\n"
+		   << "\t" << "notifications_enabled" << "\t" << 0 << "\n";
+
 	}
 
 	fp << "\t" << "}" << "\n"
@@ -555,7 +563,8 @@ void CompatComponent::StatusTimerHandler(void)
 		 << "\t" << "thursday" << "\t" << "00:00-24:00" << "\n"
 		 << "\t" << "friday" << "\t" << "00:00-24:00" << "\n"
 		 << "\t" << "saturday" << "\t" << "00:00-24:00" << "\n"
-		 << "\t" << "}" << "\n";
+		 << "\t" << "}" << "\n"
+		 << "\n";
 
 
 	BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Host")) {
@@ -590,7 +599,7 @@ void CompatComponent::StatusTimerHandler(void)
 		tempobjectfp << "\t" << "members" << "\t";
 		DumpNameList(tempobjectfp, HostGroup::GetMembers(hg));
 		tempobjectfp << "\n"
-			 << "}" << "\n";
+			     << "\t" << "}" << "\n";
 
 		objectfp << tempobjectfp.str();
 	}





More information about the icinga-checkins mailing list