From: Michael Friedrich Date: Sun, 16 Mar 2014 13:59:19 +0000 (+0100) Subject: Fix host, service sort order in StatusDataWriter. X-Git-Tag: v0.0.9~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb85a5c696f3c2090f6e790cadfddf0d96f0586a;p=icinga2 Fix host, service sort order in StatusDataWriter. Fixes #5775 --- diff --git a/components/compat/statusdatawriter.cpp b/components/compat/statusdatawriter.cpp index 631ae066c..da7aa6bc0 100644 --- a/components/compat/statusdatawriter.cpp +++ b/components/compat/statusdatawriter.cpp @@ -553,6 +553,13 @@ void StatusDataWriter::UpdateObjectsCache(void) tempobjectfp << std::fixed; DumpHostObject(tempobjectfp, host); objectfp << tempobjectfp.str(); + + BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { + std::ostringstream tempobjectfp; + tempobjectfp << std::fixed; + DumpServiceObject(tempobjectfp, service); + objectfp << tempobjectfp.str(); + } } BOOST_FOREACH(const HostGroup::Ptr& hg, DynamicType::GetObjects()) { @@ -572,13 +579,6 @@ void StatusDataWriter::UpdateObjectsCache(void) objectfp << tempobjectfp.str(); } - BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjects()) { - std::ostringstream tempobjectfp; - tempobjectfp << std::fixed; - DumpServiceObject(tempobjectfp, service); - objectfp << tempobjectfp.str(); - } - BOOST_FOREACH(const ServiceGroup::Ptr& sg, DynamicType::GetObjects()) { std::ostringstream tempobjectfp; tempobjectfp << std::fixed; @@ -742,13 +742,13 @@ void StatusDataWriter::StatusTimerHandler(void) tempstatusfp << std::fixed; DumpHostStatus(tempstatusfp, host); statusfp << tempstatusfp.str(); - } - BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjects()) { - std::ostringstream tempstatusfp; - tempstatusfp << std::fixed; - DumpServiceStatus(tempstatusfp, service); - statusfp << tempstatusfp.str(); + BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) { + std::ostringstream tempstatusfp; + tempstatusfp << std::fixed; + DumpServiceStatus(tempstatusfp, service); + statusfp << tempstatusfp.str(); + } } statusfp.close();