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 */
std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
" Endpoints (" + not_connected_endpoints + ") not connected.";
}
- CheckResult::Ptr cr = make_shared<CheckResult>();
cr->SetOutput(output);
cr->SetPerformanceData(perfdata);
cr->SetState(state);
cr->SetCheckSource(IcingaApplication::GetInstance()->GetNodeName());
-
- return cr;
+ service->ProcessCheckResult(cr);
}
String ClusterCheckTask::FormatArray(const Array::Ptr& arr)
ASSERT(!OwnsLock());
+ UpdateNextCheck();
+
bool reachable = IsReachable();
{
SetLastReachable(reachable);
}
- UpdateNextCheck();
-
/* keep track of scheduling info in case the check type doesn't provide its own information */
double scheduled_start = GetNextCheck();
double before_check = Utility::GetTime();