.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "..::lib::Smokeping::matchers::ConsecutiveLoss 3" .TH ..::lib::Smokeping::matchers::ConsecutiveLoss 3 2024-02-04 2.8.2 SmokePing .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Smokeping::matchers::ConsecutiveLoss \- Raise/clear alerts according to your choice of threshold and consecutive values .SH DESCRIPTION .IX Header "DESCRIPTION" Use this matcher to raise and clear alerts according to your choice of threshold and consecutive values. As an example, you can raise an alert on first occurrence of 50% packet loss, but choose to hold the alert active until packet loss stays below 10% for 5 consecutive measurements. .PP Add the matcher to your config file using below syntax: .PP .Vb 3 \& type = matcher \& edgetrigger = yes \& pattern = ConsecutiveLoss(pctlossraise=>##,stepsraise=>##,pctlossclear=>##,stepsclear=>##) .Ve .PP Replace the ## with integers of your choice, see below for reference: .PP pctlossraise \- Loss values at or above this percentage will raise an alert when... stepsraise \- ... number of consecutive values have been collected .PP pctlossclear \- Loss values below this percentage will clear an alert when... stepsclear \- ... number of consecutive values have been collected .PP In my environment, I define four alerts for levels like: .PP .Vb 5 \& +packetloss_significant_instantalert \& type = matcher \& pattern = ConsecutiveLoss(pctlossraise=>10,stepsraise=>1,pctlossclear=>3,stepsclear=>3) \& comment = Instant alert \- Significant packet loss detected (At least 10% over 1 cycle). Alert will clear when loss stays at max 2% for 3 cycles \& priority = 30 \& \& +packetloss_major_instantalert \& type = matcher \& pattern = ConsecutiveLoss(pctlossraise=>25,stepsraise=>1,pctlossclear=>3,stepsclear=>3) \& comment = Instant alert \- Major packet loss detected (At least 25% over 1 cycle). Alert will clear when loss stays at max 2% for 3 cycles \& priority = 20 \& \& +packetloss_significant_consecutivealert \& type = matcher \& pattern = ConsecutiveLoss(pctlossraise=>10,stepsraise=>3,pctlossclear=>3,stepsclear=>5) \& comment = Consecutive occurrence of significant packet loss detected (At least 10% over 3 cycles). Alert will clear when loss stays at max 2% for 5 cycles. \& priority = 10 \& \& +packetloss_major_consecutivealert \& type = matcher \& pattern = ConsecutiveLoss(pctlossraise=>25,stepsraise=>3,pctlossclear=>3,stepsclear=>5) \& comment = Consecutive occurrence of significant packet loss detected (At least 25% over 3 cycles). Alert will clear when loss stays at max 2% for 5 cycles. \& priority = 5 .Ve .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2017 Rickard Borgmaster .SH LICENSE .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .SH AUTHOR .IX Header "AUTHOR" Rickard Borgmaster. 2017. Based on the CheckLoss/Checklatency matchers by Dylan Vanderhoof 2006.