mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-30 00:54:30 +02:00
parent
51f30f28dc
commit
74209bde40
@ -35,7 +35,7 @@ using namespace icinga;
|
|||||||
|
|
||||||
REGISTER_SCRIPTFUNCTION(ClusterCheck, &ClusterCheckTask::ScriptFunc);
|
REGISTER_SCRIPTFUNCTION(ClusterCheck, &ClusterCheckTask::ScriptFunc);
|
||||||
|
|
||||||
CheckResult::Ptr ClusterCheckTask::ScriptFunc(const Service::Ptr&)
|
void ClusterCheckTask::ScriptFunc(const Service::Ptr& service, const CheckResult::Ptr& cr)
|
||||||
{
|
{
|
||||||
/* fetch specific cluster status */
|
/* fetch specific cluster status */
|
||||||
std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
|
std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
|
||||||
@ -63,13 +63,11 @@ CheckResult::Ptr ClusterCheckTask::ScriptFunc(const Service::Ptr&)
|
|||||||
" Endpoints (" + not_connected_endpoints + ") not connected.";
|
" Endpoints (" + not_connected_endpoints + ") not connected.";
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckResult::Ptr cr = make_shared<CheckResult>();
|
|
||||||
cr->SetOutput(output);
|
cr->SetOutput(output);
|
||||||
cr->SetPerformanceData(perfdata);
|
cr->SetPerformanceData(perfdata);
|
||||||
cr->SetState(state);
|
cr->SetState(state);
|
||||||
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
|
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
|
||||||
|
service->ProcessCheckResult(cr);
|
||||||
return cr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String ClusterCheckTask::FormatArray(const Array::Ptr& arr)
|
String ClusterCheckTask::FormatArray(const Array::Ptr& arr)
|
||||||
|
@ -33,7 +33,7 @@ namespace icinga
|
|||||||
class ClusterCheckTask
|
class ClusterCheckTask
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static CheckResult::Ptr ScriptFunc(const Service::Ptr& service);
|
static void ScriptFunc(const Service::Ptr& service, const CheckResult::Ptr& cr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ClusterCheckTask(void);
|
ClusterCheckTask(void);
|
||||||
|
@ -489,6 +489,8 @@ void Service::ExecuteCheck(void)
|
|||||||
|
|
||||||
ASSERT(!OwnsLock());
|
ASSERT(!OwnsLock());
|
||||||
|
|
||||||
|
UpdateNextCheck();
|
||||||
|
|
||||||
bool reachable = IsReachable();
|
bool reachable = IsReachable();
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -505,8 +507,6 @@ void Service::ExecuteCheck(void)
|
|||||||
SetLastReachable(reachable);
|
SetLastReachable(reachable);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateNextCheck();
|
|
||||||
|
|
||||||
/* keep track of scheduling info in case the check type doesn't provide its own information */
|
/* keep track of scheduling info in case the check type doesn't provide its own information */
|
||||||
double scheduled_start = GetNextCheck();
|
double scheduled_start = GetNextCheck();
|
||||||
double before_check = Utility::GetTime();
|
double before_check = Utility::GetTime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user