Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: interface health anomaly fields and term #1009

Open
wants to merge 3 commits into
base: jcloud
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 127 additions & 2 deletions juniper_official/interface/check-interface-fec-crc-framing-errors.rule
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,51 @@ healthbot {
type integer;
description "Checks for output CRC errors";
}
field fec-corrected-anomaly {
formula {
jaiml-anomaly-detection {
field-name "$fec-corrected";
}
}
type integer;
description "JAIML anomaly detection for FEC corrected errors field";
}
field fec-uncorrected-anomaly {
formula {
jaiml-anomaly-detection {
field-name "$fec-uncorrected";
}
}
type integer;
description "JAIML anomaly detection for FEC un-corrected errors field";
}
field framing-errors-anomaly {
formula {
jaiml-anomaly-detection {
field-name "$framing-errors";
}
}
type integer;
description "JAIML anomaly detection for framing errors field";
}
field input-crc-errors-anomaly {
formula {
jaiml-anomaly-detection {
field-name "$input-crc-errors";
}
}
type integer;
description "JAIML anomaly detection for input CRC errors field";
}
field output-crc-errors-anomaly {
formula {
jaiml-anomaly-detection {
field-name "$output-crc-errors";
}
}
type integer;
description "JAIML anomaly detection for output CRC errors field";
}
/*
* Anomaly detection logic.
*/
Expand All @@ -116,6 +161,22 @@ healthbot {
color green;
message "FEC Corrected Errors $fec-corrected on $interface-name has not increased";
}
next;
}
}
/*
* Sets color to yellow when fec-corrected-errors is not in between predicted range.
*/
term is-fec-corrected-errors-anomalous {
when {
equal-to "$fec-corrected-anomaly" 1;
}
then {
status {
color yellow;
message "$interface-name, FEC corrected errors $fec-corrected is not between the predicted range of ($fec-corrected-anomaly-lower-boundary) and ($fec-corrected-anomaly-upper-boundary)";
}
next;
}
}
/*
Expand Down Expand Up @@ -155,6 +216,22 @@ healthbot {
color green;
message "FEC Uncorrected Errors $fec-uncorrected on $interface-name has not increased";
}
next;
}
}
/*
* Sets color to yellow when fec-uncorrected-errors is not in between predicted range.
*/
term is-fec-uncorrected-errors-anomalous {
when {
equal-to "$fec-uncorrected-anomaly" 1;
}
then {
status {
color yellow;
message "$interface-name, FEC uncorrected errors $fec-uncorrected is not between the predicted range of ($fec-uncorrected-anomaly-lower-boundary) and ($fec-uncorrected-anomaly-upper-boundary)";
}
next;
}
}
/*
Expand Down Expand Up @@ -197,6 +274,22 @@ healthbot {
color green;
message "Framing Errors $framing-errors on $interface-name has not increased";
}
next;
}
}
/*
* Sets color to yellow when framing-errors is not in between predicted range.
*/
term is-framing-errors-anomalous {
when {
equal-to "$framing-errors-anomaly" 1;
}
then {
status {
color yellow;
message "$interface-name, framing errors $framing-errors is not between the predicted range of ($framing-errors-anomaly-lower-boundary) and ($framing-errors-anomaly-upper-boundary)";
}
next;
}
}
/*
Expand Down Expand Up @@ -236,8 +329,24 @@ healthbot {
color green;
message "Input CRC Error \"$input-crc-errors\" on $interface-name has not increased";
}
next;
}
}
}
/*
* Sets color to yellow when input-crc-errors is not in between predicted range.
*/
term is-input-crc-errors-anomalous {
when {
equal-to "$input-crc-errors-anomaly" 1;
}
then {
status {
color yellow;
message "$interface-name, input CRC errors $input-crc-errors is not between the predicted range of ($input-crc-errors-anomaly-lower-boundary) and ($input-crc-errors-anomaly-upper-boundary)";
}
next;
}
}
/*
* Sets color to red when the input-crc-errors count is increasing at least by drop threshold value
*/
Expand Down Expand Up @@ -275,8 +384,24 @@ healthbot {
color green;
message "Output CRC Error \"$output-crc-errors\" on $interface-name has not increased";
}
next;
}
}
}
/*
* Sets color to yellow when output-crc-errors is not in between predicted range.
*/
term is-output-crc-errors-anomalous {
when {
equal-to "$output-crc-errors-anomaly" 1;
}
then {
status {
color yellow;
message "$interface-name, output CRC errors $output-crc-errors is not between the predicted range of ($output-crc-errors-anomaly-lower-boundary) and ($output-crc-errors-anomaly-upper-boundary)";
}
next;
}
}
/*
* Sets color to red when the output-crc-errors count is increasing at least by drop threshold value
*/
Expand Down
Loading