140 lines
3.7 KiB
YAML
140 lines
3.7 KiB
YAML
|
---
|
||
|
prometheus__scraping_bird:
|
||
|
targets: "{{ groups.router }}"
|
||
|
address:
|
||
|
port: 9324
|
||
|
|
||
|
prometheus__rules_bird:
|
||
|
- record: bird:protocol_up:bgp
|
||
|
expr:
|
||
|
label_replace(
|
||
|
bird_protocol_up{proto="BGP",}
|
||
|
unless bird_protocol_up{
|
||
|
proto="BGP",
|
||
|
name=~"^(viarezo|isp[12]|rezel)[46]$"
|
||
|
},
|
||
|
"group", "$1",
|
||
|
"instance", "^([^0-9\\.]+)-[0-9]+.*"
|
||
|
)
|
||
|
# Sessions qui ne sont volontairement pas redondées
|
||
|
# au sein d'un groupe
|
||
|
- record: bird:protocol_up:bgp:non_redundant
|
||
|
expr:
|
||
|
bird:protocol_up:bgp{
|
||
|
group="edge",
|
||
|
name=~"^(oti|crans|legacy|edge)[46]$"
|
||
|
}
|
||
|
# Sessions qui le sont
|
||
|
- record: bird:protocol_up:bgp:redundant
|
||
|
expr:
|
||
|
bird:protocol_up:bgp
|
||
|
unless
|
||
|
bird:protocol_up:bgp:non_redundant
|
||
|
- alert: BirdBGPRedundancyDegraded
|
||
|
expr:
|
||
|
(
|
||
|
count by (group, name) (
|
||
|
bird:protocol_up:bgp:redundant{state="Established"}
|
||
|
) or (
|
||
|
count by (group, name) (
|
||
|
bird:protocol_up:bgp:redundant{state!="Established"}
|
||
|
) * 0
|
||
|
)
|
||
|
) < 2
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: warning
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Count: !unsafe "{{ $value }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdBGPDown
|
||
|
expr:
|
||
|
(
|
||
|
count by (group, name) (
|
||
|
bird:protocol_up:bgp{state="Established"}
|
||
|
) or (
|
||
|
count by (group, name) (
|
||
|
bird:protocol_up:bgp{state!="Established"}
|
||
|
) * 0
|
||
|
)
|
||
|
) == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdBGPNoExportedPrefixRedundant
|
||
|
expr:
|
||
|
bird_protocol_prefix_export_count{
|
||
|
export_filter!="REJECT",
|
||
|
} * on (instance, name) group_left (group) (
|
||
|
bird:protocol_up:bgp:redundant{state="Established"}
|
||
|
) == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdBGPNoImportedPrefixRedundant
|
||
|
expr:
|
||
|
bird_protocol_prefix_import_count{
|
||
|
import_filter!="REJECT",
|
||
|
} * on (instance, name) group_left (group) (
|
||
|
bird:protocol_up:bgp:redundant{state="Established"}
|
||
|
) == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdBGPNoExportedPrefixNonRedundant
|
||
|
expr:
|
||
|
sum by (group) (
|
||
|
bird_protocol_prefix_export_count{
|
||
|
export_filter!="REJECT",
|
||
|
} * on (instance, name) group_left (group) (
|
||
|
bird:protocol_up:bgp:non_redundant{state="Established"}
|
||
|
)
|
||
|
) == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdBGPNoImportedPrefixNonRedundant
|
||
|
expr:
|
||
|
sum by (group) (
|
||
|
bird_protocol_prefix_import_count{
|
||
|
import_filter!="REJECT",
|
||
|
} * on (instance, name) group_left (group) (
|
||
|
bird:protocol_up:bgp:non_redundant{state="Established"}
|
||
|
)
|
||
|
) == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Session: !unsafe "{{ $labels.name }}"
|
||
|
Group: !unsafe "{{ $labels.group }}"
|
||
|
- alert: BirdOSPFNeighboursChange
|
||
|
expr:
|
||
|
changes(bird_ospf_neighbor_count[5m]) > 0
|
||
|
or changes(bird_ospfv3_neighbor_count[5m]) > 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: warning
|
||
|
- alert: BirdOSPFDown
|
||
|
expr:
|
||
|
bird_ospf_running == 0
|
||
|
for: 0m
|
||
|
labels:
|
||
|
severity: critical
|
||
|
annotations:
|
||
|
Instance: !unsafe "{{ $labels.name }}"
|
||
|
...
|