patricegautier / unifiZabbix

Zabbix templates to monitor pretty much all Unifi devices
181 stars 36 forks source link

Suggestion: Add discovery rule for switch port changes #88

Closed hellojoe88 closed 1 year ago

hellojoe88 commented 1 year ago

I recently discovered in my network that faulty network cables or ports can cause connection speed changes, that may not be wanted. So I added a discovery rule for it to zabbix, I thought you might find it useful and want to add it:

Name of Trigger Prototype{{#PORT_IS_UPLINK}.regsub("true", "Uplink")} {{#PORT_MEDIA}.regsub("SFP", \0)} Port {#PORT_IDX} has changed Connection Speed

Expression: last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#2)>0 and last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)>0 and last(/Unifi Switch/up_[{#PORT_IDX}],#1)="true" and last(/Unifi Switch/stp_state_[{#PORT_IDX}],#1)="forwarding" and (last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1) <> last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#2))

I added it as a "Trigger prototype" to the "Switch Port Discovery" in the Unifi Switch Template

patricegautier commented 1 year ago

I like the idea! Added to the template..
It is marked a non auto resolving, so you have to acknowledge in the ZB ui every time this happens. Otherwise the next time around the trigger auto resolves..

hellojoe88 commented 1 year ago

Thank you for including it so quickly. :)

Yeah true, I didn't mind it autoresolving, since I always look at the history. I feel it makes sense both ways.