-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathcheck-isis-statistics.rule
More file actions
517 lines (517 loc) · 22.9 KB
/
check-isis-statistics.rule
File metadata and controls
517 lines (517 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
/*
* Detects ISIS packet drops and notifies when anomalies are found.
* Two input control detection
*
* 1) drops-threshold, is the threshold that causes the rule to report an
* anomaly. By default it's 1. This rule will set a dashboard color to
* red when packet drop count is greater than 'drops-threshold' for 3
* minutes period, otherwise color is set to green.
*
* 2) interface-name, is a regular expression that matches the interfaces
* that you would like to monitor. By default it's '.*', which matches
* all interfaces. Use something like 'ge.*' to match only ISIS
* adjacencies contains gigabit ethernet interfaces.
*
*/
healthbot {
topic routing.isis {
description "Monitors isis statitics i.e. adjacency state& statistics and notify anomalies";
synopsis "ISIS adjacency statistics analyzer";
rule check-isis-statistics {
description "Collects ISIS session statistics(lsp, csnp, esh, iih, ish, psnp and unknown drops) periodically and notify anomaly when breaches threshold";
synopsis "ISIS adjacency statistics analyzer";
/*
* Monitors ISIS adjacency statistics. Notifies via the dashboard
* colors when the lsp, csnp, esh, iih, ish, psnp and unknown drops
* increase by {{drops-threshold}} for every collected metric during
* a 3ms time range (red). Otherwise the color is set to green.
*
* Use interface name as key for rule.
*/
keys interface-name;
/*
* Sensor configuration to get data from network devices
*/
sensor isis-sensor {
synopsis "ISIS open-config sensor definition";
description "Open-config sensor to collect telemetry data from network device";
open-config {
sensor-name /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/;
frequency 60s;
}
}
/*
* Fields defined using sensor path. Map the longer sensor names
* to the shorter field names used in the rules.
*/
field csnp-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/csnp/state/dropped;
zero-suppression;
}
type integer;
description "Number of csnp drops";
}
field esh-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/esh/state/dropped;
zero-suppression;
}
type integer;
description "Number of esh drops";
}
field iih-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/iih/state/dropped;
zero-suppression;
}
type integer;
description "Number of iih drops";
}
field interface-name {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id";
}
type string;
description "Interfaces to be monitored";
}
field ish-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/ish/state/dropped;
zero-suppression;
}
type integer;
description "Number of ish drops";
}
field lsp-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/lsp/state/dropped;
zero-suppression;
}
type integer;
description "Number of lsp drops";
}
field psnp-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/psnp/state/dropped;
zero-suppression;
}
type integer;
description "Number of psnp drops";
}
field threshold {
constant {
value "{{drops-threshold}}";
}
type integer;
description "Packet drops threshold";
}
field unknown-drops {
sensor isis-sensor {
where "/network-instances/network-instance/protocols/protocol/isis/interfaces/interface/@interface-id =~ /{{interface-name}}/";
path /network-instances/network-instance/protocols/protocol/isis/interfaces/interface/packet-counters/unknown/state/dropped;
zero-suppression;
}
type integer;
description "Number of unknown drops";
}
/*
* Anomaly detection logic to detect frame discards
*/
trigger isis-csnp-drops {
alert-type routing.isis.drops.csnp.isis-csnp-drops;
synopsis "ISIS csnp drops kpi";
description "Sets health based on increase in ISIS session's csnp drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the csnp drop ($csnp-drops) count is not increasing
*/
term csnp-drops-normal {
when {
matches-with-previous "$csnp-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS CSNP packet drops $csnp-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the csnp drop ($csnp-drops) count increases
*/
term csnp-drops-increasing {
when {
increasing-at-least-by-value "$csnp-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS CSNP packet drops $csnp-drops are increasing on $interface-name";
}
}
}
}
trigger isis-esh-drops {
alert-type routing.isis.drops.esh.isis-esh-drops;
synopsis "ISIS esh drops kpi";
description "Sets health based on increase in ISIS session's esh drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the esh-drops ($esh-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$esh-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS ESH packet drops $esh-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the esh drop ($esh-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$esh-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS ESH packet drops $esh-drops are increasing on $interface-name";
}
}
}
}
trigger isis-iih-drops {
alert-type routing.isis.drops.iih.isis-iih-drops;
synopsis "ISIS iih drops kpi";
description "Sets health based on increase in ISIS session's iih drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the iih-drops ($iih-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$iih-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS IIH packet drops $iih-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the iih drop ($iih-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$iih-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS IIH packet drops $iih-drops are increasing on $interface-name";
}
}
}
}
trigger isis-ish-drops {
alert-type routing.isis.drops.ish.isis-ish-drops;
synopsis "ISIS ish drops kpi";
description "Sets health based on increase in ISIS session's ish drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the ish-drops ($ish-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$ish-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS ISH packet drops $ish-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the ish drop ($ish-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$ish-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS ISH packet drops $ish-drops are increasing on $interface-name";
}
}
}
}
trigger isis-lsp-drops {
alert-type routing.isis.drops.lsp.isis-lsp-drops;
synopsis "ISIS lsp drops kpi";
description "Sets health based on increase in ISIS session's lsp drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the lsp-drops ($lsp-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$lsp-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS LSP packet drops $lsp-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the lsp drop ($lsp-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$lsp-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS LSP packet drops $lsp-drops are increasing on $interface-name";
}
}
}
}
trigger isis-psnp-drops {
alert-type routing.isis.drops.psnp.isis-psnp-drops;
synopsis "ISIS psnp drops kpi";
description "Sets health based on increase in ISIS session's psnp drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the psnp-drops ($psnp-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$psnp-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS PSNP packet drops $psnp-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* the psnp drop ($psnp-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$psnp-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS PSNP packet drops $psnp-drops are increasing on $interface-name";
}
}
}
}
trigger isis-unknown-drops {
alert-type routing.isis.drops.unknown.isis-unknown-drops;
synopsis "ISIS unknown drops kpi";
description "Sets health based on increase in ISIS session's unknown drop count and notify anomaly";
frequency 1offset;
/*
* Sets color to green when the unknown-drops ($unknown-drops) count is not increasing
*/
term lsp-drops-normal {
when {
matches-with-previous "$unknown-drops"{
time-range 2.5offset;
latest;
}
}
then {
status {
color green;
message "ISIS unknown packet drops $unknown-drops are not increasing on $interface-name";
}
}
}
/*
* Sets color to red and sends out an anomaly notification when
* unknown drop ($unknown-drops) count increases
*/
term lsp-drops-increasing {
when {
increasing-at-least-by-value "$unknown-drops" {
value "$threshold";
time-range 2.5offset;
latest;
}
}
then {
status {
color red;
message "ISIS unknown packet drops $unknown-drops are increasing on $interface-name";
}
}
}
}
variable drops-threshold {
value 1;
type int;
description "Packet drops threshold: Increase between metrics, before we report anomaly";
}
variable interface-name {
value .*;
type string;
description "Interface names to monitor, regular expression, eg 'ge-.*'";
}
rule-properties {
version 2;
contributor juniper;
category advanced;
is-scaling-rule {
description "Fields:interface-name ; Directly impacted by number of interfaces running in each network device";
}
supported-healthbot-version 1.0.1;
supported-devices {
juniper {
operating-system junos {
products MX {
platforms MX240 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms MX480 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms MX960 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms MX2010 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms MX2020 {
releases 17.4R1 {
release-support min-supported-release;
}
}
}
products PTX {
platforms PTX5000 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms PTX1000 {
releases 17.4R1 {
release-support min-supported-release;
}
}
platforms PTX10000 {
releases 17.4R1 {
release-support min-supported-release;
}
}
}
products ACX {
platforms All {
releases 22.1R1 {
release-support min-supported-release;
}
}
}
products EX {
sensors isis-sensor;
platforms EX4300-48MP {
releases 22.4R2.8 {
release-support min-supported-release;
}
}
}
}
operating-system junosEvolved {
products ACX {
platforms All {
releases 22.3R1 {
release-support min-supported-release;
}
}
}
}
}
}
}
}
}
}