mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-29 08:34:20 +02:00
parent
51f30f28dc
commit
74209bde40
@ -35,7 +35,7 @@ using namespace icinga;
|
||||
|
||||
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;
|
||||
@ -63,13 +63,11 @@ CheckResult::Ptr ClusterCheckTask::ScriptFunc(const Service::Ptr&)
|
||||
" 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)
|
||||
|
@ -33,7 +33,7 @@ namespace icinga
|
||||
class ClusterCheckTask
|
||||
{
|
||||
public:
|
||||
static CheckResult::Ptr ScriptFunc(const Service::Ptr& service);
|
||||
static void ScriptFunc(const Service::Ptr& service, const CheckResult::Ptr& cr);
|
||||
|
||||
private:
|
||||
ClusterCheckTask(void);
|
||||
|
@ -489,6 +489,8 @@ void Service::ExecuteCheck(void)
|
||||
|
||||
ASSERT(!OwnsLock());
|
||||
|
||||
UpdateNextCheck();
|
||||
|
||||
bool reachable = IsReachable();
|
||||
|
||||
{
|
||||
@ -505,8 +507,6 @@ void Service::ExecuteCheck(void)
|
||||
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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user