prometheus: monitor link usage for switches

This commit is contained in:
jeltz 2023-11-03 20:50:34 +01:00
parent 3e16224213
commit a61c997366
Signed by: jeltz
GPG key ID: 800882B66C0C3326

View file

@ -44,4 +44,48 @@ prometheus__rules_switch:
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 }}"
...