mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 21:24:41 +02:00
Bugfix: use service identity rather than just their names.
This commit is contained in:
parent
e294cf6686
commit
69d3e71b03
@ -76,7 +76,7 @@ void CheckerComponent::CheckTimerHandler(void)
|
|||||||
|
|
||||||
Application::Log(LogDebug, "checker", "Executing service check for '" + service.GetName() + "'");
|
Application::Log(LogDebug, "checker", "Executing service check for '" + service.GetName() + "'");
|
||||||
|
|
||||||
m_PendingServices.insert(service.GetName());
|
m_PendingServices.insert(service.GetConfigObject());
|
||||||
|
|
||||||
CheckTask::Ptr task = CheckTask::CreateTask(service);
|
CheckTask::Ptr task = CheckTask::CreateTask(service);
|
||||||
task->Enqueue();
|
task->Enqueue();
|
||||||
@ -111,7 +111,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
|||||||
|
|
||||||
/* if the service isn't in the set of pending services
|
/* if the service isn't in the set of pending services
|
||||||
* it was removed and we need to ignore this check result. */
|
* it was removed and we need to ignore this check result. */
|
||||||
if (m_PendingServices.find(service.GetName()) == m_PendingServices.end())
|
if (m_PendingServices.find(service.GetConfigObject()) == m_PendingServices.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CheckResult result = task->GetResult();
|
CheckResult result = task->GetResult();
|
||||||
@ -132,7 +132,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
|||||||
failed++;
|
failed++;
|
||||||
|
|
||||||
service.SetNextCheck(now + service.GetCheckInterval());
|
service.SetNextCheck(now + service.GetCheckInterval());
|
||||||
m_PendingServices.erase(service.GetName());
|
m_PendingServices.erase(service.GetConfigObject());
|
||||||
m_Services.push(service);
|
m_Services.push(service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ private:
|
|||||||
VirtualEndpoint::Ptr m_CheckerEndpoint;
|
VirtualEndpoint::Ptr m_CheckerEndpoint;
|
||||||
|
|
||||||
ServiceQueue m_Services;
|
ServiceQueue m_Services;
|
||||||
set<string> m_PendingServices;
|
set<ConfigObject::Ptr> m_PendingServices;
|
||||||
|
|
||||||
Timer::Ptr m_CheckTimer;
|
Timer::Ptr m_CheckTimer;
|
||||||
|
|
||||||
|
@ -235,6 +235,13 @@ void DelegationComponent::DelegationTimerHandler(void)
|
|||||||
assert(candidates.size() == 0 || !service.GetChecker().empty());
|
assert(candidates.size() == 0 || !service.GetChecker().empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
map<Endpoint::Ptr, int>::iterator hit;
|
||||||
|
for (hit = histogram.begin(); hit != histogram.end(); hit++) {
|
||||||
|
stringstream msgbuf;
|
||||||
|
msgbuf << "histogram: " << hit->first->GetIdentity() << " - " << hit->second;
|
||||||
|
Application::Log(LogInformation, "delegation", msgbuf.str());
|
||||||
|
}
|
||||||
|
|
||||||
if (delegated > 0) {
|
if (delegated > 0) {
|
||||||
if (need_clear) {
|
if (need_clear) {
|
||||||
map<Endpoint::Ptr, int>::iterator hit;
|
map<Endpoint::Ptr, int>::iterator hit;
|
||||||
@ -252,13 +259,6 @@ void DelegationComponent::DelegationTimerHandler(void)
|
|||||||
|
|
||||||
AssignService(endpoint, *sit);
|
AssignService(endpoint, *sit);
|
||||||
}
|
}
|
||||||
|
|
||||||
map<Endpoint::Ptr, int>::iterator hit;
|
|
||||||
for (hit = histogram.begin(); hit != histogram.end(); hit++) {
|
|
||||||
stringstream msgbuf;
|
|
||||||
msgbuf << "histogram: " << hit->first->GetIdentity() << " - " << hit->second;
|
|
||||||
Application::Log(LogInformation, "delegation", msgbuf.str());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stringstream msgbuf;
|
stringstream msgbuf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user