mirror of https://github.com/Icinga/icinga2.git
Fix: PROCESS_HOST_CHECK_RESULT misinterprets the given status code.
Fixes #5462
This commit is contained in:
parent
f9e8e204f9
commit
95559cb329
|
@ -235,7 +235,17 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve
|
|||
|
||||
int exitStatus = Convert::ToDouble(arguments[1]);
|
||||
CheckResult::Ptr result = PluginUtility::ParseCheckOutput(arguments[2]);
|
||||
result->SetState(PluginUtility::ExitStatusToState(exitStatus));
|
||||
|
||||
ServiceState state;
|
||||
|
||||
if (exitStatus == 0)
|
||||
state = StateOK;
|
||||
else if (exitStatus == 1)
|
||||
state = StateCritical;
|
||||
else
|
||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid status code: " + arguments[2]));
|
||||
|
||||
result->SetState(state);
|
||||
|
||||
result->SetScheduleStart(time);
|
||||
result->SetScheduleEnd(time);
|
||||
|
|
Loading…
Reference in New Issue