You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/group_vars/prom/prometheus/switch.yml

92 lines
2.8 KiB
YAML

---
prometheus__rules_switch:
- alert: SwitchPromiscuousChange
expr:
changes(ifPromiscuousMode[5m]) > 0
for: 0m
labels:
severity: warning
annotations:
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchInterfaceUpChange
expr:
changes(ifOperStatus{ifOperStatus="up"}[5m]) > 0
for: 0m
labels:
severity: warning
annotations:
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchInErrors
expr:
100 * irate(ifInErrors[5m]) / (
irate(ifInUcastPkts[5m])
+ irate(ifInNUcastPkts[5m])
) > 0.01
for: 0m
labels:
severity: warning
annotations:
ErrorRate: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchOutErrors
expr:
100 * irate(ifOutErrors[5m]) / (
irate(ifOutUcastPkts[5m])
+ irate(ifOutNUcastPkts[5m])
) > 0.01
for: 0m
labels:
severity: warning
annotations:
ErrorRate: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchInLinkUsage
expr:
100 * rate(ifHCInOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 50
for: 5m
keep_firing_for: 10m
labels:
severity: warning
annotations:
Usage: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchInLinkUsage
expr:
100 * rate(ifHCInOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 80
for: 5m
keep_firing_for: 10m
labels:
severity: critical
annotations:
Usage: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchOutLinkUsage
expr:
100 * rate(ifHCOutOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 50
for: 5m
keep_firing_for: 10m
labels:
severity: warning
annotations:
Usage: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
- alert: SwitchOutLinkUsage
expr:
100 * rate(ifHCOutOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 80
for: 5m
keep_firing_for: 10m
labels:
severity: warning
annotations:
Usage: !unsafe '{{ printf "%.2f" $value }} %'
Interface: !unsafe "{{ $labels.ifName }}
{{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}"
...