mirror of https://github.com/Icinga/icinga2.git
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() + "'");
|
||||
|
||||
m_PendingServices.insert(service.GetName());
|
||||
m_PendingServices.insert(service.GetConfigObject());
|
||||
|
||||
CheckTask::Ptr task = CheckTask::CreateTask(service);
|
||||
task->Enqueue();
|
||||
|
@ -111,7 +111,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
|||
|
||||
/* if the service isn't in the set of pending services
|
||||
* 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;
|
||||
|
||||
CheckResult result = task->GetResult();
|
||||
|
@ -132,7 +132,7 @@ void CheckerComponent::ResultTimerHandler(void)
|
|||
failed++;
|
||||
|
||||
service.SetNextCheck(now + service.GetCheckInterval());
|
||||
m_PendingServices.erase(service.GetName());
|
||||
m_PendingServices.erase(service.GetConfigObject());
|
||||
m_Services.push(service);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
VirtualEndpoint::Ptr m_CheckerEndpoint;
|
||||
|
||||
ServiceQueue m_Services;
|
||||
set<string> m_PendingServices;
|
||||
set<ConfigObject::Ptr> m_PendingServices;
|
||||
|
||||
Timer::Ptr m_CheckTimer;
|
||||
|
||||
|
|
|
@ -235,6 +235,13 @@ void DelegationComponent::DelegationTimerHandler(void)
|
|||
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 (need_clear) {
|
||||
map<Endpoint::Ptr, int>::iterator hit;
|
||||
|
@ -252,13 +259,6 @@ void DelegationComponent::DelegationTimerHandler(void)
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue