]> granicus.if.org Git - icinga2/blobdiff - components/compat/statusdatawriter.cpp
Remove the HostUnreachable state.
[icinga2] / components / compat / statusdatawriter.cpp
index 632e35b57f536ea390957f8a4ccf8f055bea07de..2a739e155cf35f2843a69bcd735cb7e70f4c8890 100644 (file)
@@ -354,7 +354,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
        if (service)
                fp << "\t" << "current_state=" << service->GetState() << "\n";
        else
-               fp << "\t" << "current_state=" << host->GetState() << "\n";
+               fp << "\t" << "current_state=" << (host->IsReachable() ? host->GetState() : 2) << "\n";
 
        fp << "\t" "state_type=" << checkable->GetStateType() << "\n"
              "\t" "plugin_output=" << CompatUtility::GetCheckResultOutput(cr) << "\n"
@@ -518,7 +518,7 @@ void StatusDataWriter::DumpCustomAttributes(std::ostream& fp, const DynamicObjec
                if (!kv.first.IsEmpty()) {
                        fp << "\t";
 
-                       if (!CompatUtility::IsLegacyAttribute(kv.first))
+                       if (!CompatUtility::IsLegacyAttribute(object, kv.first))
                                fp << "_";
 
                        fp << kv.first << "\t" << kv.second << "\n";