--- 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: irate(ifInErrors[5m]) / ( irate(ifInUcastPkts[5m]) + irate(ifInNUcastPkts[5m]) ) > 0.0001 for: 0m labels: severity: warning annotations: ErrorRate: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" - alert: SwitchOutErrors expr: irate(ifOutErrors[5m]) / ( irate(ifOutUcastPkts[5m]) + irate(ifOutNUcastPkts[5m]) ) > 0.0001 for: 0m labels: severity: warning annotations: ErrorRate: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" - alert: SwitchInLinkUsage expr: rate(ifHCInOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 0.5 for: 5m keep_firing_for: 10m labels: severity: warning annotations: Usage: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" - alert: SwitchInLinkUsage expr: rate(ifHCInOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 0.8 for: 5m keep_firing_for: 10m labels: severity: critical annotations: Usage: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" - alert: SwitchOutLinkUsage expr: rate(ifHCOutOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 0.5 for: 5m keep_firing_for: 10m labels: severity: warning annotations: Usage: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" - alert: SwitchOutLinkUsage expr: rate(ifHCOutOctets[5m]) / (ifHighSpeed * 1000000 / 8) > 0.8 for: 5m keep_firing_for: 10m labels: severity: warning annotations: Usage: !unsafe "{{ $value | humanizePercentage }} %" Interface: !unsafe "{{ $labels.ifName }} {{ if $labels.ifAlias }}- {{ $labels.ifAlias }}{{ end }}" ...