From 98ecb615536698a1973ccbf66becb2bc83e38332 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 11 Mar 2024 10:37:48 +0100 Subject: [PATCH] PluginCheckTask::ProcessFinishedHandler(): warn about exit codes outside 0..3 in the plugin output as well, in addition to the warning log. --- lib/methods/pluginchecktask.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/methods/pluginchecktask.cpp b/lib/methods/pluginchecktask.cpp index 0cc4e6239b6..e6dfd43087f 100644 --- a/lib/methods/pluginchecktask.cpp +++ b/lib/methods/pluginchecktask.cpp @@ -66,15 +66,19 @@ void PluginCheckTask::ProcessFinishedHandler(const Checkable::Ptr& checkable, co Checkable::CurrentConcurrentChecks.fetch_sub(1); Checkable::DecreasePendingChecks(); + String output = pr.Output; + if (pr.ExitStatus < 0 || pr.ExitStatus > 3) { Process::Arguments parguments = Process::PrepareCommand(commandLine); Log(LogWarning, "PluginCheckTask") << "Check command for object '" << checkable->GetName() << "' (PID: " << pr.PID << ", arguments: " << Process::PrettyPrintArguments(parguments) << ") terminated with exit code " << pr.ExitStatus << ", output: " << pr.Output; + + output += ""; } - String output = pr.Output.Trim(); + output = output.Trim(); std::pair co = PluginUtility::ParseCheckOutput(output); cr->SetCommand(commandLine);