diff --git a/conf/rest/9.7.0/nfs_clients.yaml b/conf/rest/9.7.0/nfs_clients.yaml new file mode 100644 index 000000000..040af9ea3 --- /dev/null +++ b/conf/rest/9.7.0/nfs_clients.yaml @@ -0,0 +1,15 @@ +name: NFSClients +query: api/protocols/nfs/connected-clients +object: nfs_clients + +counters: + - ^^svm.name => svm + - ^^volume.name => volume + - ^^node.name => node + - ^^client_ip => client_ip + - ^^server_ip => server_ip + - ^^protocol => protocol + - idle_duration(duration) => idle_duration #in seconds + +export_options: + include_all_labels: true diff --git a/conf/rest/default.yaml b/conf/rest/default.yaml index fb6f22c13..08fa9f71d 100644 --- a/conf/rest/default.yaml +++ b/conf/rest/default.yaml @@ -15,6 +15,7 @@ objects: # Lun: lun.yaml # NetConnections: netConnections.yaml # NetPort: netPort.yaml +# NFSClients: nfs_clients.yaml # Node: node.yaml # NtpServer: ntpserver.yaml # OntapS3: ontap_s3.yaml diff --git a/grafana/dashboards/cmode/harvest_dashboard_nfs_clients.json b/grafana/dashboards/cmode/harvest_dashboard_nfs_clients.json new file mode 100644 index 000000000..4b46c17f2 --- /dev/null +++ b/grafana/dashboards/cmode/harvest_dashboard_nfs_clients.json @@ -0,0 +1,557 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "Prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "8.1.8" + }, + { + "type": "panel", + "id": "piechart", + "name": "Pie chart", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "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", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "iteration": 1663687807217, + "links": [ + { + "asDropdown": true, + "icon": "external link", + "includeVars": true, + "keepTime": true, + "tags": [ + "cdot" + ], + "targetBlank": false, + "title": "Related Dashboards", + "tooltip": "", + "type": "dashboards", + "url": "" + } + ], + "panels": [ + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel requires a cluster with ONTAP 9.7+ and the Harvest REST collector", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "blue", + "value": null + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 23, + "options": { + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\"})", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total NFS Connections", + "type": "stat" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel requires a cluster with ONTAP 9.7+ and the Harvest REST collector", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "decimals": 0, + "mappings": [] + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Volumes protected" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Volumes not protected" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "yellow", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 27, + "options": { + "legend": { + "displayMode": "hidden", + "placement": "right", + "values": [ + "value" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "last" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single" + } + }, + "pluginVersion": "8.1.2", + "targets": [ + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",protocol=\"nfs\"})", + "instant": true, + "interval": "", + "legendFormat": "nfs", + "refId": "A" + }, + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",protocol=\"nfs3\"})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "nfs3", + "refId": "B" + }, + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",protocol=\"nfs4\"})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "nfs4", + "refId": "C" + }, + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",protocol=\"nfs4.1\"})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "nfs4.1", + "refId": "D" + }, + { + "exemplar": true, + "expr": "count(nfs_clients_idle_duration{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",protocol=\"nfs4.2\"})", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "nfs4.2", + "refId": "E" + } + ], + "title": "NFS Connections by Protocol", + "transformations": [], + "type": "piechart" + }, + { + "datasource": "${DS_PROMETHEUS}", + "description": "This panel requires a cluster with ONTAP 9.7+ and the Harvest REST collector", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "filterable": true + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Last Access" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 21, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 25, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Last Access" + } + ] + }, + "pluginVersion": "8.1.8", + "targets": [ + { + "datasource": "${DS_PROMETHEUS}", + "exemplar": false, + "expr": "nfs_clients_idle_duration{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\"}", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "title": "NFS Clients (active in the past 48 hours)", + "transformations": [ + { + "id": "filterFieldsByName", + "options": { + "include": { + "names": [ + "client_ip", + "cluster", + "datacenter", + "protocol", + "server_ip", + "svm", + "volume", + "Value" + ] + } + } + }, + { + "id": "organize", + "options": { + "excludeByName": {}, + "indexByName": { + "Time": 9, + "Value": 4, + "client_ip": 3, + "cluster": 1, + "datacenter": 0, + "node": 2, + "protocol": 6, + "server_ip": 7, + "svm": 5, + "volume": 8 + }, + "renameByName": { + "Value": "Last Access", + "client_ip": "Client IP Address", + "cluster": "", + "protocol": "NFS version", + "server_ip": "Data Network Interface", + "svm": "Storage VM" + } + } + } + ], + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 30, + "style": "dark", + "tags": [ + "harvest", + "ontap", + "cdot" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "description": null, + "error": null, + "hide": 2, + "includeAll": false, + "label": "Data Source", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(volume_labels{system_type!=\"7mode\"}, datacenter)", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "Datacenter", + "options": [], + "query": { + "query": "label_values(volume_labels{system_type!=\"7mode\"}, datacenter)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(volume_labels{system_type!=\"7mode\",datacenter=\"$Datacenter\"}, cluster)", + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "Cluster", + "options": [], + "query": { + "query": "label_values(volume_labels{system_type!=\"7mode\",datacenter=\"$Datacenter\"}, cluster)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(volume_labels{datacenter=\"$Datacenter\",cluster=\"$Cluster\"}, svm)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "SVM", + "options": [], + "query": { + "query": "label_values(volume_labels{datacenter=\"$Datacenter\",cluster=\"$Cluster\"}, svm)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "definition": "label_values(volume_labels{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\"}, volume)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": null, + "multi": false, + "name": "Volume", + "options": [], + "query": { + "query": "label_values(volume_labels{datacenter=\"$Datacenter\",cluster=\"$Cluster\",svm=~\"$SVM\"}, volume)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "ONTAP: NFS Clients", + "uid": "qTynJ4mVk", + "version": 1 +} \ No newline at end of file diff --git a/integration/test/dashboard_test.go b/integration/test/dashboard_test.go index 52efa7888..c473e18e0 100644 --- a/integration/test/dashboard_test.go +++ b/integration/test/dashboard_test.go @@ -79,6 +79,7 @@ func (suite *DashboardImportTestSuite) TestCModeDashboardCount() { "ONTAP: LUN", "ONTAP: Network", "ONTAP: Network with NVMe/FC", + "ONTAP: NFS Clients", "ONTAP: Node", "ONTAP: Shelf", "ONTAP: SnapMirror", diff --git a/integration/test/data/counter_data.go b/integration/test/data/counter_data.go index 923eb85ce..81436259a 100644 --- a/integration/test/data/counter_data.go +++ b/integration/test/data/counter_data.go @@ -52,6 +52,7 @@ func GetCounterMap() map[string][]string { "security_login", "qtree_disk_used_pct_disk_limit", "qtree_files_used_pct_file_limit", + "nfs_clients_idle_duration", ) return counterMap }