--- 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 }}" ...