added variable for threshold for switching from "all congested" --> "connection failed"
[pingcheck] / src / main.cpp
index 5ad6319..5e96a72 100644 (file)
@@ -265,6 +265,14 @@ bool init_pingers(
     if (hosts.empty())
         return false;
 
+    // more variables for pingcheck, maybe should move to config?
+    int n_parallel_pings = 1;
+    int parallel_ping_delay = 100;   // ms
+    int congestion_duration_thresh = 10; // seconds
+    int congestion_percentage_thresh = 75;
+    int congest_caused_by_fail_limit_percentage = 99;
+    int ping_timeout_factor = 5;
+
     BOOST_FOREACH( const HostItem &host, hosts )
     {
         string destination_address = host->get_address();
@@ -279,11 +287,6 @@ bool init_pingers(
         // get delay for this scheduler and update assigned delays
         int current_delay = boost::math::iround(delays[ping_interval_in_sec]);
         delays[ping_interval_in_sec] += delay_shifts[ping_interval_in_sec];
-        int n_parallel_pings = 2;
-        int parallel_ping_delay = 100;   // ms
-        int congestion_duration_thresh = 10; // seconds
-        int congestion_percentage_thresh = 75;
-        int ping_timeout_factor = 3;
 
         PingSchedulerItem scheduler(
                 new PingScheduler(
@@ -295,6 +298,7 @@ bool init_pingers(
                         ping_interval_in_sec,
                         ping_fail_limit,
                         congestion_percentage_thresh,
+                        congest_caused_by_fail_limit_percentage,
                         congestion_duration_thresh,
                         ping_reply_timeout,
                         status_notifier,