Skip to content

Commit

Permalink
templatizing port alert thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
patricegautier committed Oct 8, 2021
1 parent df87caa commit 01f0d68
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,22 @@ The load average value above which to issue a info. The consensus is 1 for this
The load average value above which to issue a warning. I have this set to 2. Note that for switches and APs this value has less meaning since they process packets with specialized HW and this macro is overridden in the template to avoid too many warnings

### {$UNIFI_CHANNEL_INTERFERENCE_INFO_THRESHOLD}
### {$UNIFI_CHANNEL_INTERFERENCE_INFO_THRESHOLD}
### {$UNIFI_CHANNEL_INTERFERENCE_AVERAGE_THRESHOLD}
The percentages above which to issue and info/average event for channel interferences. I have this set to 30 and 50 respectively
You can customize this for 2G/5G with {$UNIFI_CHANNEL_INTERFERENCE_INFO_THRESHOLD:"ng"} or {$UNIFI_CHANNEL_INTERFERENCE_INFO_THRESHOLD:"na"} values
You can customize this for 2G/5G with {$UNIFI_CHANNEL_INTERFERENCE_INFO_THRESHOLD:"ng"} or {$UNIFI_CHANNEL_INTERFERENCE_AVERAGE_THRESHOLD:"na"} values


### {$UNIFI_CHANNEL_USAGE_INFO_THRESHOLD}
### {$UNIFI_CHANNEL_USAGE_AVERAGE_THRESHOLD}
The percentages above which to issue and info/average event for Channel usage. I have this set to 30 and 50 respectively
You can customize this for 2G/5G with {$UNIFI_CHANNEL_USAGE_INFO_THRESHOLD:"ng"} or {$UNIFI_USAGE_INTERFERENCE_INFO_THRESHOLD:"na"} values

### {$UNIFI_PORT_USAGE_INFO_THRESHOLD}
### {$UNIFI_PORT_USAGE_WARNING_THRESHOLD}
### {$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}
The percentages above which to issue and info/average event for switch Port usage. I have this set to 40, 60 and 50 respectively





Expand All @@ -200,7 +206,7 @@ If you got this far, congratulations the install is complete! Now for the funne

# Graphs

If everything is working you should be able to see data flowing in the Monitoring > Latest Data section of Zabbix. Time to set up some graphs.. Unfortunately Zabbix doesn't to have a good way to share graphs as it does for templates, so here is a quick rundown of what I have setup..:
If everything is working you should be able to see data flowing in the Monitoring > Latest Data section of Zabbix. Time to set up some graphs.. I have some basic graphs setup in the templates themselves, unfortunately Zabbix doesn't to have a good way to share the fancier graphs as it does for templates, so here is a quick rundown of what I have setup..:


## UDMP|USG Wan Download
Expand All @@ -209,7 +215,7 @@ If everything is working you should be able to see data flowing in the Monitorin
## UDMP|USG Wan Upload
![Wan Upload](/images/wanUpload.png)

Observe the tight correlation between upload bandwidt and latency.. Cable technology at its finest!
Observe the tight correlation between upload bandwidth and latency.. Cable technology at its finest!

## Router: InterVLAN traffic by network
![InterVLAN](/images/intervlan.png)
Expand Down Expand Up @@ -302,7 +308,6 @@ i.e automatically create all the proper hosts connected to the proper templates

Most of the pain in setting those templates up is debugging the SSH connections.. Add pre-processing to check for valid json on mca-dump-short to all templates

## SolarPoint support

## Even Moar data!

Expand Down
Binary file modified images/macros.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 15 additions & 15 deletions zbx_export_templates.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"zabbix_export": {
"version": "5.4",
"date": "2021-10-08T00:25:24Z",
"date": "2021-10-08T01:11:53Z",
"groups": [
{
"uuid": "15155c95a3d048f4856272ae12fd42c5",
Expand Down Expand Up @@ -4264,35 +4264,35 @@
}
],
"trigger_prototypes": [
{
"uuid": "2bb9f140e9254b83b86f5318fd3a5240",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}/100 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}/100 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above {$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}%",
"priority": "AVERAGE"
},
{
"uuid": "ce61140da14e4a1ea919f2e083ee6835",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.25 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.25 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above 25%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_INFO_THRESHOLD}/100 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_INFO_THRESHOLD}/100 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above {$UNIFI_PORT_USAGE_INFO_THRESHOLD}%",
"priority": "INFO",
"dependencies": [
{
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above 50%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.5 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.5 )"
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above {$UNIFI_PORT_USAGE_WARNING_THRESHOLD}%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_WARNING_THRESHOLD}/100 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_WARNING_THRESHOLD}/100 )"
}
]
},
{
"uuid": "054404edaf6b444a9c293b68a48a9adf",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.5 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.5 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above 50%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_WARNING_THRESHOLD}/100 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_WARNING_THRESHOLD}/100 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above {$UNIFI_PORT_USAGE_WARNING_THRESHOLD}%",
"priority": "WARNING",
"dependencies": [
{
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above 75%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.75 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.75 )"
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above {$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}%",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}/100 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*{$UNIFI_PORT_USAGE_AVERAGE_THRESHOLD}/100 )"
}
]
},
{
"uuid": "2bb9f140e9254b83b86f5318fd3a5240",
"expression": "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 ( avg(/Unifi Switch/rx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.75 or avg(/Unifi Switch/tx_port_[{#PORT_IDX}],{$UNIFI_ALERT_PERIOD})>last(/Unifi Switch/connection_speed_[{#PORT_IDX}],#1)*.75 )",
"name": "{{#PORT_IS_UPLINK}.regsub(\"true\", \"Uplink\")} {{#PORT_MEDIA}.regsub(\"SFP\", \\0)} Port {#PORT_IDX} above 75%",
"priority": "AVERAGE"
}
],
"graph_prototypes": [
Expand Down
Loading

0 comments on commit 01f0d68

Please sign in to comment.