From 3235aba4668b0b5d45f9e816885e9575403d8a4d Mon Sep 17 00:00:00 2001 From: hardikl Date: Thu, 12 Oct 2023 18:37:17 +0530 Subject: [PATCH 1/6] feat: adding fc rest template for fibre channel switch --- conf/rest/9.6.0/fcp.yaml | 35 +++++++++++++++++++++++++++++++++++ conf/rest/default.yaml | 1 + 2 files changed, 36 insertions(+) create mode 100644 conf/rest/9.6.0/fcp.yaml diff --git a/conf/rest/9.6.0/fcp.yaml b/conf/rest/9.6.0/fcp.yaml new file mode 100644 index 000000000..275e80075 --- /dev/null +++ b/conf/rest/9.6.0/fcp.yaml @@ -0,0 +1,35 @@ +name: FCP +query: api/network/fc/ports +object: fcp + +counters: + - ^^uuid + - ^fabric.connected => fabric_connected + - ^fabric.name => fabric_name + - ^fabric.port_address => fabric_port_address + - ^fabric.switch_port => fabric_switch_port + - ^name => port_name + - ^node.name => node + - ^physical_protocol + - ^speed.configured => speed_configured + - ^state + - ^supported_protocols => supported_protocols + - fabric.connected_speed => fabric_connected_speed + - speed.maximum => max_speed + - hidden_fields: + - fabric + +export_options: + instance_keys: + - node + - port_name + instance_labels: + - fabric_connected + - fabric_name + - fabric_port_address + - fabric_switch_port + - physical_protocol + - speed_configured + - state + - supported_protocols + diff --git a/conf/rest/default.yaml b/conf/rest/default.yaml index b0b15e861..842998c47 100644 --- a/conf/rest/default.yaml +++ b/conf/rest/default.yaml @@ -16,6 +16,7 @@ objects: Disk: disk.yaml EmsDestination: ems_destination.yaml # ExportRule: exports.yaml + FCP: fcp.yaml LIF: lif.yaml Health: health.yaml Lun: lun.yaml From 53fccfb4e11921b86df8a681a71193cb273411c8 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 13 Oct 2023 12:49:06 +0530 Subject: [PATCH 2/6] feat: adding table in dashboard for fibre channel switch --- grafana/dashboards/cmode/network.json | 172 ++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 10 deletions(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index 77097072a..ada2e0c8c 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -1655,6 +1655,158 @@ ], "type": "table" }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": "left", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": {}, + "unit": "string" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Max Speed" + }, + "properties": [ + { + "id": "unit", + "value": "Gbits" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Connected Speed" + }, + "properties": [ + { + "id": "unit", + "value": "Gbits" + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 115, + "interval": "", + "options": { + "showHeader": true + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": false, + "expr": "fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + }, + { + "exemplar": false, + "expr": "fcp_max_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" + }, + { + "exemplar": false, + "expr": "fcp_fabric_connected_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "FC ports with Fabric detail", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "fabric_connected", + "fabric_name", + "fabric_switch_port", + "node", + "physical_protocol", + "port_name", + "speed_configured", + "state", + "supported_protocols", + "Value #B", + "Value #A", + "fabric_port_address" + ] + } + } + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Value #A": 12, + "Value #B": 11, + "Value #C": 10, + "fabric_connected": 2, + "fabric_name": 3, + "fabric_port_address": 4, + "fabric_switch_port": 5, + "node": 1, + "physical_protocol": 6, + "port_name": 0, + "speed_configured": 7, + "state": 8, + "supported_protocols": 9 + }, + "renameByName": { + "Value #A": "Connected Speed", + "Value #B": "Max Speed", + "fabric_connected": "Fabric Connected", + "fabric_name": "Fabric Name", + "fabric_port_address": "Fabric Port", + "fabric_switch_port": "Fabric Switch Port", + "node": "Node", + "physical_protocol": "Physical Protocol", + "port_name": "Port Name", + "speed_configured": "Speed Configured", + "state": "State", + "supported_protocols": "Supported Protocols" + } + } + } + ], + "type": "table" + }, { "datasource": "${DS_PROMETHEUS}", "description": "", @@ -1715,7 +1867,7 @@ "h": 10, "w": 12, "x": 0, - "y": 23 + "y": 34 }, "id": 67, "options": { @@ -1808,7 +1960,7 @@ "h": 10, "w": 12, "x": 12, - "y": 23 + "y": 34 }, "id": 69, "options": { @@ -1900,7 +2052,7 @@ "h": 10, "w": 12, "x": 0, - "y": 33 + "y": 44 }, "id": 77, "options": { @@ -1993,7 +2145,7 @@ "h": 10, "w": 12, "x": 12, - "y": 33 + "y": 44 }, "id": 78, "options": { @@ -2086,7 +2238,7 @@ "h": 10, "w": 6, "x": 0, - "y": 43 + "y": 54 }, "id": 75, "options": { @@ -2206,7 +2358,7 @@ "h": 10, "w": 6, "x": 6, - "y": 43 + "y": 54 }, "id": 76, "options": { @@ -2332,7 +2484,7 @@ "h": 10, "w": 6, "x": 12, - "y": 43 + "y": 54 }, "id": 73, "options": { @@ -2424,7 +2576,7 @@ "h": 10, "w": 6, "x": 18, - "y": 43 + "y": 54 }, "id": 74, "options": { @@ -3291,7 +3443,7 @@ "allValue": null, "current": {}, "datasource": "${DS_PROMETHEUS}", - "definition": "label_values(fcp_total_data{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)", + "definition": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port_name)", "description": null, "error": null, "hide": 0, @@ -3301,7 +3453,7 @@ "name": "FCP", "options": [], "query": { - "query": "label_values(fcp_total_data{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)", + "query": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port_name)", "refId": "StandardVariableQuery" }, "refresh": 2, From b9b14962d7bc26c5ae9b8aacd9b23c257d69676b Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 13 Oct 2023 13:17:56 +0530 Subject: [PATCH 3/6] feat: handling review comments --- conf/rest/9.6.0/fcp.yaml | 6 +++-- grafana/dashboards/cmode/network.json | 38 ++++++++++++++------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/conf/rest/9.6.0/fcp.yaml b/conf/rest/9.6.0/fcp.yaml index 275e80075..0e82a70df 100644 --- a/conf/rest/9.6.0/fcp.yaml +++ b/conf/rest/9.6.0/fcp.yaml @@ -4,11 +4,12 @@ object: fcp counters: - ^^uuid + - ^enabled => enabled - ^fabric.connected => fabric_connected - ^fabric.name => fabric_name - ^fabric.port_address => fabric_port_address - ^fabric.switch_port => fabric_switch_port - - ^name => port_name + - ^name => port - ^node.name => node - ^physical_protocol - ^speed.configured => speed_configured @@ -22,8 +23,9 @@ counters: export_options: instance_keys: - node - - port_name + - port instance_labels: + - enabled - fabric_connected - fabric_name - fabric_port_address diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index ada2e0c8c..f9d9006f0 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -1711,7 +1711,7 @@ "targets": [ { "exemplar": false, - "expr": "fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "expr": "fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}", "format": "table", "hide": false, "instant": true, @@ -1721,7 +1721,7 @@ }, { "exemplar": false, - "expr": "fcp_max_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "expr": "fcp_max_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}", "format": "table", "hide": false, "instant": true, @@ -1731,7 +1731,7 @@ }, { "exemplar": false, - "expr": "fcp_fabric_connected_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port_name=~\"$FCP\"}", + "expr": "fcp_fabric_connected_speed{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$FCP\"}", "format": "table", "hide": false, "instant": true, @@ -1754,13 +1754,14 @@ "fabric_switch_port", "node", "physical_protocol", - "port_name", + "port", "speed_configured", "state", "supported_protocols", "Value #B", "Value #A", - "fabric_port_address" + "fabric_port_address", + "enabled" ] } } @@ -1776,28 +1777,29 @@ "indexByName": { "Value #A": 12, "Value #B": 11, - "Value #C": 10, - "fabric_connected": 2, - "fabric_name": 3, - "fabric_port_address": 4, - "fabric_switch_port": 5, + "enabled": 2, + "fabric_connected": 3, + "fabric_name": 4, + "fabric_port_address": 5, + "fabric_switch_port": 6, "node": 1, - "physical_protocol": 6, - "port_name": 0, - "speed_configured": 7, - "state": 8, - "supported_protocols": 9 + "physical_protocol": 7, + "port": 0, + "speed_configured": 8, + "state": 9, + "supported_protocols": 10 }, "renameByName": { "Value #A": "Connected Speed", "Value #B": "Max Speed", + "enabled": "Enabled", "fabric_connected": "Fabric Connected", "fabric_name": "Fabric Name", "fabric_port_address": "Fabric Port", "fabric_switch_port": "Fabric Switch Port", "node": "Node", "physical_protocol": "Physical Protocol", - "port_name": "Port Name", + "port": "Port Name", "speed_configured": "Speed Configured", "state": "State", "supported_protocols": "Supported Protocols" @@ -3443,7 +3445,7 @@ "allValue": null, "current": {}, "datasource": "${DS_PROMETHEUS}", - "definition": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port_name)", + "definition": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)", "description": null, "error": null, "hide": 0, @@ -3453,7 +3455,7 @@ "name": "FCP", "options": [], "query": { - "query": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port_name)", + "query": "label_values(fcp_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\"}, port)", "refId": "StandardVariableQuery" }, "refresh": 2, From 01bf45014a2112dd84c747b9a2aae4c2b4addde7 Mon Sep 17 00:00:00 2001 From: hardikl Date: Thu, 19 Oct 2023 19:06:21 +0530 Subject: [PATCH 4/6] feat: handled review comments --- grafana/dashboards/cmode/network.json | 54 ++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index f9d9006f0..e6069c8ef 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -1657,7 +1657,7 @@ }, { "datasource": "${DS_PROMETHEUS}", - "description": "", + "description": "This panel requires a cluster with ONTAP 9.6+ and the Harvest REST collector", "fieldConfig": { "defaults": { "custom": { @@ -1693,6 +1693,58 @@ "value": "Gbits" } ] + }, + { + "matcher": { + "id": "byName", + "options": "Enabled" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "index": 1, + "text": "No" + }, + "true": { + "index": 0, + "text": "Yes" + } + }, + "type": "value" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Fabric Connected" + }, + "properties": [ + { + "id": "mappings", + "value": [ + { + "options": { + "false": { + "index": 1, + "text": "No" + }, + "true": { + "index": 0, + "text": "Yes" + } + }, + "type": "value" + } + ] + } + ] } ] }, From 1d369df527b7a7e13069c8565ff3921e6818c9a1 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 20 Oct 2023 12:34:58 +0530 Subject: [PATCH 5/6] feat: handled review comments --- grafana/dashboards/cmode/network.json | 35 ++++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index e6069c8ef..cdccb3611 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -1655,6 +1655,23 @@ ], "type": "table" }, + { + "datasource": "${DS_PROMETHEUS}", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 117, + "options": { + "content": "", + "mode": "markdown" + }, + "pluginVersion": "8.1.8", + "title": "FC ports with Fabric detail panel needs a cluster running ONTAP 9.6+, along with the Harvest REST collector.", + "type": "text" + }, { "datasource": "${DS_PROMETHEUS}", "description": "This panel requires a cluster with ONTAP 9.6+ and the Harvest REST collector", @@ -1752,7 +1769,7 @@ "h": 11, "w": 24, "x": 0, - "y": 23 + "y": 24 }, "id": 115, "interval": "", @@ -1921,7 +1938,7 @@ "h": 10, "w": 12, "x": 0, - "y": 34 + "y": 35 }, "id": 67, "options": { @@ -2014,7 +2031,7 @@ "h": 10, "w": 12, "x": 12, - "y": 34 + "y": 35 }, "id": 69, "options": { @@ -2106,7 +2123,7 @@ "h": 10, "w": 12, "x": 0, - "y": 44 + "y": 45 }, "id": 77, "options": { @@ -2199,7 +2216,7 @@ "h": 10, "w": 12, "x": 12, - "y": 44 + "y": 45 }, "id": 78, "options": { @@ -2292,7 +2309,7 @@ "h": 10, "w": 6, "x": 0, - "y": 54 + "y": 55 }, "id": 75, "options": { @@ -2412,7 +2429,7 @@ "h": 10, "w": 6, "x": 6, - "y": 54 + "y": 55 }, "id": 76, "options": { @@ -2538,7 +2555,7 @@ "h": 10, "w": 6, "x": 12, - "y": 54 + "y": 55 }, "id": 73, "options": { @@ -2630,7 +2647,7 @@ "h": 10, "w": 6, "x": 18, - "y": 54 + "y": 55 }, "id": 74, "options": { From 7a074883df0503fb1a5b5d58278ee36cc1389142 Mon Sep 17 00:00:00 2001 From: hardikl Date: Fri, 20 Oct 2023 13:37:47 +0530 Subject: [PATCH 6/6] feat: handled review comments --- grafana/dashboards/cmode/network.json | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index cdccb3611..f790699a1 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -1658,23 +1658,21 @@ { "datasource": "${DS_PROMETHEUS}", "gridPos": { - "h": 1, + "h": 2, "w": 24, "x": 0, "y": 23 }, "id": 117, "options": { - "content": "", + "content": "This panel requires ONTAP 9.6+ and the APIs are only available via REST. Enable the REST collector in your `harvest.yml` config.
\nSee https://github.com/NetApp/harvest/wiki/Troubleshooting-Harvest#why-do-i-have-fc-ports-with-fabric-detail-table-empty-in-network-dashboard\nfor more details.", "mode": "markdown" }, "pluginVersion": "8.1.8", - "title": "FC ports with Fabric detail panel needs a cluster running ONTAP 9.6+, along with the Harvest REST collector.", "type": "text" }, { "datasource": "${DS_PROMETHEUS}", - "description": "This panel requires a cluster with ONTAP 9.6+ and the Harvest REST collector", "fieldConfig": { "defaults": { "custom": { @@ -1769,7 +1767,7 @@ "h": 11, "w": 24, "x": 0, - "y": 24 + "y": 25 }, "id": 115, "interval": "", @@ -1938,7 +1936,7 @@ "h": 10, "w": 12, "x": 0, - "y": 35 + "y": 36 }, "id": 67, "options": { @@ -2031,7 +2029,7 @@ "h": 10, "w": 12, "x": 12, - "y": 35 + "y": 36 }, "id": 69, "options": { @@ -2123,7 +2121,7 @@ "h": 10, "w": 12, "x": 0, - "y": 45 + "y": 46 }, "id": 77, "options": { @@ -2216,7 +2214,7 @@ "h": 10, "w": 12, "x": 12, - "y": 45 + "y": 46 }, "id": 78, "options": { @@ -2309,7 +2307,7 @@ "h": 10, "w": 6, "x": 0, - "y": 55 + "y": 56 }, "id": 75, "options": { @@ -2429,7 +2427,7 @@ "h": 10, "w": 6, "x": 6, - "y": 55 + "y": 56 }, "id": 76, "options": { @@ -2555,7 +2553,7 @@ "h": 10, "w": 6, "x": 12, - "y": 55 + "y": 56 }, "id": 73, "options": { @@ -2647,7 +2645,7 @@ "h": 10, "w": 6, "x": 18, - "y": 55 + "y": 56 }, "id": 74, "options": {