diff --git a/Gopkg.lock b/Gopkg.lock index 2e5236ab..8da56ceb 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,12 +2,12 @@ [[projects]] - digest = "1:91639d25b5400abb27afc5d4e201898f157a239d508dd98bcac2858fdea6869a" + digest = "1:e52e3ff16e2e82410ca561073537e336b0aff9f3bded65ee856aec7ec47efbaf" name = "github.com/golift/unifi" packages = ["."] pruneopts = "UT" - revision = "a88e9234a418f7880d4da4e651899bb5a7185ec7" - version = "v2.0.1" + revision = "3968f3384cbe437d991c27c4338e4c371897ac32" + version = "v2.0.2" [[projects]] branch = "master" diff --git a/README.md b/README.md index bbe72630..df5a2333 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,12 @@ select multiple to put specific stats side-by-side. ![image](examples/unifi-uap-dashboard.png?raw=true) +The USW / Switch Dashboard is pretty big with one data-filled section per selected port. +You can drill down into specific sites, switches, and ports. Compare ports in different +sites side-by-side. So easy! This screenshot barely does it justice. + +![image](examples/unifi-usw-dashboard.png?raw=true) + ## Copyright & License - Copyright © 2016 Garrett Bjerkhoel. diff --git a/cmd/unifi-poller/main.go b/cmd/unifi-poller/main.go index 01da5525..6ebf9acf 100644 --- a/cmd/unifi-poller/main.go +++ b/cmd/unifi-poller/main.go @@ -43,7 +43,9 @@ func (c *Config) Run() error { if !c.Quiet { log.Println("Authenticated to Unifi Controller @", c.UnifiBase, "as user", c.UnifiUser) } - + if err := c.CheckSites(controller); err != nil { + return err + } controller.ErrorLog = log.Printf // Log all errors. if log.SetFlags(0); c.Debug { log.Println("Debug Logging Enabled") @@ -83,6 +85,31 @@ func parseFlags() string { return *configFile } +// CheckSites makes sure the list of provided sites exists on the controller. +func (c *Config) CheckSites(controller *unifi.Unifi) error { + sites, err := controller.GetSites() + if err != nil { + return err + } + if !c.Quiet { + msg := make([]string, 0) + for _, site := range sites { + msg = append(msg, site.Name+" ("+site.Desc+")") + } + log.Printf("Found %d site(s) on controller: %v", len(msg), strings.Join(msg, ",")) + } +FIRST: + for _, s := range c.Sites { + for _, site := range sites { + if s == site.Name || s == "all" { + continue FIRST + } + } + return errors.Errorf("configured site not found on controller: %v", s) + } + return nil +} + // GetConfig parses and returns our configuration data. func GetConfig(configFile string) (Config, error) { // Preload our defaults. diff --git a/examples/README.md b/examples/README.md index edaaf3a1..39886d79 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,7 +4,8 @@ This folder contains 3 grafana dashboards to get you started with the new data p Import these into Grafana to quickly visualize data from your devices. Created with Grafana 6.2. -They require a few plugins: `Clock`, `Discrete`, `Singlestat`, `Table` +These dashboards require a few plugins. +See the [Wiki](https://github.com/davidnewhall/unifi-poller/wiki/Grafana) for more info. Keep in mind these dashboards are just examples. You should make an Example folder in Grafana to keep them in, and copy them to new dashboards that you want to change. diff --git a/examples/unifi-clients-grafana-dash.json b/examples/unifi-clients-grafana-dash.json index 8db7fb5f..46f205dd 100644 --- a/examples/unifi-clients-grafana-dash.json +++ b/examples/unifi-clients-grafana-dash.json @@ -1,4 +1,52 @@ { + "__inputs": [ + { + "name": "DS_UNIFI", + "label": "Unifi", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.2.1" + }, + { + "type": "panel", + "id": "grafana-piechart-panel", + "name": "Pie Chart", + "version": "1.3.3" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "natel-discrete-panel", + "name": "Discrete", + "version": "0.0.9" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], "annotations": { "list": [ { @@ -15,17 +63,17 @@ "editable": true, "gnetId": null, "graphTooltip": 1, - "id": 6, - "iteration": 1559783294182, + "id": null, + "iteration": 1559859351362, "links": [], "panels": [ { "columns": [], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "", "fontSize": "80%", "gridPos": { - "h": 10, + "h": 13, "w": 12, "x": 0, "y": 0 @@ -202,11 +250,11 @@ }, { "columns": [], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "", "fontSize": "80%", "gridPos": { - "h": 10, + "h": 13, "w": 12, "x": 12, "y": 0 @@ -219,7 +267,7 @@ "scroll": true, "showHeader": true, "sort": { - "col": 3, + "col": 8, "desc": true }, "styles": [ @@ -371,7 +419,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "", "fontSize": "70%", @@ -380,7 +428,7 @@ "h": 8, "w": 6, "x": 0, - "y": 10 + "y": 13 }, "hideTimeOverride": true, "id": 9, @@ -476,7 +524,7 @@ "tags": [] } ], - "timeFrom": "1h", + "timeFrom": null, "title": "Wifi Channels", "transparent": true, "type": "grafana-piechart-panel", @@ -490,7 +538,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "", "fontSize": "70%", @@ -499,7 +547,7 @@ "h": 8, "w": 6, "x": 6, - "y": 10 + "y": 13 }, "hideTimeOverride": true, "id": 11, @@ -558,7 +606,7 @@ ] } ], - "timeFrom": "1h", + "timeFrom": null, "title": "AP Radio / Clients", "transparent": true, "type": "grafana-piechart-panel", @@ -572,7 +620,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "", "fontSize": "70%", @@ -581,7 +629,7 @@ "h": 8, "w": 6, "x": 12, - "y": 10 + "y": 13 }, "hideTimeOverride": true, "id": 12, @@ -679,7 +727,7 @@ ] } ], - "timeFrom": "1h", + "timeFrom": null, "title": "Client MAC OUI Breakdown", "transparent": true, "type": "grafana-piechart-panel", @@ -693,7 +741,7 @@ "label": "Others", "threshold": 0 }, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "", "fontSize": "70%", @@ -702,7 +750,7 @@ "h": 8, "w": 6, "x": 18, - "y": 10 + "y": 13 }, "hideTimeOverride": true, "id": 14, @@ -760,7 +808,7 @@ ] } ], - "timeFrom": "1h", + "timeFrom": null, "title": "OS/Dev Class/ID Breakdown", "transparent": true, "type": "grafana-piechart-panel", @@ -771,14 +819,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Bandwidth usage per wireless devices as reported by the UAPs. Does not include amazon devices.", "fill": 1, "gridPos": { "h": 7, "w": 12, "x": 0, - "y": 18 + "y": 21 }, "id": 3, "legend": { @@ -966,14 +1014,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Cameras TX / RX bytes per second (calculated in 1 minute buckets).", "fill": 0, "gridPos": { "h": 7, "w": 12, "x": 12, - "y": 18 + "y": 21 }, "id": 15, "legend": { @@ -1143,14 +1191,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Amazon Devices TX / RX bytes per second (calculated in 30 second buckets).", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 0, - "y": 25 + "y": 28 }, "id": 23, "legend": { @@ -1444,14 +1492,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Wired TX / RX bytes per second (calculated in 30 second buckets). Does not include amazon and camera devices. Unaffected by the AP setting.", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 12, - "y": 25 + "y": 28 }, "id": 2, "legend": { @@ -1650,7 +1698,7 @@ } ], "crosshairColor": "#8F070C", - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Shows which wireless radio a client is connected to. Setting AP does not change this.", "display": "timeline", "expandFromQueryS": 0, @@ -1659,7 +1707,7 @@ "h": 9, "w": 12, "x": 0, - "y": 34 + "y": 37 }, "highlightOnMouseover": false, "id": 17, @@ -1815,7 +1863,7 @@ } ], "crosshairColor": "#8F070C", - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Shows IPs assigned to non-static clients.", "display": "timeline", "expandFromQueryS": 0, @@ -1824,7 +1872,7 @@ "h": 9, "w": 12, "x": 12, - "y": 34 + "y": 37 }, "highlightOnMouseover": false, "id": 18, @@ -1963,13 +2011,13 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 0, - "y": 43 + "y": 46 }, "id": 7, "legend": { @@ -1982,7 +2030,7 @@ "min": true, "rightSide": true, "show": true, - "sort": "current", + "sort": "min", "sortDesc": true, "total": false, "values": true @@ -2102,13 +2150,13 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "fill": 0, "gridPos": { "h": 9, "w": 12, "x": 12, - "y": 43 + "y": 46 }, "id": 10, "legend": { @@ -2241,13 +2289,13 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "fill": 0, "gridPos": { "h": 8, "w": 12, "x": 0, - "y": 52 + "y": 55 }, "id": 6, "legend": { @@ -2380,14 +2428,14 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "", "fill": 0, "gridPos": { "h": 8, "w": 12, "x": 12, - "y": 52 + "y": 55 }, "id": 19, "legend": { @@ -2521,11 +2569,8 @@ "list": [ { "allValue": null, - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"clients\" with key=\"site_name\"", "hide": 0, "includeAll": true, @@ -2546,14 +2591,8 @@ }, { "allValue": null, - "current": { - "tags": [], - "text": "All", - "value": [ - "$__all" - ] - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"clients\" with key=\"ap_mac\" where site_name =~ /$Site$/", "hide": 0, "includeAll": true, @@ -2574,13 +2613,8 @@ }, { "allValue": null, - "current": { - "text": "All", - "value": [ - "$__all" - ] - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"clients\" with key=\"name\" where site_name =~ /$Site$/", "hide": 0, "includeAll": true, @@ -2628,7 +2662,7 @@ ] }, "timezone": "", - "title": "Unifi Clients", + "title": "Unifi Client Insights", "uid": "YVR23BZiz", - "version": 45 -} + "version": 48 +} \ No newline at end of file diff --git a/examples/unifi-uap-grafana-dash.json b/examples/unifi-uap-grafana-dash.json index 0bc38dc0..3cc3eb96 100644 --- a/examples/unifi-uap-grafana-dash.json +++ b/examples/unifi-uap-grafana-dash.json @@ -1,4 +1,58 @@ { + "__inputs": [ + { + "name": "DS_UNIFI", + "label": "Unifi", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.2.1" + }, + { + "type": "panel", + "id": "grafana-clock-panel", + "name": "Clock", + "version": "0.1.0" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { @@ -16,13 +70,13 @@ "editable": true, "gnetId": 1486, "graphTooltip": 1, - "id": 7, - "iteration": 1559783373023, + "id": null, + "iteration": 1559859372283, "links": [], "panels": [ { "columns": [], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fontSize": "100%", @@ -504,11 +558,21 @@ "offsetFromUtc": null, "offsetFromUtcMinutes": null, "options": {}, + "refreshSettings": { + "syncWithDashboard": false + }, "timeSettings": { "customFormat": "HH:mm:ss", "fontSize": "30px", "fontWeight": "normal" }, + "timezone": null, + "timezoneSettings": { + "fontSize": "12px", + "fontWeight": "normal", + "showTimezone": false, + "zoneFormat": "offsetAbbv" + }, "title": "Now", "type": "grafana-clock-panel" }, @@ -521,7 +585,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "format": "none", @@ -642,7 +706,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "format": "none", @@ -759,7 +823,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "format": "percent", "gauge": { @@ -875,7 +939,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 3, "format": "dtdurations", "gauge": { @@ -989,7 +1053,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "format": "none", @@ -1112,7 +1176,7 @@ "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "format": "none", @@ -1225,7 +1289,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 0, @@ -1378,7 +1442,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 1, @@ -1531,7 +1595,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 1, @@ -1671,7 +1735,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "editable": true, "error": false, @@ -1859,7 +1923,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 0, @@ -2043,7 +2107,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 0, @@ -2226,7 +2290,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 1, @@ -2422,7 +2486,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fill": 1, @@ -2618,7 +2682,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "PPS on the na band calculated in 30 second buckets.", "editable": true, @@ -2803,7 +2867,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "PPS on the ng band calculated in 30 second buckets.", "editable": true, @@ -2990,7 +3054,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "editable": true, "error": false, @@ -3302,7 +3366,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "editable": true, "error": false, @@ -3629,13 +3693,8 @@ }, { "allValue": null, - "current": { - "text": "All", - "value": [ - "$__all" - ] - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"uap\" with key=\"site_name\"", "hide": 0, "includeAll": true, @@ -3656,13 +3715,8 @@ }, { "allValue": null, - "current": { - "text": "All", - "value": [ - "$__all" - ] - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"uap\" with key=\"name\" where site_name =~ /$Site$/", "hide": 0, "includeAll": true, @@ -3714,4 +3768,4 @@ "title": "UniFi UAP Insights", "uid": "8nQ_RPZiz", "version": 37 -} +} \ No newline at end of file diff --git a/examples/unifi-usg-grafana-dash.json b/examples/unifi-usg-grafana-dash.json index 1496ef97..6d64c56d 100644 --- a/examples/unifi-usg-grafana-dash.json +++ b/examples/unifi-usg-grafana-dash.json @@ -1,4 +1,58 @@ { + "__inputs": [ + { + "name": "DS_UNIFI", + "label": "Unifi", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.2.1" + }, + { + "type": "panel", + "id": "grafana-clock-panel", + "name": "Clock", + "version": "0.1.0" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "singlestat", + "name": "Singlestat", + "version": "" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + } + ], "annotations": { "list": [ { @@ -17,8 +71,8 @@ "editable": true, "gnetId": 1486, "graphTooltip": 1, - "id": 9, - "iteration": 1559783436821, + "id": null, + "iteration": 1559859384864, "links": [], "panels": [ { @@ -39,7 +93,7 @@ }, { "columns": [], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "editable": true, "error": false, "fontSize": "100%", @@ -504,7 +558,7 @@ "#3f2b5b", "#511749" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 3, "format": "dtdurations", "gauge": { @@ -612,7 +666,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "format": "none", "gauge": { @@ -723,7 +777,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "description": "", "format": "ms", @@ -841,7 +895,7 @@ "rgba(237, 129, 40, 0.89)", "#299c46" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "description": "", "format": "Mbits", @@ -959,7 +1013,7 @@ "rgba(237, 129, 40, 0.89)", "#299c46" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "description": "", "format": "Mbits", @@ -1077,7 +1131,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "format": "percent", "gauge": { @@ -1194,7 +1248,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 1, "description": "", "format": "percent", @@ -1311,7 +1365,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "format": "none", "gauge": { @@ -1439,11 +1493,21 @@ "offsetFromUtc": null, "offsetFromUtcMinutes": null, "options": {}, + "refreshSettings": { + "syncWithDashboard": false + }, "timeSettings": { "customFormat": "HH:mm:ss", "fontSize": "24px", "fontWeight": "normal" }, + "timezone": null, + "timezoneSettings": { + "fontSize": "12px", + "fontWeight": "normal", + "showTimezone": false, + "zoneFormat": "offsetAbbv" + }, "title": "Now", "type": "grafana-clock-panel" }, @@ -1456,7 +1520,7 @@ "rgba(237, 129, 40, 0.89)", "#d44a3a" ], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "format": "none", "gauge": { @@ -1563,7 +1627,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 2, "description": "", "editable": true, @@ -1722,7 +1786,7 @@ }, { "columns": [], - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "fontSize": "90%", "gridPos": { "h": 7, @@ -2483,7 +2547,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Spikes on this graph that are missing from the LAN graph indicate gateway-originated traffic, like a scheduled speed test.", "editable": true, "error": false, @@ -2666,7 +2730,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "description": "Spikes on this graph that do not appear on the WAN graph indicate inter-VLAN-routing.", "editable": true, "error": false, @@ -2849,7 +2913,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 2, "description": "May show problems with your WAN interface.", "editable": true, @@ -3041,7 +3105,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 2, "description": "May show problems with your WAN interface.", "editable": true, @@ -3233,7 +3297,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "PPS on the WAN interface, calculated in 30 second buckets.", "editable": true, @@ -3426,7 +3490,7 @@ "bars": false, "dashLength": 10, "dashes": false, - "datasource": "Unifi", + "datasource": "${DS_UNIFI}", "decimals": 0, "description": "PPS on the LAN interface, calculated in 30 second buckets.", "editable": true, @@ -3623,11 +3687,8 @@ "list": [ { "allValue": null, - "current": { - "text": "All", - "value": "$__all" - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"usg\" with key=\"site_name\"", "hide": 0, "includeAll": true, @@ -3648,13 +3709,8 @@ }, { "allValue": null, - "current": { - "text": "gateway", - "value": [ - "gateway" - ] - }, - "datasource": "Unifi", + "current": {}, + "datasource": "${DS_UNIFI}", "definition": "show tag values from \"usg\" with key=\"name\" where site_name =~ /$Site$/", "hide": 0, "includeAll": true, @@ -3706,4 +3762,4 @@ "title": "UniFi USG Insights", "uid": "WX6RJOMik", "version": 33 -} +} \ No newline at end of file diff --git a/examples/unifi-usw-dashboard.png b/examples/unifi-usw-dashboard.png new file mode 100644 index 00000000..1f51667e Binary files /dev/null and b/examples/unifi-usw-dashboard.png differ diff --git a/examples/unifi-usw-grafana-dash.json b/examples/unifi-usw-grafana-dash.json new file mode 100644 index 00000000..aa49cc46 --- /dev/null +++ b/examples/unifi-usw-grafana-dash.json @@ -0,0 +1,3458 @@ +{ + "__inputs": [ + { + "name": "DS_UNIFI", + "label": "Unifi", + "description": "", + "type": "datasource", + "pluginId": "influxdb", + "pluginName": "InfluxDB" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "6.2.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "influxdb", + "name": "InfluxDB", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "table", + "name": "Table", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Unifi Switch Metrics", + "editable": true, + "gnetId": null, + "graphTooltip": 1, + "id": null, + "iteration": 1559862527065, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 137, + "panels": [], + "title": "Aggregate Graphs", + "type": "row" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "decimals": 1, + "fill": 1, + "gridPos": { + "h": 7, + "w": 6, + "x": 0, + "y": 1 + }, + "id": 1149, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/F$/", + "yaxis": 2 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name Temperature C", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "general_temperature" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + }, + { + "alias": "$tag_name Temperature F", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw", + "orderByTime": "ASC", + "policy": "default", + "refId": "B", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "general_temperature" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "*9/5+32" + ], + "type": "math" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Switch Tmperature", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 1, + "format": "celsius", + "label": "Celcius", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "decimals": null, + "format": "farenheit", + "label": "Farenheit", + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "switch load 1": "red", + "switch load 5": "blue" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "decimals": null, + "fill": 1, + "gridPos": { + "h": 7, + "w": 6, + "x": 6, + "y": 1 + }, + "id": 1150, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/load 15$/", + "fill": 0, + "linewidth": 6 + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "loadavg_1" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "load 1" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "loadavg_5" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "load 5" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "loadavg_15" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "load 15" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Switch Load Average", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": { + "switch CPU %": "dark-purple" + }, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "decimals": null, + "fill": 1, + "gridPos": { + "h": 7, + "w": 6, + "x": 12, + "y": 1 + }, + "id": 1169, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "cpu" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "CPU %" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Switch CPU Usage", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "percent", + "label": "CPU %", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "decimals": null, + "fill": 1, + "gridPos": { + "h": 7, + "w": 6, + "x": 18, + "y": 1 + }, + "id": 1170, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_name $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "mem_total" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "Total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mem_used" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "Used" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "mem_buffer" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "Buffer" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Switch Memory", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": null, + "format": "decbytes", + "label": "Memory in Bytes", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Shows data transferred for ports: $Port. TX on positive axis and RX on negative axis.", + "fill": 1, + "gridPos": { + "h": 17, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 135, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "hideEmpty": true, + "hideZero": false, + "max": true, + "min": false, + "rightSide": true, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [ + { + "alias": "/Rx$/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$tag_port_id $tag_name $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "port_id" + ], + "type": "tag" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Rx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Tx" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Data Transfer", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "transparent": true, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "label": "Bytes Per Second", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "columns": [], + "datasource": "${DS_UNIFI}", + "fontSize": "90%", + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 214, + "links": [], + "options": {}, + "pageSize": null, + "scroll": true, + "showHeader": true, + "sort": { + "col": 11, + "desc": true + }, + "styles": [ + { + "alias": "Port Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Enabled", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": false, + "mappingType": 1, + "pattern": "enable", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [] + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "Time", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "Switch", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "device_name", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Dot1x", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "dot1x_status", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "POE", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "poe_mode", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Port", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "port_idx", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "AutoNeg", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "autoneg", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "FlowCtrl RX", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "flowctrl_rx", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "FlowCtrl TX", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "flowctrl_tx", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Uplink", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "is_uplink", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Jumbo", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "jumbo", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Masked", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "masked", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Media", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "media", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Mode", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "op_mode", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "STP", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "stp_state", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "alias": "$tag_device_name $col", + "groupBy": [ + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "is_uplink" + ], + "type": "tag" + }, + { + "params": [ + "enable" + ], + "type": "tag" + }, + { + "params": [ + "jumbo" + ], + "type": "tag" + }, + { + "params": [ + "media" + ], + "type": "tag" + }, + { + "params": [ + "up" + ], + "type": "tag" + }, + { + "params": [ + "poe_mode" + ], + "type": "tag" + }, + { + "params": [ + "masked" + ], + "type": "tag" + }, + { + "params": [ + "op_mode" + ], + "type": "tag" + }, + { + "params": [ + "stp_state" + ], + "type": "tag" + }, + { + "params": [ + "device_name" + ], + "type": "tag" + }, + { + "params": [ + "flowctrl_rx" + ], + "type": "tag" + }, + { + "params": [ + "flowctrl_tx" + ], + "type": "tag" + }, + { + "params": [ + "autoneg" + ], + "type": "tag" + }, + { + "params": [ + "dot1x_status" + ], + "type": "tag" + }, + { + "params": [ + "port_idx" + ], + "type": "tag" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "full_duplex" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "FUll Duplex" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "poe_current" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "POE Current" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "poe_voltage" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "POE Voltage" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "speed" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Speed" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "poe_power" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "POE Power" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + } + ] + } + ], + "title": "All Port Information", + "transform": "table", + "transparent": true, + "type": "table" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 4, + "panels": [ + { + "columns": [], + "datasource": "${DS_UNIFI}", + "fontSize": "90%", + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 2 + }, + "id": 291, + "links": [], + "options": {}, + "pageSize": null, + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "scroll": true, + "showHeader": true, + "sort": { + "col": 13, + "desc": true + }, + "styles": [ + { + "alias": "Port Name", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "name", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "Enabled", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "link": false, + "mappingType": 1, + "pattern": "enable", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [] + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "Time", + "thresholds": [], + "type": "hidden", + "unit": "short" + }, + { + "alias": "Switch", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "device_name", + "thresholds": [], + "type": "number", + "unit": "short" + }, + { + "alias": "POE", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "poe_mode", + "thresholds": [], + "type": "string", + "unit": "short", + "valueMaps": [] + }, + { + "alias": "Mode", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "op_mode", + "thresholds": [ + "" + ], + "type": "string", + "unit": "short" + }, + { + "alias": "Up", + "colorMode": "cell", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "up", + "thresholds": [ + "0", + "0" + ], + "type": "string", + "unit": "short", + "valueMaps": [] + }, + { + "alias": "Jumbo", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "jumbo", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "Masked", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "masked", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "STP", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 2, + "mappingType": 1, + "pattern": "stp_state", + "thresholds": [], + "type": "string", + "unit": "short" + }, + { + "alias": "", + "colorMode": "cell", + "colors": [ + "rgba(50, 172, 45, 0)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 0, + "mappingType": 1, + "pattern": "/Drops$|Errors$/", + "thresholds": [ + "10", + "100" + ], + "type": "number", + "unit": "short" + }, + { + "alias": "", + "colorMode": null, + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "decimals": 1, + "mappingType": 1, + "pattern": "/Bytes$/", + "thresholds": [], + "type": "number", + "unit": "decbytes" + } + ], + "targets": [ + { + "alias": "$tag_device_name $col", + "groupBy": [ + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "enable" + ], + "type": "tag" + }, + { + "params": [ + "jumbo" + ], + "type": "tag" + }, + { + "params": [ + "up" + ], + "type": "tag" + }, + { + "params": [ + "poe_mode" + ], + "type": "tag" + }, + { + "params": [ + "masked" + ], + "type": "tag" + }, + { + "params": [ + "op_mode" + ], + "type": "tag" + }, + { + "params": [ + "stp_state" + ], + "type": "tag" + }, + { + "params": [ + "device_name" + ], + "type": "tag" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "table", + "select": [ + [ + { + "params": [ + "full_duplex" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "FUll Duplex" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "speed" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Speed" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "poe_voltage" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "POE Voltage" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "poe_power" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "POE Power" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_dropped" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Drops" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_dropped" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "TX Drops" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_errors" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Errors" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_errors" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "TX Errors" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Bytes" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "TX Bytes" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_packets" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "TX Packets" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_packets" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Packets" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_broadcast" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Broadcast" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_multicast" + ], + "type": "field" + }, + { + "params": [], + "type": "spread" + }, + { + "params": [ + "RX Multicast" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "title": "Switch $Port Information", + "transform": "table", + "type": "table" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Shows data transfer rate per second for Switch $Port. TX on positive axis and RX on negative axis.", + "fill": 1, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 1396, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [ + { + "alias": "/Rx$/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port ($tag_name) $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Bytes Rx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_bytes" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Bytes Tx" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Data Transfer: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "Bps", + "label": "Bytes / Second", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Shows broadcast and multicast packets per second for Switch $Port. TX on positive axis and RX on negative axis.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 14 + }, + "id": 594, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [ + { + "alias": "/Rx$/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port ($tag_name) $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rx_broadcast" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Broadcast Rx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_broadcast" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Broadcast Tx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_multicast" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Multicast Tx" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Multicast & Broadcast: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "pps", + "label": "PPS", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "decimals": 0, + "description": "Shows errors and dropped packets for Switch $Port. RX on negative axis.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 14 + }, + "id": 367, + "legend": { + "alignAsTable": false, + "avg": false, + "current": false, + "max": false, + "min": false, + "rightSide": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [ + { + "alias": "/Rx$/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port ($tag_name) $col", + "groupBy": [ + { + "params": [ + "1s" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "rx_dropped" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "30s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Drops RX" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_errors" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "30s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Errors RX" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_errors" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "30s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Errors TX" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "tx_dropped" + ], + "type": "field" + }, + { + "params": [], + "type": "sum" + }, + { + "params": [ + "40s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Drops TX" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Errors and Drops: Switch $Port", + "tooltip": { + "shared": true, + "sort": 2, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "decimals": 0, + "format": "short", + "label": "packets per second", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Shows packet counters for Switch $Port. TX on positive axis and RX on negative axis.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 21 + }, + "id": 468, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": false, + "show": true, + "total": true, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [ + { + "alias": "/Rx$/", + "transform": "negative-Y" + } + ], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port ($tag_name) $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "name" + ], + "type": "tag" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "tx_packets" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Rx" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "rx_packets" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "1s" + ], + "type": "non_negative_derivative" + }, + { + "params": [ + "Tx" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Packets Per Second: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "pps", + "label": "PPS", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Display POE Power for Switch $Port.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 4, + "x": 12, + "y": 21 + }, + "id": 745, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "poe_power" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Current" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "POE Power: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "watt", + "label": "Watts", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "watt", + "label": "Watts", + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Display POE Voltage for Switch $Port.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 4, + "x": 16, + "y": 21 + }, + "id": 921, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "poe_voltage" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Voltage" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "POE Voltage: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "volt", + "label": "Volts", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "watt", + "label": "Watts", + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_UNIFI}", + "description": "Display POE Current for Switch $Port.", + "fill": 1, + "gridPos": { + "h": 7, + "w": 4, + "x": 20, + "y": 21 + }, + "id": 922, + "legend": { + "alignAsTable": true, + "avg": false, + "current": true, + "max": true, + "min": false, + "rightSide": false, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "connected", + "options": {}, + "percentage": false, + "pointradius": 2, + "points": false, + "renderer": "flot", + "scopedVars": { + "Port": { + "selected": false, + "text": "switch Port 1", + "value": "switch Port 1" + } + }, + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "alias": "$Port $col", + "groupBy": [ + { + "params": [ + "$__interval" + ], + "type": "time" + }, + { + "params": [ + "null" + ], + "type": "fill" + } + ], + "measurement": "usw_ports", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "poe_current" + ], + "type": "field" + }, + { + "params": [], + "type": "last" + }, + { + "params": [ + "Current" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "site_name", + "operator": "=~", + "value": "/^$Site$/" + }, + { + "condition": "AND", + "key": "device_name", + "operator": "=~", + "value": "/^$Switch$/" + }, + { + "condition": "AND", + "key": "port_id", + "operator": "=~", + "value": "/^$Port$/" + } + ] + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "POE Current: Switch $Port", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "mamp", + "label": "Amps", + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "watt", + "label": "Watts", + "logBase": 1, + "max": null, + "min": null, + "show": false + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + } + ], + "repeat": "Port", + "title": "Switch $Port", + "type": "row" + } + ], + "refresh": false, + "schemaVersion": 18, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": {}, + "datasource": "${DS_UNIFI}", + "definition": "show tag values from \"usg\" with key=\"site_name\"", + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "Site", + "options": [], + "query": "show tag values from \"usg\" with key=\"site_name\"", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_UNIFI}", + "definition": "show tag values from \"usw_ports\" with key=\"device_name\" where site_name =~ /$Site$/", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "Switch", + "options": [], + "query": "show tag values from \"usw_ports\" with key=\"device_name\" where site_name =~ /$Site$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_UNIFI}", + "definition": "show tag values from \"usw_ports\" with key=\"port_id\" where device_name =~ /$Switch$/ AND site_name =~ /$Site$/", + "hide": 0, + "includeAll": true, + "label": null, + "multi": true, + "name": "Port", + "options": [], + "query": "show tag values from \"usw_ports\" with key=\"port_id\" where device_name =~ /$Switch$/ AND site_name =~ /$Site$/", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 3, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "", + "title": "Unifi USW Insights", + "uid": "HIKZ98GZz", + "version": 78 +} \ No newline at end of file