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"
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";