Fix hostcheck state conversion of the statusdatawriter

fixes #5449
This commit is contained in:
Johannes Meyer 2014-01-15 14:50:58 +01:00
parent d78e5a9676
commit 7e235a53c5
1 changed files with 7 additions and 2 deletions

View File

@ -338,8 +338,13 @@ void StatusDataWriter::DumpServiceStatusAttrs(std::ostream& fp, const Service::P
"\t" "check_latency=" << Convert::ToString(Service::CalculateLatency(cr)) << "\n";
}
fp << "\t" << "current_state=" << CompatUtility::GetServiceCurrentState(service) << "\n"
"\t" "state_type=" << service->GetStateType() << "\n"
if (type == CompatTypeHost && service->IsHostCheck()) {
fp << "\t" << "current_state=" << service->GetHost()->GetState() << "\n";
} else {
fp << "\t" << "current_state=" << CompatUtility::GetServiceCurrentState(service) << "\n";
}
fp << "\t" "state_type=" << service->GetStateType() << "\n"
"\t" "plugin_output=" << CompatUtility::GetCheckResultOutput(cr) << "\n"
"\t" "long_plugin_output=" << CompatUtility::GetCheckResultLongOutput(cr) << "\n"
"\t" "performance_data=" << CompatUtility::GetCheckResultPerfdata(cr) << "\n";