]> granicus.if.org Git - icinga2/commitdiff
Bugfixes, additional output for delegations.
authorGunnar Beutner <gunnar@beutner.name>
Fri, 22 Jun 2012 05:24:50 +0000 (07:24 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 22 Jun 2012 05:24:50 +0000 (07:24 +0200)
components/checker/checkercomponent.cpp
components/delegation/delegationcomponent.cpp

index cb55fa7266947ca072f71bb76c61c99cd9ead94c..f269d7c9771e41156991c226765472640b0825b6 100644 (file)
@@ -142,9 +142,17 @@ void CheckerComponent::ResultTimerHandler(void)
                Application::Log(LogWarning, "checker", latwarn.str());
        }
 
-       stringstream msgbuf;
-       msgbuf << "ResultTimerHandler: " << results << " results (" << failed << " failed); latency: avg=" << avg_latency / (results ? results : 1) << ", min=" << min_latency << ", max: " << max_latency;
-       Application::Log(LogInformation, "checker", msgbuf.str());
+       {
+               stringstream msgbuf;
+               msgbuf << "ResultTimerHandler: " << results << " results (" << failed << " failed); latency: avg=" << avg_latency / (results ? results : 1) << ", min=" << min_latency << ", max: " << max_latency;
+               Application::Log(LogInformation, "checker", msgbuf.str());
+       }
+
+       {
+               stringstream msgbuf;
+               msgbuf << "Pending services: " << m_PendingServices.size() << "; idle services: " << m_Services.size();
+               Application::Log(LogInformation, "checker", msgbuf.str());
+       }
 }
 
 void CheckerComponent::AssignServiceRequestHandler(const Endpoint::Ptr& sender, const RequestMessage& request)
index 19f9c86262cd3c7646873363f5af07c4e662abf8..3a747025f3cca0900963c2d12a4bfbe5022f089c 100644 (file)
@@ -100,6 +100,11 @@ vector<Endpoint::Ptr> DelegationComponent::GetCheckerCandidates(const Service& s
        for (it = GetEndpointManager()->Begin(); it != GetEndpointManager()->End(); it++) {
                Endpoint::Ptr endpoint = it->second;
 
+               /* ignore disconnected endpoints */
+               if (!endpoint->IsConnected())
+                       continue;
+
+               /* ignore endpoints that aren't running the checker component */
                if (!endpoint->HasSubscription("checker::AssignService"))
                        continue;
 
@@ -246,6 +251,13 @@ 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;