[icinga-checkins] icinga.org: icinga2/master: livestatus: add childs attribute to hosts table

git at icinga.org git at icinga.org
Fri Jul 19 16:11:57 CEST 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Fri Jul 19 16:11:35 2013 +0200

livestatus: add childs attribute to hosts table

refs #4372

---

 components/livestatus/hoststable.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp
index 8a146e3..50bf2a8 100644
--- a/components/livestatus/hoststable.cpp
+++ b/components/livestatus/hoststable.cpp
@@ -1396,8 +1396,13 @@ Value HostsTable::ParentsAccessor(const Value& row)
 
 Value HostsTable::ChildsAccessor(const Value& row)
 {
-	/* TODO */
-	return Empty;
+	Array::Ptr childs = boost::make_shared<Array>();
+
+	BOOST_FOREACH(const Host::Ptr& child, static_cast<Host::Ptr>(row)->GetChildHosts()) {
+		childs->Add(child->GetName());
+	}
+
+	return childs;
 }
 
 Value HostsTable::NumServicesAccessor(const Value& row)





More information about the icinga-checkins mailing list