mirror of https://github.com/Icinga/icinga2.git
Improve handling for missing start_time and finish_time values
fixes #5062
This commit is contained in:
parent
efdbfb764b
commit
39f1b4589a
|
@ -165,8 +165,16 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
|
|||
result->SetOutput(co.first);
|
||||
result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
|
||||
result->SetState(PluginUtility::ExitStatusToState(Convert::ToLong(attrs["return_code"])));
|
||||
result->SetExecutionStart(Convert::ToDouble(attrs["start_time"]));
|
||||
result->SetExecutionEnd(Convert::ToDouble(attrs["finish_time"]));
|
||||
|
||||
if (attrs.find("start_time") != attrs.end())
|
||||
result->SetExecutionStart(Convert::ToDouble(attrs["start_time"]));
|
||||
else
|
||||
result->SetExecutionStart(Utility::GetTime());
|
||||
|
||||
if (attrs.find("finish_time") != attrs.end())
|
||||
result->SetExecutionEnd(Convert::ToDouble(attrs["finish_time"]));
|
||||
else
|
||||
result->SetExecutionEnd(result->GetExecutionStart());
|
||||
|
||||
checkable->ProcessCheckResult(result);
|
||||
|
||||
|
|
Loading…
Reference in New Issue