From 2fe9a65d768f9c9d8c905bb2146ee59a86bb433e Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 23 Oct 2024 15:30:06 +0530 Subject: [PATCH 1/6] feat: Adding Ethernet port table from netport template --- grafana/dashboards/cmode/network.json | 337 +++++++++++++++++++++++++- 1 file changed, 327 insertions(+), 10 deletions(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index bcfba1693..57a80bf97 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -565,6 +565,323 @@ { "datasource": "${DS_PROMETHEUS}", "description": "Ethernet port details.", + "fieldConfig": { + "defaults": { + "custom": { + "align": "left", + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgb(80, 220, 20)", + "value": null + }, + { + "color": "light-yellow", + "value": 1000000 + }, + { + "color": "semi-dark-orange", + "value": 10000000 + }, + { + "color": "semi-dark-red", + "value": 100000000 + } + ] + }, + "unit": "Bps", + "unitScale": true + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "MTU" + }, + "properties": [ + { + "id": "unit", + "value": "bps" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "port" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + }, + { + "id": "displayName", + "value": "Port" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "node" + }, + "properties": [ + { + "id": "displayName", + "value": "Node" + }, + { + "id": "custom.width", + "value": 184 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-node/ontap-node?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Node=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "datacenter" + }, + "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-datacenter/ontap-datacenter?orgId=1&${__url_time_range}&var-Datacenter=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "cluster" + }, + "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-cluster/ontap-cluster?orgId=1&${Datacenter:queryparam}&${__url_time_range}&var-Cluster=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Link Speed" + }, + "properties": [ + { + "id": "unit", + "value": "bps" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-background" + } + }, + { + "id": "mappings", + "value": [ + { + "options": { + "degraded": { + "color": "red", + "index": 2, + "text": "degraded" + }, + "down": { + "color": "red", + "index": 1, + "text": "down" + }, + "up ": { + "color": "green", + "index": 0, + "text": "up" + } + }, + "type": "value" + } + ] + } + ] + } + ] + }, + "gridPos": { + "h": 11, + "w": 24, + "x": 0, + "y": 2 + }, + "id": 59, + "interval": "", + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Status" + } + ] + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "expr": "net_port_status{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$Eth\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "datasource": "${DS_PROMETHEUS}", + "editorMode": "code", + "exemplar": false, + "expr": "net_port_mtu{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",port=~\"$Eth\"}", + "format": "table", + "hide": false, + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "B" + } + ], + "title": "Ethernet ports", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "admin_speed", + "cluster", + "datacenter", + "ipspace", + "node", + "op_speed", + "port", + "port_type", + "role", + "status", + "Value #B" + ] + } + } + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": false, + "__name__": true, + "cluster": false, + "datacenter": false, + "instance": true, + "job": true, + "speed": false, + "state": true + }, + "includeByName": {}, + "indexByName": { + "Value #B": 4, + "admin_speed": 6, + "cluster": 1, + "datacenter": 0, + "ipspace": 7, + "node": 2, + "op_speed": 5, + "port": 3, + "port_type": 8, + "role": 9, + "status": 10 + }, + "renameByName": { + "Value #B": "MTU", + "admin_duplex": "", + "admin_speed": "Admin Speed", + "admin_up": "", + "cluster": "", + "datacenter": "", + "ipspace": "IPspace", + "node": "", + "op_speed": "Link Speed", + "port": "", + "port_type": "Port Type", + "role": "Role", + "status": "Status" + } + } + } + ], + "type": "table" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "NIC port details.", "fieldConfig": { "defaults": { "custom": { @@ -857,7 +1174,7 @@ "h": 11, "w": 24, "x": 0, - "y": 2 + "y": 13 }, "id": 58, "interval": "", @@ -920,7 +1237,7 @@ ], "timeFrom": null, "timeShift": null, - "title": "Ethernet ports", + "title": "NIC ports", "transformations": [ { "id": "filterFieldsByName", @@ -1039,7 +1356,7 @@ "h": 10, "w": 12, "x": 0, - "y": 13 + "y": 24 }, "id": 12, "options": { @@ -1132,7 +1449,7 @@ "h": 10, "w": 12, "x": 12, - "y": 13 + "y": 24 }, "id": 28, "options": { @@ -1226,7 +1543,7 @@ "h": 8, "w": 8, "x": 0, - "y": 23 + "y": 34 }, "id": 61, "options": { @@ -1318,7 +1635,7 @@ "h": 8, "w": 8, "x": 8, - "y": 23 + "y": 34 }, "id": 29, "options": { @@ -1415,7 +1732,7 @@ "h": 8, "w": 8, "x": 16, - "y": 23 + "y": 34 }, "id": 30, "options": { @@ -1670,7 +1987,7 @@ "h": 9, "w": 24, "x": 0, - "y": 31 + "y": 42 }, "id": 119, "options": { @@ -1983,7 +2300,7 @@ } ] }, - "pluginVersion": "10.3.1", + "pluginVersion": "8.1.8", "targets": [ { "editorMode": "code", @@ -4814,5 +5131,5 @@ "timezone": "", "title": "ONTAP: Network", "uid": "cdot-network", - "version": 11 + "version": 12 } From fec3c4a5add7f774a0fe04f07f3e14748c7b663d Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 23 Oct 2024 15:32:40 +0530 Subject: [PATCH 2/6] feat: Adding Ethernet port table from netport template --- conf/rest/default.yaml | 2 +- conf/zapi/default.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/rest/default.yaml b/conf/rest/default.yaml index d1ab7f59e..6e1791c48 100644 --- a/conf/rest/default.yaml +++ b/conf/rest/default.yaml @@ -29,7 +29,7 @@ objects: Namespace: namespace.yaml # NDMPSession: ndmp_session.yaml # NetConnections: netconnections.yaml -# NetPort: netport.yaml + NetPort: netport.yaml NetRoute: netroute.yaml # NFSClients: nfs_clients.yaml Node: node.yaml diff --git a/conf/zapi/default.yaml b/conf/zapi/default.yaml index 86e87dd7d..ada1502ae 100644 --- a/conf/zapi/default.yaml +++ b/conf/zapi/default.yaml @@ -19,7 +19,7 @@ objects: LIF: lif.yaml # Lock: lock.yaml Lun: lun.yaml -# NetPort: netport.yaml + NetPort: netport.yaml Namespace: namespace.yaml Node: node.yaml NtpServer: ntpserver.yaml From 2a51f4107435230749ba59764a7cc85fb7eac57a Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 23 Oct 2024 17:19:50 +0530 Subject: [PATCH 3/6] feat: handling comments --- grafana/dashboards/cmode/network.json | 88 ++++++++++++++++++--------- 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index 57a80bf97..e39d1c769 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -848,16 +848,16 @@ "includeByName": {}, "indexByName": { "Value #B": 4, - "admin_speed": 6, + "admin_speed": 7, "cluster": 1, "datacenter": 0, - "ipspace": 7, + "ipspace": 8, "node": 2, "op_speed": 5, "port": 3, - "port_type": 8, - "role": 9, - "status": 10 + "port_type": 9, + "role": 10, + "status": 6 }, "renameByName": { "Value #B": "MTU", @@ -886,8 +886,11 @@ "defaults": { "custom": { "align": "left", - "displayMode": "auto", - "filterable": true + "cellOptions": { + "type": "auto" + }, + "filterable": true, + "inspect": false }, "decimals": 2, "mappings": [], @@ -912,13 +915,14 @@ } ] }, - "unit": "Bps" + "unit": "Bps", + "unitScale": true }, "overrides": [ { "matcher": { "id": "byName", - "options": "speed" + "options": "Speed" }, "properties": [ { @@ -942,12 +946,15 @@ "value": "percentunit" }, { - "id": "custom.displayMode", - "value": "gradient-gauge" + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge" + } }, { "id": "displayName", - "value": "used %" + "value": "Used %" }, { "id": "noValue", @@ -1037,8 +1044,11 @@ } }, { - "id": "custom.displayMode", - "value": "color-background" + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } } ] }, @@ -1083,7 +1093,7 @@ { "matcher": { "id": "byName", - "options": "type" + "options": "Type" }, "properties": [ { @@ -1100,11 +1110,14 @@ "properties": [ { "id": "displayName", - "value": "send" + "value": "Send" }, { - "id": "custom.displayMode", - "value": "gradient-gauge" + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge" + } } ] }, @@ -1116,11 +1129,14 @@ "properties": [ { "id": "displayName", - "value": "receive" + "value": "Receive" }, { - "id": "custom.displayMode", - "value": "gradient-gauge" + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "gauge" + } } ] }, @@ -1179,17 +1195,27 @@ "id": 58, "interval": "", "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, "showHeader": true, "sortBy": [ { - "desc": true, - "displayName": "send" + "desc": false, + "displayName": "status" } ] }, "pluginVersion": "8.1.8", "targets": [ { + "datasource": "${DS_PROMETHEUS}", "exemplar": false, "expr": "nic_labels{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",nic=~\"$Eth\"}", "format": "table", @@ -1199,6 +1225,7 @@ "refId": "A" }, { + "datasource": "${DS_PROMETHEUS}", "expr": "nic_new_status{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",nic=~\"$Eth\"}", "format": "table", "hide": false, @@ -1208,6 +1235,7 @@ "refId": "B" }, { + "datasource": "${DS_PROMETHEUS}", "expr": "nic_util_percent{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",nic=~\"$Eth\"}", "format": "table", "hide": false, @@ -1217,6 +1245,7 @@ "refId": "C" }, { + "datasource": "${DS_PROMETHEUS}", "expr": "nic_tx_bytes{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",nic=~\"$Eth\"}", "format": "table", "hide": false, @@ -1226,6 +1255,7 @@ "refId": "D" }, { + "datasource": "${DS_PROMETHEUS}", "expr": "nic_rx_bytes{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",node=~\"$Node\",nic=~\"$Eth\"}", "format": "table", "hide": false, @@ -1235,8 +1265,6 @@ "refId": "E" } ], - "timeFrom": null, - "timeShift": null, "title": "NIC ports", "transformations": [ { @@ -1276,6 +1304,7 @@ "speed": false, "state": true }, + "includeByName": {}, "indexByName": { "Value #B": 6, "Value #C": 7, @@ -1283,13 +1312,16 @@ "Value #E": 9, "cluster": 1, "datacenter": 0, - "nic": 2, - "node": 3, + "nic": 3, + "node": 2, "speed": 4, "type": 5 }, "renameByName": { - "datacenter": "" + "datacenter": "", + "nic": "Port", + "speed": "Speed", + "type": "Type" } } } From ffe35d1c81194a6bc5418640239093dbad97350e Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 23 Oct 2024 17:24:39 +0530 Subject: [PATCH 4/6] feat: handling comments --- cmd/tools/generate/counter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/tools/generate/counter.go b/cmd/tools/generate/counter.go index ffc86354b..02906212b 100644 --- a/cmd/tools/generate/counter.go +++ b/cmd/tools/generate/counter.go @@ -145,7 +145,8 @@ var ( "aggr_hybrid_disk_count", "nfs_clients_idle_duration", "ems_events", - "olume_top_clients", + "volume_top_clients", + "net_port_status", } excludeDocumentedZapiMetrics = []string{ @@ -154,6 +155,7 @@ var ( "netstat_", "flexcache_", "quota_disk_used_pct_threshold", + "net_port_status", } // Exclude extra metrics for REST From 5b0a062337342036000ba2430d77f264c07dd130 Mon Sep 17 00:00:00 2001 From: hardikl Date: Wed, 23 Oct 2024 20:38:14 +0530 Subject: [PATCH 5/6] feat: minor changes --- cmd/tools/generate/counter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/tools/generate/counter.go b/cmd/tools/generate/counter.go index 02906212b..cd28b24b9 100644 --- a/cmd/tools/generate/counter.go +++ b/cmd/tools/generate/counter.go @@ -146,7 +146,6 @@ var ( "nfs_clients_idle_duration", "ems_events", "volume_top_clients", - "net_port_status", } excludeDocumentedZapiMetrics = []string{ @@ -155,7 +154,6 @@ var ( "netstat_", "flexcache_", "quota_disk_used_pct_threshold", - "net_port_status", } // Exclude extra metrics for REST @@ -165,6 +163,7 @@ var ( "_labels", "volume_arw_status", "ALERTS", + "net_port_status", } // Exclude extra metrics for ZAPI @@ -174,6 +173,7 @@ var ( "security_", "svm_ldap", "ALERTS", + "net_port_status", } ) From 057d267ca57cd30f98d77699ef395ae34ed76f7e Mon Sep 17 00:00:00 2001 From: rahulguptajss Date: Thu, 24 Oct 2024 16:46:50 +0530 Subject: [PATCH 6/6] feat: add netport metric doc --- cmd/tools/generate/counter.go | 2 -- cmd/tools/generate/counter.yaml | 12 ++++++++++++ docs/ontap-metrics.md | 12 +++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cmd/tools/generate/counter.go b/cmd/tools/generate/counter.go index 20d070898..e8f1cb3cd 100644 --- a/cmd/tools/generate/counter.go +++ b/cmd/tools/generate/counter.go @@ -163,7 +163,6 @@ var ( "_labels", "volume_arw_status", "ALERTS", - "net_port_status", } // Exclude extra metrics for ZAPI @@ -173,7 +172,6 @@ var ( "security_", "svm_ldap", "ALERTS", - "net_port_status", } ) diff --git a/cmd/tools/generate/counter.yaml b/cmd/tools/generate/counter.yaml index 753469fb9..1576d0498 100644 --- a/cmd/tools/generate/counter.yaml +++ b/cmd/tools/generate/counter.yaml @@ -1927,3 +1927,15 @@ counters: Endpoint: api/support/ems/events ONTAPCounter: Harvest generated Template: conf/ems/9.6.0/ems.yaml + + - Name: net_port_status + Description: This metric indicates a value of 1 if the port state is up and a value of 0 for any other state. + APIs: + - API: REST + Endpoint: NA + ONTAPCounter: Harvest generated + Template: conf/rest/9.12.0/netport.yaml + - API: ZAPI + Endpoint: NA + ONTAPCounter: Harvest generated + Template: conf/zapi/cdot/9.8.0/netport.yaml \ No newline at end of file diff --git a/docs/ontap-metrics.md b/docs/ontap-metrics.md index 30120af3d..b84092e80 100644 --- a/docs/ontap-metrics.md +++ b/docs/ontap-metrics.md @@ -7,7 +7,7 @@ These can be generated on demand by running `bin/harvest grafana metrics`. See - More information about ONTAP REST performance counters can be found [here](https://docs.netapp.com/us-en/ontap-pcmap-9121/index.html). ``` -Creation Date : 2024-Oct-23 +Creation Date : 2024-Oct-24 ONTAP Version: 9.15.1 ``` ## Understanding the structure @@ -4046,6 +4046,16 @@ Maximum transmission unit, largest packet size on this network | ZAPI | `net-port-get-iter` | `net-port-info.mtu` | conf/zapi/cdot/9.8.0/netport.yaml | +### net_port_status + +This metric indicates a value of 1 if the port state is up and a value of 0 for any other state. + +| API | Endpoint | Metric | Template | +|--------|----------|--------|---------| +| REST | `NA` | `Harvest generated` | conf/rest/9.12.0/netport.yaml | +| ZAPI | `NA` | `Harvest generated` | conf/zapi/cdot/9.8.0/netport.yaml | + + ### netstat_bytes_recvd Number of bytes received by a TCP connection