Control: tags -1 + patch

I've created a patch which restores "prevmatch" to being a boolean,
fixing the edgetrigger alerts.  I built and tested the package with this
patch.

The only side-effect is the aformentioned syslog message change is
marginally affected:

  smokeping[6642]: Alert full-loss was cleared for dns.ns6-gandi-net loss: 0%%, 
0%%, 0%%, 0%%, 0%%, 0%%, 0%%, 100%%, 100%%, 100%%, 100%%, 0%%(0/5)  rtt: 153ms, 
155ms, 156ms, 155ms, 155ms, 156ms, 155ms, U, U, U, U, 155ms prevmatch: 1 
comment: 100%% packet loss

^ with the patch, the substring "prevmatch: 1", will always be one.

-- 
Gerald Turner <gtur...@unzane.com>        Encrypted mail preferred!
OpenPGP: 4096R / CA89 B27A 30FA 66C5 1B80  3858 EC94 2276 FDB8 716D
Fix edgetrigger alerts as discussed in: 
  https://github.com/oetiker/SmokePing/issues/183
Problem caused by patch which added information to log output:
  https://github.com/oetiker/SmokePing/pull/52
Index: smokeping-2.7.3/lib/Smokeping.pm
===================================================================
--- smokeping-2.7.3.orig/lib/Smokeping.pm
+++ smokeping-2.7.3/lib/Smokeping.pm
@@ -2017,11 +2017,7 @@ ALERT
             } else {
                         do_debuglog("Alert \"$_\": no match for target $name\n");
             }
-            if ($match == 0) {
-                $tree->{'prevmatch'.$s}{$_} = $match;
-            } else {
-                $tree->{'prevmatch'.$s}{$_} += $match;
-            }
+            $tree->{'prevmatch'.$s}{$_} = $match;
         }
     } # end alerts
     return $gotalert;

Attachment: signature.asc
Description: PGP signature

Reply via email to