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

Added ospf3 rules #1008

Open
wants to merge 1 commit 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
24 changes: 24 additions & 0 deletions juniper_official/routing/Ospf3NeighborStatsTable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ Ospf3NeighborStatsView:
ospf-neighbor-state: ospf-neighbor-state
instance-name: ../../ospf-instance-name

Ospf3StatsTable:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the output be large? do we require filtering using xslt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ospf3 stats output can be large so xslt would be needed, but for ospf3 io-stats its at the protocol level so not needed.

rpc: get-ospf3-statistics-information
item: ospf-statistics/packet-statistics[ospf-packet-type="Hello"]
key: ospf-packet-type
view: Ospf3StatsView

Ospf3StatsView:
fields:
hello-sent: packets-sent
hello-received: packets-received
hello-sent-5sec: packets-sent-5seconds
hello-received-5sec: packets-received-5seconds

Ospf3IoStatsTable:
rpc: get-ospf3-io-statistics-information
item: ospf-io-statistics
key: Null
view: ospf3ioview

ospf3ioview:
fields:
packets-read: packets-read
ospf-error: ospf-errors/*

xslt: "<xsl:stylesheet version=\"1.0\"
xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"
xmlns:ns=\"some:ns\">
Expand Down
160 changes: 160 additions & 0 deletions juniper_official/routing/check-ospf3-io-statistics.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*
* Detects Osp3fIoStatsTable IO errors and notifies when anomalies are found.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirement?

*/
healthbot {
topic routing.ospf {
rule check-ospf3-io-statistics {
synopsis "OSPF3 IO statistics analyzer";
description "Monitors OSPF's I/O statistics";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OSPF3?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to support ipv6 for ospf :

Below cli cmds, we need to use ospf3 for ipv6
show ospf3 statistics
show ospf3 io-statistics

sensor ospf-io-statistics-netconf {
synopsis "OSPF netconf sensor definition";
iAgent {
file Ospf3NeighborStatsTable.yml;
table Osp3fIoStatsTable;
frequency 180s;
}
}
field ospf-error {
sensor ospf-io-statistics-netconf {
path ospf-error;
data-if-missing {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we require data if missing ?

value 0;
}
}
type integer;
description "Ospf IO error count";
}
field packets-read {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this field used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used, shall remove it.

sensor ospf-io-statistics-netconf {
path packets-read;
}
type integer;
description "Ospf IO packet read count";
}
field error-threshold {
constant {
value "{{error-threshold}}";
}
type integer;
description "Packet error threshold";
}
/*
* Anomaly detection logic.
*/
trigger ospf-io-errors {
alert-type routing.ospf.errors.io.ospf-io-errors;
synopsis "ospf io statistics kpi";
description "Sets health based on ospf io errors";
frequency 1offset;
/*
* Sets color to green when ospf errors is not incrementing.
*/
term no-ospf-error-reported {
when {
matches-with-previous "$ospf-error" {
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "OSPF IO error ($ospf-error)is not increasing";
}
}
}
/*
* Sets color to red and sends out an anomaly notification
* when the ospf error count increases by 1.
*/
term is-ospf-error-increasing {
when {
increasing-at-least-by-value "$ospf-error" {
value "$error-threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "OSPF IO is reporting errors($ospf-error)";
}
}
}
}
variable error-threshold {
value 1;
type int;
description "Packet error threshold: Increase between metrics, before we report anomaly";
}
rule-properties {
version 2;
contributor juniper;
category basic;
supported-healthbot-version 1.0.1;
supported-devices {
juniper {
sensors ospf-io-statistics-netconf;
operating-system junos {
products ACX {
platforms All {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platforms ALL is not valid

releases 15.2R1 {
release-support min-supported-release;
}
}
}
products EX {
platforms All {
releases 15.2R1 {
release-support min-supported-release;
}
}
}
products MX {
platforms All {
releases 11.4R1 {
release-support min-supported-release;
}
}
}
products PTX {
platforms All {
releases 11.4R1 {
release-support min-supported-release;
}
}
}
products VMX {
platforms VMX {
releases 23.2R1 {
release-support min-supported-release;
}
}
}
}
operating-system junosEvolved {
products ACX {
platforms All {
releases 22.3R1 {
release-support min-supported-release;
}
}
}
products PTX {
platforms PTX10008 {
releases 22.2R3 {
release-support min-supported-release;
}
}
}
}
}
}
helper-files other {
list-of-files Ospf3NeighborStatsTable.yml;
}
}
}
}
}
191 changes: 191 additions & 0 deletions juniper_official/routing/check-ospf3-statistics.rule
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/*
* Monitors OSPF3 hello packets and notifies anomalies when hello send and receive count
* is not increasing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQ?

*/
healthbot {
topic routing.ospf {
rule check-ospf3-statistics {
keys ospf-packet-type;
synopsis "ospf hello statistics analyzer";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ospf3?

description "Monitors the transmission and reception of hello packets";
sensor ospf-statistics-netconf {
synopsis "OSPF iAgent sensor definition";
description "Netconfig rpc get-ospf-neighbor-information iAgent sensor to collect telemetry data from network device";
iAgent {
file Ospf3NeighborStatsTable.yml;
table Ospf3StatsTable;
frequency 180s;
}
}
field hello-received {
sensor ospf-statistics-netconf {
path hello-received;
}
type integer;
description "Ospf hello packets received";
}
field hello-sent {
sensor ospf-statistics-netconf {
path hello-sent;
}
type integer;
description "Ospf hello packets sent";
}
field ospf-packet-type {
sensor ospf-statistics-netconf {
path ospf-packet-type;
}
type string;
description "Packet type";
}
field hello-count-threshold {
constant {
value "{{hello-count-threshold}}";
}
type integer;
description "Hello count threshold";
}
trigger ospf-hello-received {
alert-type routing.ospf.hello.received.ospf-hello-received;
synopsis "ospf hello received statistics kpi";
description "Sets health based on ospf hello received statistics";
frequency 1offset;
term is-ospf-hello-receive-increasing {
when {
increasing-at-least-by-value "$hello-received" {
value "$hello-count-threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "OSPF receive module is functioning, hello receive count($hello-received) is increasing";
}
}
}
term is-ospf-hello-receive-not-increasing {
when {
matches-with-previous "$hello-received"{
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "OSPF receive module not functioning, hello receive count($hello-received) is not increasing";
}
}
}
}
trigger ospf-hello-sent {
alert-type routing.ospf.hello.sent.ospf-hello-sent;
synopsis "ospf hello sent statistics kpi";
description "Sets health based on ospf hello sent statistics";
frequency 1offset;
term is-ospf-hello-sent-increasing {
when {
increasing-at-least-by-value "$hello-sent" {
value "$hello-count-threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "OSPF send module is functioning, hello send count($hello-sent) is increasing";
}
}
}
term is-ospf-hello-sent-not-increasing {
when {
matches-with-previous "$hello-sent"{
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "OSPF send module not functioning, hello send count($hello-sent) is not increasing";
}
}
}
}
variable hello-count-threshold {
value 1;
type int;
description "Increase between metrics, before we report anomaly";
}
rule-properties {
version 2;
contributor juniper;
category basic;
supported-healthbot-version 1.0.1;
supported-devices {
juniper {
operating-system junos {
products ACX {
platforms All {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All is not valid

releases 15.2R1 {
release-support min-supported-release;
}
}
}
products EX {
platforms All {
releases 15.2R1 {
release-support min-supported-release;
}
}
}
products MX {
platforms All {
releases 11.4R1 {
release-support min-supported-release;
}
}
}
products PTX {
platforms All {
releases 11.4R1 {
release-support min-supported-release;
}
}
}
products VMX {
platforms VMX {
releases 23.2R1 {
release-support min-supported-release;
}
}
}
}
operating-system junosEvolved {
products ACX {
platforms All {
releases 22.3R1 {
release-support min-supported-release;
}
}
}
products PTX {
platforms PTX10008 {
releases 22.2R3 {
release-support min-supported-release;
}
}
}
}
}
}
helper-files other {
list-of-files Ospf3NeighborStatsTable.yml;
}
}
}
}
}