mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 12:14:44 +02:00
ClusterEvents::ExecuteCheckFromQueue(): take ApiListener::Ptr
This commit is contained in:
parent
9b82505295
commit
0c91e8f09b
@ -551,7 +551,7 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||
return Result::Ok;
|
||||
}
|
||||
|
||||
void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros)
|
||||
void Checkable::ExecuteRemoteCheck(const ApiListener::Ptr& listener, const Dictionary::Ptr& resolvedMacros)
|
||||
{
|
||||
CONTEXT("Executing remote check for object '" << GetName() << "'");
|
||||
|
||||
@ -562,7 +562,7 @@ void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros)
|
||||
cr->SetScheduleStart(scheduled_start);
|
||||
cr->SetExecutionStart(before_check);
|
||||
|
||||
GetCheckCommand()->Execute(this, cr, resolvedMacros, true);
|
||||
GetCheckCommand()->Execute(this, cr, listener, resolvedMacros, true);
|
||||
}
|
||||
|
||||
void Checkable::ExecuteCheck(const CheckResultProducer::Ptr& producer)
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "icinga/notification.hpp"
|
||||
#include "icinga/comment.hpp"
|
||||
#include "icinga/downtime.hpp"
|
||||
#include "remote/apilistener.hpp"
|
||||
#include "remote/crproducer.hpp"
|
||||
#include "remote/endpoint.hpp"
|
||||
#include "remote/messageorigin.hpp"
|
||||
@ -111,7 +112,7 @@ public:
|
||||
|
||||
static void UpdateStatistics(const CheckResult::Ptr& cr, CheckableType type);
|
||||
|
||||
void ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros = nullptr);
|
||||
void ExecuteRemoteCheck(const ApiListener::Ptr& listener, const Dictionary::Ptr& resolvedMacros = nullptr);
|
||||
void ExecuteCheck(const CheckResultProducer::Ptr& producer);
|
||||
|
||||
enum class ProcessingResult
|
||||
|
@ -279,7 +279,7 @@ void ClusterEvents::ExecuteCheckFromQueue(const MessageOrigin::Ptr& origin, cons
|
||||
|
||||
if (command_type == "check_command") {
|
||||
try {
|
||||
host->ExecuteRemoteCheck(macros);
|
||||
host->ExecuteRemoteCheck(ApiListener::GetInstance(), macros);
|
||||
} catch (const std::exception& ex) {
|
||||
String output = "Exception occurred while checking '" + host->GetName() + "': " + DiagnosticInformation(ex);
|
||||
ServiceState state = ServiceUnknown;
|
||||
|
Loading…
x
Reference in New Issue
Block a user