diff --git a/components/livestatus/hostgroupstable.cpp b/components/livestatus/hostgroupstable.cpp index df7e2cbc6..9a7502830 100644 --- a/components/livestatus/hostgroupstable.cpp +++ b/components/livestatus/hostgroupstable.cpp @@ -127,8 +127,16 @@ Value HostGroupsTable::MembersAccessor(const Value& row) Value HostGroupsTable::MembersWithStateAccessor(const Value& row) { - /* TODO */ - return Empty; + Array::Ptr members = boost::make_shared(); + + BOOST_FOREACH(const Host::Ptr& host, static_cast(row)->GetMembers()) { + Array::Ptr member_state = boost::make_shared(); + member_state->Add(host->GetName()); + member_state->Add(host->GetState()); + members->Add(member_state); + } + + return members; } Value HostGroupsTable::WorstHostStateAccessor(const Value& row) diff --git a/components/livestatus/servicegroupstable.cpp b/components/livestatus/servicegroupstable.cpp index 76346aa77..9aacdc89f 100644 --- a/components/livestatus/servicegroupstable.cpp +++ b/components/livestatus/servicegroupstable.cpp @@ -121,8 +121,18 @@ Value ServiceGroupsTable::MembersAccessor(const Value& row) Value ServiceGroupsTable::MembersWithStateAccessor(const Value& row) { - /* TODO */ - return Empty; + Array::Ptr members = boost::make_shared(); + + BOOST_FOREACH(const Service::Ptr& service, static_cast(row)->GetMembers()) { + Array::Ptr host_svc = boost::make_shared(); + host_svc->Add(service->GetHost()->GetName()); + host_svc->Add(service->GetShortName()); + host_svc->Add(service->GetHost()->GetState()); + host_svc->Add(service->GetState()); + members->Add(host_svc); + } + + return members; } Value ServiceGroupsTable::WorstServiceStateAccessor(const Value& row)