diff --git a/plugins/ufm_events_grafana_dashboard_plugin/README.md b/plugins/ufm_events_grafana_dashboard_plugin/README.md new file mode 100644 index 00000000..2daa2376 --- /dev/null +++ b/plugins/ufm_events_grafana_dashboard_plugin/README.md @@ -0,0 +1,26 @@ +# UFM Events Grafana Dashboard Plugin + +## Overview +This plugin monitors and parses UFM events from the `event.log` file using Fluentd. It pushes the logs to a Loki server and visualizes them through Grafana dashboards. + +## Installation +1. **Install Plugin** on UFM. +2. **Access Grafana Dashboard** at: `http://:3002` (default credentials: `admin/admin`). + +## Components +- **Fluentd**: Parses `event.log` file, extracts relevant fields, and pushes logs to Loki. +- **Loki**: Aggregates and stores logs. +- **Grafana**: Visualizes logs with predefined panels (e.g., Events Stats, Topology Changes, Hardware Events). + +## Configuration Files +- Fluentd: `/opt/ufm/files/conf/plugins/ufm_events_grafana_dashboard/fluentd/fluentd.conf` +- Loki: `/opt/ufm/files/conf/plugins/ufm_events_grafana_dashboard/loki/loki-local-config.yaml` +- Grafana: `/opt/ufm/files/conf/plugins/ufm_events_grafana_dashboard/grafana/grafana.ini` + +## Logs +Plugin logs are stored in `/opt/ufm/files/log/plugins/ufm_events_grafana_dashboard/`. + +## Usage +Navigate to Grafana -> Dashboards -> UFM Events to view predefined panels or create custom queries under the Explore section. + +![Dashboard Screenshot](./grafana_dashboard.png) diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/fluentd.conf b/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/fluentd.conf index 32d05207..02435b8b 100644 --- a/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/fluentd.conf +++ b/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/fluentd.conf @@ -10,7 +10,7 @@ # some logs might be multilines entry that should be handled: @type multiline format_firstline /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3})/ # to match the first line of a log entry, which is date time format - format1 /^(?[\d\-]+ [\d\:\.]+) \[\d+\] \[\d+\] (?\w+) (?:Site \[[\w-]*\] )?\[(?\w+)\] (?\w+) \[(?.*)\]\: (((?[ \w\/\-]+)((\,|\:|\.) (?.*))?)|(?.*))$/ + format1 /^(?[\d\-]+ [\d\:\.]+) \[\d+\] \[\d+\] (?\w+) (?:Site \[[\w-]*\] )?\[(?\w+)\] (?\w+) \[(?.*)\]\: (((?[ \w]+)((\,|\:|\.|\-) (?.*))?)|(?.*))$/ time_key timestamp time_format %Y-%m-%d %H:%M:%S.%L diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/parse_object_id.rb b/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/parse_object_id.rb index 2b425eeb..7228769e 100755 --- a/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/parse_object_id.rb +++ b/plugins/ufm_events_grafana_dashboard_plugin/conf/fluentd/parse_object_id.rb @@ -42,6 +42,8 @@ def filter(tag, time, record) else record['object_id'] = objtype end + when 'Grid' + record['object_type'] = 'UFM' else record['object_id'] = objtype end diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Events_By_Severity_dashboard.json b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Events_By_Severity_dashboard.json new file mode 100644 index 00000000..e7dfdcfc --- /dev/null +++ b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Events_By_Severity_dashboard.json @@ -0,0 +1,420 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 7, + "links": [], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [ + { + "options": { + "pattern": "(.+?)None", + "result": { + "index": 0, + "text": "$1" + } + }, + "type": "regex" + }, + { + "options": { + "pattern": "(.+?)Description", + "result": { + "index": 1, + "text": "$1" + } + }, + "type": "regex" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Source" + }, + "properties": [ + { + "id": "custom.width", + "value": 81 + }, + { + "id": "mappings", + "value": [ + { + "options": { + "Grid": { + "index": 0, + "text": "UFM" + }, + "IBPort": { + "index": 1, + "text": "Port" + } + }, + "type": "value" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device GUID" + }, + "properties": [ + { + "id": "custom.width", + "value": 160 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device Type" + }, + "properties": [ + { + "id": "custom.width", + "value": 114 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Port #" + }, + "properties": [ + { + "id": "custom.width", + "value": 76 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Event Type" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 199 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Event" + }, + "properties": [ + { + "id": "custom.width", + "value": 514 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Port GUID" + }, + "properties": [ + { + "id": "custom.width", + "value": 171 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Partner Port GUID" + }, + "properties": [ + { + "id": "custom.width", + "value": 160 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Partner Port #" + }, + "properties": [ + { + "id": "custom.width", + "value": 127 + } + ] + } + ] + }, + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "code", + "expr": "{job=\"ufm-events\", severity=~\"$severity\", event_type=~\"$event_type\"} | json", + "queryType": "range", + "refId": "A" + } + ], + "title": "Events By Severity", + "transformations": [ + { + "id": "extractFields", + "options": { + "source": "labels" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Line": true, + "detected_level": true, + "device_guid": true, + "device_name": false, + "device_type": true, + "event_type": true, + "id": true, + "job": true, + "labelTypes": true, + "labels": true, + "link_partner_port_guid": false, + "link_partner_port_num": false, + "node_guid": false, + "object_id": true, + "object_type": false, + "port_guid": false, + "port_num": false, + "service_name": true, + "severity": true, + "timestamp": true, + "tsNs": true + }, + "includeByName": {}, + "indexByName": { + "Line": 10, + "Time": 1, + "detected_level": 14, + "device_name": 4, + "device_type": 19, + "event": 7, + "event_details": 8, + "event_type": 2, + "id": 13, + "job": 15, + "labelTypes": 12, + "labels": 0, + "node_guid": 5, + "object_id": 16, + "object_type": 3, + "port_num": 6, + "service_name": 17, + "severity": 9, + "timestamp": 18, + "tsNs": 11 + }, + "renameByName": { + "device_guid": "Device GUID", + "device_name": "Device Name", + "device_type": "Device Type", + "event": "Event", + "event_details": "Event Details", + "event_type": "Event Type", + "link_partner_port_guid": "Partner Port GUID", + "link_partner_port_num": "Partner Port #", + "node_guid": "Device GUID", + "object_type": "Source", + "port_guid": "Port GUID", + "port_num": "Port #" + } + } + } + ], + "type": "table" + } + ], + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Severity", + "multi": true, + "name": "severity", + "options": [], + "query": { + "label": "severity", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "All", + "value": "$__all" + }, + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Category", + "multi": true, + "name": "event_type", + "options": [], + "query": { + "label": "event_type", + "refId": "LokiVariableQueryEditor-VariableQuery", + "stream": "", + "type": 1 + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Events By Severity", + "uid": "fdty5fk5mxkhsa", + "version": 5, + "weekStart": "" +} \ No newline at end of file diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Links_Telemetry_dashboard.json b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Links_Telemetry_dashboard.json new file mode 100644 index 00000000..37041d22 --- /dev/null +++ b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/Links_Telemetry_dashboard.json @@ -0,0 +1,432 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 8, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 17, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "disableTextWrap": false, + "editorMode": "code", + "expr": "link_down_counter{port_guid=\"0x$src_port_guid\", port_num=\"$src_port_num\"}", + "fullMetaSearch": false, + "includeNullMetadata": true, + "instant": true, + "legendFormat": "{{node_description}} - {{port_guid}} - {{port_num}}", + "range": true, + "refId": "A", + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "editorMode": "code", + "expr": "link_down_counter{port_guid=\"0x$dest_port_guid\", port_num=\"$dest_port_num\"}", + "hide": false, + "instant": false, + "legendFormat": "{{node_description}} - {{port_guid}} - {{port_num}}", + "range": true, + "refId": "B" + } + ], + "title": "Link Down Metric", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "editorMode": "code", + "expr": "irate(link_down_counter{port_guid=\"0x$src_port_guid\", port_num=\"$src_port_num\"}[$__range])", + "hide": false, + "instant": false, + "legendFormat": "{{node_description}} - {{port_guid}} - {{port_num}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "editorMode": "code", + "expr": "irate(link_down_counter{port_guid=\"0x$dest_port_guid\", port_num=\"$dest_port_num\"}[$__range])", + "hide": false, + "instant": false, + "legendFormat": "{{node_description}} - {{port_guid}} - {{port_num}}", + "range": true, + "refId": "B" + } + ], + "title": "Link Down Rate", + "type": "timeseries" + } + ], + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "localhost mlx5_0", + "value": "localhost mlx5_0" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values({port_guid=\"0x$src_port_guid\"},node_description)", + "hide": 0, + "includeAll": false, + "label": "Source Node Description", + "multi": false, + "name": "src_node_description", + "options": [], + "query": { + "qryType": 5, + "query": "label_values({port_guid=\"0x$src_port_guid\"},node_description)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "043f720300a45b08", + "value": "043f720300a45b08" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values(port_guid)", + "hide": 0, + "includeAll": false, + "label": "Source Port GUID", + "multi": false, + "name": "src_port_guid", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(port_guid)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "^0x?(.*)", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values({port_guid=\"0x$src_port_guid\"},Port_Number)", + "hide": 0, + "includeAll": false, + "label": "Source Port #", + "multi": false, + "name": "src_port_num", + "options": [], + "query": { + "qryType": 5, + "query": "label_values({port_guid=\"0x$src_port_guid\"},Port_Number)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 3, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "localhost mlx5_0", + "value": "localhost mlx5_0" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values({port_guid=\"0x$dest_port_guid\"},node_description)", + "hide": 0, + "includeAll": false, + "label": "Destination Node Description", + "multi": false, + "name": "dest_node_description", + "options": [], + "query": { + "qryType": 5, + "query": "label_values({port_guid=\"0x$dest_port_guid\"},node_description)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "043f720300a45b08", + "value": "043f720300a45b08" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values(port_guid)", + "hide": 0, + "includeAll": false, + "label": "Destination Port GUID", + "multi": false, + "name": "dest_port_guid", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(port_guid)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "^0x?(.*)", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "be0cjqju2nncwb" + }, + "definition": "label_values({port_guid=\"0x$dest_port_guid\"},Port_Number)", + "hide": 0, + "includeAll": false, + "label": "Destination Port #", + "multi": false, + "name": "dest_port_num", + "options": [], + "query": { + "qryType": 5, + "query": "label_values({port_guid=\"0x$dest_port_guid\"},Port_Number)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 3, + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Links Telemetry", + "uid": "adtvsifuj0gsgc", + "version": 2, + "weekStart": "" +} \ No newline at end of file diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_dashboard.json b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_dashboard.json deleted file mode 100644 index e1211834..00000000 --- a/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_dashboard.json +++ /dev/null @@ -1,690 +0,0 @@ -{ - "__inputs": [ - { - "name": "DS_LOKI", - "label": "loki", - "description": "", - "type": "datasource", - "pluginId": "loki", - "pluginName": "Loki" - } - ], - "__elements": {}, - "__requires": [ - { - "type": "panel", - "id": "gauge", - "name": "Gauge", - "version": "" - }, - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "11.1.0" - }, - { - "type": "datasource", - "id": "loki", - "name": "Loki", - "version": "1.0.0" - }, - { - "type": "panel", - "id": "table", - "name": "Table", - "version": "" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": null, - "links": [], - "panels": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 70 - }, - { - "color": "red", - "value": 85 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 8, - "x": 0, - "y": 0 - }, - "id": 2, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "sum by (severity) (count_over_time({job=\"ufm-events\"}[$__range]))", - "legendFormat": "{{severity}}", - "queryType": "range", - "refId": "A" - } - ], - "title": "Events Stats By Severity", - "type": "gauge" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 70 - }, - { - "color": "red", - "value": 85 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 16, - "x": 8, - "y": 0 - }, - "id": 3, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": false, - "sizing": "auto" - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "code", - "expr": "sum by (event_type) (count_over_time({job=\"ufm-events\"}[$__range]))", - "legendFormat": "{{event_type}}", - "queryType": "range", - "refId": "A" - } - ], - "title": "Events Stats By Category", - "type": "gauge" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 1, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "{job=\"ufm-events\"} | json", - "queryType": "range", - "refId": "A" - } - ], - "title": "Last 1000 Events", - "transformations": [ - { - "id": "extractFields", - "options": { - "source": "labels" - } - }, - { - "id": "organize", - "options": { - "excludeByName": {}, - "includeByName": { - "Time": true, - "device_guid": true, - "device_name": true, - "device_type": true, - "event": true, - "event_details": true, - "event_type": true, - "labels": false, - "object_id": true, - "object_type": true, - "port_num": true, - "severity": true - }, - "indexByName": { - "Line": 12, - "Time": 0, - "detected_level": 16, - "device_guid": 5, - "device_name": 4, - "device_type": 6, - "event": 9, - "event_details": 10, - "event_type": 2, - "id": 15, - "job": 17, - "labelTypes": 14, - "labels": 11, - "object_id": 8, - "object_type": 3, - "port_num": 7, - "service_name": 18, - "severity": 1, - "timestamp": 19, - "tsNs": 13 - }, - "renameByName": { - "device_guid": "GUID", - "device_name": "Device Name", - "device_type": "Device Type", - "event": "Event", - "event_details": "Event Details", - "event_type": "Event Type", - "object_id": "Object ID", - "object_type": "Object Type", - "port_num": "Port Number", - "severity": "Severity" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 21 - }, - "id": 4, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Time" - } - ] - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "{job=\"ufm-events\", object_type=\"IBPort\"} | json", - "queryType": "range", - "refId": "A" - } - ], - "title": "Ports Events", - "transformations": [ - { - "id": "extractFields", - "options": { - "source": "labels" - } - }, - { - "id": "organize", - "options": { - "excludeByName": {}, - "includeByName": { - "Time": true, - "device_guid": true, - "device_name": true, - "device_type": true, - "event": true, - "event_details": true, - "event_type": true, - "labelTypes": false, - "object_type": true, - "port_num": true, - "severity": true - }, - "indexByName": { - "Time": 0, - "device_guid": 6, - "device_name": 4, - "device_type": 5, - "event": 8, - "event_details": 9, - "event_type": 2, - "object_type": 3, - "port_num": 7, - "severity": 1 - }, - "renameByName": { - "device_guid": "GUID", - "device_name": "Device Name", - "device_type": "Device Type", - "event": "Event", - "event_details": "Event Details", - "event_type": "Event Type", - "object_type": "Object Type", - "port_num": "Port Number", - "severity": "Severity" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 29 - }, - "id": 6, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "{event_type=~\"Hardware\", job=\"ufm-events\"} | json", - "queryType": "range", - "refId": "A" - } - ], - "title": "Hardware Events", - "transformations": [ - { - "id": "extractFields", - "options": { - "source": "labels" - } - }, - { - "id": "organize", - "options": { - "excludeByName": {}, - "includeByName": { - "Time": true, - "device_guid": true, - "device_name": true, - "device_type": true, - "event": true, - "event_details": true, - "event_type": true, - "object_type": true, - "port_num": true, - "severity": true - }, - "indexByName": { - "Time": 0, - "device_guid": 6, - "device_name": 4, - "device_type": 5, - "event": 8, - "event_details": 9, - "event_type": 2, - "object_type": 3, - "port_num": 7, - "severity": 1 - }, - "renameByName": { - "device_guid": "GUID", - "device_name": "Device Name", - "device_type": "Device Type", - "event": "Event", - "event_details": "Event Details", - "event_type": "Event Type", - "object_type": "Object Type", - "port_num": "Port Number", - "severity": "Severity" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": { - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 29 - }, - "id": 5, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "{event_type=~\"Fabric_Topology\", job=\"ufm-events\"} | json", - "queryType": "range", - "refId": "A" - } - ], - "title": "Topology Changes Events", - "transformations": [ - { - "id": "extractFields", - "options": { - "source": "labels" - } - }, - { - "id": "organize", - "options": { - "excludeByName": {}, - "includeByName": { - "Time": true, - "event": true, - "event_details": true, - "event_type": true, - "object_id": true, - "object_type": true, - "severity": true - }, - "indexByName": { - "Time": 0, - "event": 5, - "event_details": 6, - "event_type": 2, - "object_id": 4, - "object_type": 3, - "severity": 1 - }, - "renameByName": { - "event": "Event", - "event_details": "Event Details", - "event_type": "Event Type", - "labels": "", - "object_id": "Object ID", - "object_type": "Object Type", - "severity": "Severity" - } - } - } - ], - "type": "table" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "UFM Events", - "uid": "dds4v53h2h69sb", - "version": 8, - "weekStart": "" -} diff --git a/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_main_dashboard.json b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_main_dashboard.json new file mode 100644 index 00000000..a0ee6eb3 --- /dev/null +++ b/plugins/ufm_events_grafana_dashboard_plugin/conf/grafana/provisioning/dashboards/json/UFM_Events_main_dashboard.json @@ -0,0 +1,702 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 5, + "links": [], + "panels": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "links": [ + { + "targetBlank": true, + "title": "Show Events", + "url": "/d/fdty5fk5mxkhsa/events-by-severity?var-severity=${__field.labels.severity}&from=${__from}&to=${__to}" + } + ], + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "code", + "expr": "sum by (severity) (count_over_time({job=\"ufm-events\"}[$__range]))", + "legendFormat": "{{severity}}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Events Stats By Severity", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "links": [ + { + "targetBlank": true, + "title": "Show Events By Category", + "url": "/d/fdty5fk5mxkhsa/events-by-severity?var-event_type=${__field.labels.event_type}&from=${__from}&to=${__to}" + } + ], + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 16, + "x": 8, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "code", + "expr": "sum by (event_type) (count_over_time({job=\"ufm-events\"}[$__range]))", + "legendFormat": "{{event_type}}", + "queryType": "range", + "refId": "A" + } + ], + "title": "Events Stats By Category", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "fieldConfig": { + "defaults": { + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [ + { + "options": { + "pattern": "(.+?)None", + "result": { + "index": 0, + "text": "$1" + } + }, + "type": "regex" + }, + { + "options": { + "pattern": "(.+?)Description", + "result": { + "index": 1, + "text": "$1" + } + }, + "type": "regex" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Severity" + }, + "properties": [ + { + "id": "custom.width", + "value": 93 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Source" + }, + "properties": [ + { + "id": "custom.width", + "value": 85 + }, + { + "id": "mappings", + "value": [ + { + "options": { + "Grid": { + "index": 0, + "text": "UFM" + }, + "IBPort": { + "index": 1, + "text": "Port" + } + }, + "type": "value" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Event Type" + }, + "properties": [ + { + "id": "custom.width", + "value": 152 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device Name" + }, + "properties": [ + { + "id": "custom.width", + "value": 126 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Port #" + }, + "properties": [ + { + "id": "custom.width", + "value": 92 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 172 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device GUID" + }, + "properties": [ + { + "id": "custom.width", + "value": 170 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Event" + }, + "properties": [ + { + "id": "custom.width", + "value": 225 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Device Type" + }, + "properties": [ + { + "id": "custom.width", + "value": 118 + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 10 + }, + "id": 1, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "builder", + "expr": "{job=\"ufm-events\", severity=~\"CRITICAL|MINOR|WARNING\"} | json", + "queryType": "range", + "refId": "A" + } + ], + "title": "Recent Significant Events", + "transformations": [ + { + "id": "extractFields", + "options": { + "source": "labels" + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "includeByName": { + "Time": true, + "device_guid": false, + "device_name": false, + "device_type": false, + "event": true, + "event_details": true, + "event_type": true, + "labels": false, + "object_id": false, + "object_type": true, + "port_num": false, + "severity": true + }, + "indexByName": { + "Line": 12, + "Time": 0, + "detected_level": 16, + "device_guid": 5, + "device_name": 4, + "device_type": 6, + "event": 9, + "event_details": 10, + "event_type": 2, + "id": 15, + "job": 17, + "labelTypes": 14, + "labels": 11, + "object_id": 8, + "object_type": 3, + "port_num": 7, + "service_name": 18, + "severity": 1, + "timestamp": 19, + "tsNs": 13 + }, + "renameByName": { + "device_guid": "Device GUID", + "device_name": "Device Name", + "device_type": "Device Type", + "event": "Event", + "event_details": "Event Details", + "event_type": "Event Type", + "object_id": "Object ID", + "object_type": "Source", + "port_num": "Port #", + "severity": "Severity" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "mappings": [ + { + "options": { + "pattern": "(.+?)None", + "result": { + "index": 0, + "text": "$1" + } + }, + "type": "regex" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 188 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Severity" + }, + "properties": [ + { + "id": "custom.width", + "value": 94 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Link ID" + }, + "properties": [ + { + "id": "custom.width", + "value": 378 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "Show Link Down Metric", + "url": "/d/adtvsifuj0gsgc/ufm-telemetry?var-src_port_guid=${__data.fields.port_guid}&var-src_port_num=${__data.fields.port_num}&var-dest_port_guid=${__data.fields.link_partner_port_guid}&var-dest_port_num=${__data.fields.link_partner_port_num}&from=${__from}&to=${__to}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "port_guid" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "port_num" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "link_partner_port_guid" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "link_partner_port_num" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 7, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "Time" + } + ] + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "P8E80F9AEF21F6940" + }, + "editorMode": "code", + "expr": "{job=\"ufm-events\"} \r\n|= `Link went down` \r\n| json", + "queryType": "range", + "refId": "A" + } + ], + "title": "Link Down Events", + "transformations": [ + { + "id": "extractFields", + "options": { + "source": "labels" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Line": true, + "dest_node_guid": false, + "dest_port_num": false, + "detected_level": true, + "event": true, + "event_type": true, + "id": true, + "job": true, + "labelTypes": true, + "labels": true, + "link_partner_port_guid": false, + "link_partner_port_num": false, + "object_type": true, + "port_guid": false, + "port_num": false, + "service_name": true, + "severity": true, + "src_node_guid": false, + "src_port_num": false, + "timestamp": true, + "tsNs": true + }, + "includeByName": {}, + "indexByName": { + "Line": 4, + "Time": 1, + "detected_level": 8, + "event": 9, + "event_details": 10, + "event_type": 11, + "id": 7, + "job": 12, + "labelTypes": 6, + "labels": 0, + "object_id": 3, + "object_type": 13, + "service_name": 14, + "severity": 2, + "tsNs": 5 + }, + "renameByName": { + "event_details": "Details", + "object_id": "Link ID", + "severity": "Severity" + } + } + } + ], + "type": "table" + } + ], + "schemaVersion": 39, + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-7d", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "UFM Events", + "uid": "dds4v53h2h69sc", + "version": 2, + "weekStart": "" +} \ No newline at end of file diff --git a/plugins/ufm_events_grafana_dashboard_plugin/grafana_dashboard.png b/plugins/ufm_events_grafana_dashboard_plugin/grafana_dashboard.png index 0e9c7b4f..b374cf34 100644 Binary files a/plugins/ufm_events_grafana_dashboard_plugin/grafana_dashboard.png and b/plugins/ufm_events_grafana_dashboard_plugin/grafana_dashboard.png differ