diff --git a/cmd/tools/grafana/dashboard_test.go b/cmd/tools/grafana/dashboard_test.go index efa2e8799..5933e6f03 100644 --- a/cmd/tools/grafana/dashboard_test.go +++ b/cmd/tools/grafana/dashboard_test.go @@ -762,7 +762,7 @@ func TestIDIsBlank(t *testing.T) { VisitDashboards( dashboards, func(path string, data []byte) { - checkUIDIsBlank(t, path, data) + checkUIDNotEmpty(t, path, data) checkIDIsNull(t, path, data) }) } @@ -781,19 +781,11 @@ func checkExemplarIsFalse(t *testing.T, path string, data []byte) { } } -var uidExceptions = map[string]bool{ - "cmode-details/volumeBySVM.json": true, - "cmode-details/volumeDeepDive.json": true, -} - -func checkUIDIsBlank(t *testing.T, path string, data []byte) { +func checkUIDNotEmpty(t *testing.T, path string, data []byte) { path = ShortPath(path) - if uidExceptions[path] { - return - } uid := gjson.GetBytes(data, "uid").String() - if uid != "" { - t.Errorf(`dashboard=%s uid should be "" but is %s`, path, uid) + if uid == "" { + t.Errorf(`dashboard=%s uid is "", but should not be empty`, path) } } @@ -1626,17 +1618,17 @@ func checkVariablesAreFSxFriendly(t *testing.T, path string, data []byte) { } var linkPath = regexp.MustCompile(`/d/(.*?)/`) +var supportedLinkedObjects = []string{"cluster", "datacenter", "aggr", "svm", "volume", "node", "home_node"} func TestLinks(t *testing.T) { hasLinks := map[string][]string{} uids := map[string]string{} VisitDashboards(dashboards, func(path string, data []byte) { - checkLinks(path, data, hasLinks, uids) + checkLinks(t, path, data, hasLinks, uids) }) // Check that the links are valid URLs and that the link points to an existing dashboard - for path, list := range hasLinks { hasOrgID := false for _, link := range list { @@ -1692,31 +1684,43 @@ func TestLinks(t *testing.T) { } } -func checkLinks(path string, data []byte, hasLinks map[string][]string, uids map[string]string) { +func checkLinks(t *testing.T, path string, data []byte, hasLinks map[string][]string, uids map[string]string) { dashPath := ShortPath(path) VisitAllPanels(data, func(_ string, _, value gjson.Result) { - checkPanelLinks(value, dashPath, hasLinks) + checkPanelLinks(t, value, dashPath, hasLinks) }) uid := gjson.GetBytes(data, "uid").String() - if uid != "" { - uids[uid] = dashPath - } + uids[uid] = dashPath } -func checkPanelLinks(value gjson.Result, path string, hasLinks map[string][]string) { - value.Get("fieldConfig.overrides").ForEach(func(_, anOverride gjson.Result) bool { - anOverride.Get("properties").ForEach(func(_, propValue gjson.Result) bool { - propValue.Get("value").ForEach(func(_, value gjson.Result) bool { - link := value.Get("url").String() - if link != "" { - hasLinks[path] = append(hasLinks[path], link) +func checkPanelLinks(t *testing.T, value gjson.Result, path string, hasLinks map[string][]string) { + linkFound := false + + // Testing only for volume/aggregate/svm for now, it will be covered for all later + supportedDashboards := []string{"cmode/volume.json", "cmode/aggregate.json", "cmode/svm.json"} + + if slices.Contains(supportedDashboards, path) && value.Get("type").String() == "table" { + value.Get("fieldConfig.overrides").ForEach(func(_, anOverride gjson.Result) bool { + if name := anOverride.Get("matcher.options").String(); slices.Contains(supportedLinkedObjects, name) { + linkFound = false + anOverride.Get("properties").ForEach(func(_, propValue gjson.Result) bool { + propValue.Get("value").ForEach(func(_, value gjson.Result) bool { + link := value.Get("url").String() + if link != "" { + linkFound = true + hasLinks[path] = append(hasLinks[path], link) + } + return true + }) + return true + }) + if !linkFound { + t.Errorf(`dashboard=%s panel="%s" column=%s is missing the links`, path, value.Get("title").String(), name) } - return true - }) + } return true }) - return true - }) + } } diff --git a/cmd/tools/grafana/grafana.go b/cmd/tools/grafana/grafana.go index 86d2cf59c..45925bd15 100644 --- a/cmd/tools/grafana/grafana.go +++ b/cmd/tools/grafana/grafana.go @@ -10,7 +10,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/netapp/harvest/v2/cmd/harvest/version" "github.com/netapp/harvest/v2/pkg/conf" "github.com/netapp/harvest/v2/pkg/requests" "github.com/netapp/harvest/v2/pkg/util" @@ -39,7 +38,6 @@ const ( var ( grafanaMinVers = "7.1.0" // lowest grafana version we require homePath string - harvestRelease = version.VERSION ) type options struct { @@ -422,10 +420,10 @@ func initImportVars() { // default behaviour switch { case opts.dir == "grafana/dashboards" && opts.serverfolder.name == "": - m[filepath.Join(opts.dir, "cmode")] = &Folder{name: "Harvest-" + harvestRelease + "-cDOT"} - m[filepath.Join(opts.dir, "cmode-details")] = &Folder{name: "Harvest-" + harvestRelease + "-cDOT Details"} - m[filepath.Join(opts.dir, "7mode")] = &Folder{name: "Harvest-" + harvestRelease + "-7mode"} - m[filepath.Join(opts.dir, "storagegrid")] = &Folder{name: "Harvest-" + harvestRelease + "-StorageGrid"} + m[filepath.Join(opts.dir, "cmode")] = &Folder{name: "Harvest-main-cDOT"} + m[filepath.Join(opts.dir, "cmode", "details")] = &Folder{name: "Harvest-main-cDOT Details"} + m[filepath.Join(opts.dir, "7mode")] = &Folder{name: "Harvest-main-7mode"} + m[filepath.Join(opts.dir, "storagegrid")] = &Folder{name: "Harvest-main-StorageGrid"} case opts.dir != "" && opts.serverfolder.name != "": m[opts.dir] = &Folder{name: opts.serverfolder.name} case opts.dir != "" && opts.customizeDir != "": @@ -475,6 +473,12 @@ func exitIfExist(fp string, s string) { } func importDashboards(opts *options) { + if opts.overwrite { + fmt.Printf("warning: The overwrite flag is no longer used and will be removed in a future release. Please remove this flag from your command line invocation. When importing, dashboards are always overwritten.\n") + } + // Set overwrite flag to true, dashboards are always overwritten. + opts.overwrite = true + for k, v := range opts.dirGrafanaFolderMap { importFiles(k, v) } @@ -507,37 +511,6 @@ func importFiles(dir string, folder *Folder) { data = bytes.ReplaceAll(data, []byte("${DS_PROMETHEUS}"), []byte(opts.datasource)) - // If the dashboard has an uid defined, change the uid to the empty string, unless overwrite is true. - // We do comparison for dashboard create/update based on title - if !opts.overwrite { - - // Don't change the uid of linked dashboards since that will break the links - isLinkedDashboard := file.Name() == "volumeBySVM.json" || file.Name() == "volumeDeepDive.json" - - if !isLinkedDashboard { - dashboardID := gjson.GetBytes(data, "uid").String() - if dashboardID != "" { - data, err = sjson.SetBytes(data, "uid", []byte("")) - if err != nil { - fmt.Printf("error while updating the uid %s into dashboard %s, err: %+v", dashboardID, file.Name(), err) - continue - } - } - } - } - - // If the dashboard has an id defined, change the id to empty string, unless overwrite was passed, - // so Grafana treats this as a new dashboard instead of an update to an existing one - if !opts.overwrite { - if dashboardID := gjson.GetBytes(data, "id").String(); dashboardID != "" { - data, err = sjson.SetBytes(data, "id", []byte("")) - if err != nil { - fmt.Printf("error while updating the id %s into dashboard %s, err: %+v", dashboardID, file.Name(), err) - continue - } - } - } - // add svm regex if opts.svmRegex != "" { data = addSvmRegex(data, file.Name(), opts.svmRegex) diff --git a/grafana/dashboards/cmode-details/volumeBySVM.json b/grafana/dashboards/cmode-details/volumeBySVM.json index 95060e638..c12cb1910 100644 --- a/grafana/dashboards/cmode-details/volumeBySVM.json +++ b/grafana/dashboards/cmode-details/volumeBySVM.json @@ -134,7 +134,7 @@ { "targetBlank": true, "title": "Drill Down", - "url": "/d/IkXhW11Iz/ontap-volume-deep-dive?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + "url": "/d/cdot-volume-deep-dive/ontap-volume-deep-dive?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" } ] } @@ -478,6 +478,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: Volume by SVM", - "uid": "bb326bd1", + "uid": "cdot-volume-by-svm", "version": 1 } diff --git a/grafana/dashboards/cmode-details/volumeDeepDive.json b/grafana/dashboards/cmode-details/volumeDeepDive.json index 1c209a9ea..f7366e82f 100644 --- a/grafana/dashboards/cmode-details/volumeDeepDive.json +++ b/grafana/dashboards/cmode-details/volumeDeepDive.json @@ -3586,6 +3586,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: Volume Deep Dive", - "uid": "IkXhW11Iz", + "uid": "cdot-volume-deep-dive", "version": 2 } diff --git a/grafana/dashboards/cmode/aggregate.json b/grafana/dashboards/cmode/aggregate.json index 577590f88..7d37789d8 100644 --- a/grafana/dashboards/cmode/aggregate.json +++ b/grafana/dashboards/cmode/aggregate.json @@ -734,36 +734,104 @@ { "matcher": { "id": "byName", - "options": "Datacenter" + "options": "datacenter" }, "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, { "id": "custom.width", "value": 114 + }, + { + "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": "Node" + "options": "node" }, "properties": [ + { + "id": "displayName", + "value": "Node" + }, { "id": "custom.width", "value": 126 + }, + { + "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": "Cluster" + "options": "cluster" }, "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, { "id": "custom.width", "value": 121 + }, + { + "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": "aggr" + }, + "properties": [ + { + "id": "displayName", + "value": "Aggregate" + }, + { + "id": "custom.width", + "value": 260 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-aggregate/ontap-aggregate?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Aggregate=${__value.raw}" + } + ] } ] }, @@ -1022,11 +1090,7 @@ "Value #E": "Used", "Value #F": "Used %", "Value #H": "Available", - "aggr": "Aggregate", - "cluster": "Cluster", - "datacenter": "Datacenter", - "is_encrypted": "Encrypted", - "node": "Node" + "is_encrypted": "Encrypted" } } } @@ -3237,6 +3301,16 @@ { "id": "custom.width", "value": 300 + }, + { + "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}" + } + ] } ] }, @@ -3253,6 +3327,16 @@ { "id": "custom.width", "value": 300 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-aggregate/ontap-aggregate?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Aggregate=${__value.raw}" + } + ] } ] } @@ -6119,6 +6203,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: Aggregate", - "uid": "", + "uid": "cdot-aggregate", "version": 11 } diff --git a/grafana/dashboards/cmode/cdot.json b/grafana/dashboards/cmode/cdot.json index 23ca411b3..4ea74dec9 100644 --- a/grafana/dashboards/cmode/cdot.json +++ b/grafana/dashboards/cmode/cdot.json @@ -2192,6 +2192,6 @@ }, "timezone": "", "title": "ONTAP: cDOT", - "uid": "", + "uid": "cdot-cdot", "version": 4 } diff --git a/grafana/dashboards/cmode/changelogMonitor.json b/grafana/dashboards/cmode/changelogMonitor.json index 7ce85466e..a25213df6 100644 --- a/grafana/dashboards/cmode/changelogMonitor.json +++ b/grafana/dashboards/cmode/changelogMonitor.json @@ -1285,6 +1285,6 @@ }, "timezone": "", "title": "ONTAP: Changelog Monitor", - "uid": "", + "uid": "cdot-changelog-monitor", "version": 1 } diff --git a/grafana/dashboards/cmode/cluster.json b/grafana/dashboards/cmode/cluster.json index c0be9d1c0..ccd6f70a3 100644 --- a/grafana/dashboards/cmode/cluster.json +++ b/grafana/dashboards/cmode/cluster.json @@ -4449,6 +4449,6 @@ }, "timezone": "", "title": "ONTAP: Cluster", - "uid": "", + "uid": "cdot-cluster", "version": 4 } diff --git a/grafana/dashboards/cmode/compliance.json b/grafana/dashboards/cmode/compliance.json index 0801ee387..837ee583e 100644 --- a/grafana/dashboards/cmode/compliance.json +++ b/grafana/dashboards/cmode/compliance.json @@ -154,6 +154,6 @@ }, "timezone": "", "title": "ONTAP: Compliance", - "uid": "", + "uid": "cdot-compliance", "version": 3 } diff --git a/grafana/dashboards/cmode/data_protection_snapshot.json b/grafana/dashboards/cmode/data_protection_snapshot.json index 70d08496f..3c67ec8cf 100644 --- a/grafana/dashboards/cmode/data_protection_snapshot.json +++ b/grafana/dashboards/cmode/data_protection_snapshot.json @@ -1602,6 +1602,6 @@ }, "timezone": "", "title": "ONTAP: Data Protection Snapshots", - "uid": "", + "uid": "cdot-data-protection-snapshots", "version": 2 } diff --git a/grafana/dashboards/cmode/datacenter.json b/grafana/dashboards/cmode/datacenter.json index 70d952245..bed70e232 100644 --- a/grafana/dashboards/cmode/datacenter.json +++ b/grafana/dashboards/cmode/datacenter.json @@ -4002,6 +4002,6 @@ }, "timezone": "", "title": "ONTAP: Datacenter", - "uid": "", + "uid": "cdot-datacenter", "version": 2 } diff --git a/grafana/dashboards/cmode/disk.json b/grafana/dashboards/cmode/disk.json index 1c848bdd1..f0a0311af 100644 --- a/grafana/dashboards/cmode/disk.json +++ b/grafana/dashboards/cmode/disk.json @@ -3133,6 +3133,6 @@ }, "timezone": "", "title": "ONTAP: Disk", - "uid": "", + "uid": "cdot-disk", "version": 32 } diff --git a/grafana/dashboards/cmode/external_service_op.json b/grafana/dashboards/cmode/external_service_op.json index f2efd35ed..76714920c 100644 --- a/grafana/dashboards/cmode/external_service_op.json +++ b/grafana/dashboards/cmode/external_service_op.json @@ -1061,6 +1061,6 @@ }, "timezone": "", "title": "ONTAP: External Service Operation", - "uid": "", + "uid": "cdot-external-service-operation", "version": 2 } diff --git a/grafana/dashboards/cmode/flexcache.json b/grafana/dashboards/cmode/flexcache.json index 9d9604c10..e628fab57 100644 --- a/grafana/dashboards/cmode/flexcache.json +++ b/grafana/dashboards/cmode/flexcache.json @@ -2105,6 +2105,6 @@ }, "timezone": "", "title": "ONTAP: FlexCache", - "uid": "", + "uid": "cdot-flexcache", "version": 2 } diff --git a/grafana/dashboards/cmode/flexgroup.json b/grafana/dashboards/cmode/flexgroup.json index 14b28a4a6..de65a2011 100644 --- a/grafana/dashboards/cmode/flexgroup.json +++ b/grafana/dashboards/cmode/flexgroup.json @@ -2790,6 +2790,6 @@ }, "timezone": "", "title": "ONTAP: FlexGroup", - "uid": "", + "uid": "cdot-flexgroup", "version": 54 } diff --git a/grafana/dashboards/cmode/fsa.json b/grafana/dashboards/cmode/fsa.json index b3977b957..6f0777dbc 100644 --- a/grafana/dashboards/cmode/fsa.json +++ b/grafana/dashboards/cmode/fsa.json @@ -1666,6 +1666,6 @@ }, "timezone": "", "title": "ONTAP: File System Analytics (FSA)", - "uid": "", + "uid": "cdot-fsa", "version": 5 } diff --git a/grafana/dashboards/cmode/headroom.json b/grafana/dashboards/cmode/headroom.json index f1f69763b..cd51ccebb 100644 --- a/grafana/dashboards/cmode/headroom.json +++ b/grafana/dashboards/cmode/headroom.json @@ -2598,6 +2598,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: Headroom", - "uid": "", + "uid": "cdot-headroom", "version": 8 } diff --git a/grafana/dashboards/cmode/health.json b/grafana/dashboards/cmode/health.json index 5a1c8ccc1..fcd08055a 100644 --- a/grafana/dashboards/cmode/health.json +++ b/grafana/dashboards/cmode/health.json @@ -3572,6 +3572,6 @@ }, "timezone": "", "title": "ONTAP: Health", - "uid": "", + "uid": "cdot-health", "version": 3 } diff --git a/grafana/dashboards/cmode/lun.json b/grafana/dashboards/cmode/lun.json index ed5a7efbe..715833947 100644 --- a/grafana/dashboards/cmode/lun.json +++ b/grafana/dashboards/cmode/lun.json @@ -4835,6 +4835,6 @@ }, "timezone": "", "title": "ONTAP: LUN", - "uid": "", + "uid": "cdot-lun", "version": 10 } diff --git a/grafana/dashboards/cmode/mcc_cluster.json b/grafana/dashboards/cmode/mcc_cluster.json index 43f896036..c13660687 100644 --- a/grafana/dashboards/cmode/mcc_cluster.json +++ b/grafana/dashboards/cmode/mcc_cluster.json @@ -4144,6 +4144,6 @@ }, "timezone": "browser", "title": "ONTAP: MetroCluster", - "uid": "", + "uid": "cdot-metrocluster", "version": 10 } diff --git a/grafana/dashboards/cmode/metadata.json b/grafana/dashboards/cmode/metadata.json index 172f28dee..4d502284a 100644 --- a/grafana/dashboards/cmode/metadata.json +++ b/grafana/dashboards/cmode/metadata.json @@ -3090,6 +3090,6 @@ }, "timezone": "", "title": "Harvest Metadata", - "uid": "", + "uid": "cdot-metadata", "version": 8 } diff --git a/grafana/dashboards/cmode/namespace.json b/grafana/dashboards/cmode/namespace.json index 435354e5c..624fb0217 100644 --- a/grafana/dashboards/cmode/namespace.json +++ b/grafana/dashboards/cmode/namespace.json @@ -1178,6 +1178,6 @@ }, "timezone": "", "title": "ONTAP: NVMe Namespaces", - "uid": "", + "uid": "cdot-nvme-namespaces", "version": 3 } diff --git a/grafana/dashboards/cmode/network.json b/grafana/dashboards/cmode/network.json index 3e8279029..01252baf8 100644 --- a/grafana/dashboards/cmode/network.json +++ b/grafana/dashboards/cmode/network.json @@ -3924,6 +3924,6 @@ }, "timezone": "", "title": "ONTAP: Network", - "uid": "", + "uid": "cdot-network", "version": 9 } diff --git a/grafana/dashboards/cmode/nfs4storePool.json b/grafana/dashboards/cmode/nfs4storePool.json index 3594981f2..fedbea523 100644 --- a/grafana/dashboards/cmode/nfs4storePool.json +++ b/grafana/dashboards/cmode/nfs4storePool.json @@ -2139,6 +2139,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: NFSv4 StorePool Monitors", - "uid": "", + "uid": "cdot-nfsv4-storepool-monitors", "version": 7 } diff --git a/grafana/dashboards/cmode/nfsTroubleshooting.json b/grafana/dashboards/cmode/nfsTroubleshooting.json index 919dd84f9..b4c0b87d6 100644 --- a/grafana/dashboards/cmode/nfsTroubleshooting.json +++ b/grafana/dashboards/cmode/nfsTroubleshooting.json @@ -851,7 +851,7 @@ { "targetBlank": true, "title": "Click for volume view", - "url": "/d/bb326bd1/ontap-vol-by-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + "url": "/d/cdot-volume-by-svm/ontap-vol-by-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" } ] } @@ -1693,6 +1693,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: NFS Troubleshooting", - "uid": "", + "uid": "cdot-nfs-troubleshooting", "version": 1 } diff --git a/grafana/dashboards/cmode/nfs_clients.json b/grafana/dashboards/cmode/nfs_clients.json index 0a6f1e1e2..0a849ed7a 100644 --- a/grafana/dashboards/cmode/nfs_clients.json +++ b/grafana/dashboards/cmode/nfs_clients.json @@ -576,6 +576,6 @@ }, "timezone": "", "title": "ONTAP: NFS Clients", - "uid": "", + "uid": "cdot-nfs-clients", "version": 3 } diff --git a/grafana/dashboards/cmode/node.json b/grafana/dashboards/cmode/node.json index 5456b225c..20f13d19a 100644 --- a/grafana/dashboards/cmode/node.json +++ b/grafana/dashboards/cmode/node.json @@ -5946,6 +5946,6 @@ }, "timezone": "", "title": "ONTAP: Node", - "uid": "", + "uid": "cdot-node", "version": 14 } diff --git a/grafana/dashboards/cmode/power.json b/grafana/dashboards/cmode/power.json index 35dc9b201..93ca42775 100644 --- a/grafana/dashboards/cmode/power.json +++ b/grafana/dashboards/cmode/power.json @@ -3245,6 +3245,6 @@ }, "timezone": "", "title": "ONTAP: Power", - "uid": "", + "uid": "cdot-power", "version": 14 } diff --git a/grafana/dashboards/cmode/qtree.json b/grafana/dashboards/cmode/qtree.json index c2d804745..f40e30e05 100644 --- a/grafana/dashboards/cmode/qtree.json +++ b/grafana/dashboards/cmode/qtree.json @@ -987,6 +987,6 @@ }, "timezone": "", "title": "ONTAP: Qtree", - "uid": "", + "uid": "cdot-qtree", "version": 8 } diff --git a/grafana/dashboards/cmode/quotaReport.json b/grafana/dashboards/cmode/quotaReport.json index 5b9b86118..5d154a559 100644 --- a/grafana/dashboards/cmode/quotaReport.json +++ b/grafana/dashboards/cmode/quotaReport.json @@ -876,6 +876,6 @@ }, "timezone": "", "title": "ONTAP: Quota", - "uid": "", + "uid": "cdot-quota", "version": 4 } diff --git a/grafana/dashboards/cmode/s3ObjectStorage.json b/grafana/dashboards/cmode/s3ObjectStorage.json index c84a51caa..e7b41fadf 100644 --- a/grafana/dashboards/cmode/s3ObjectStorage.json +++ b/grafana/dashboards/cmode/s3ObjectStorage.json @@ -1000,7 +1000,7 @@ }, "timezone": "", "title": "ONTAP: S3 Object Storage", - "uid": "", + "uid": "cdot-s3-object-storage", "version": 1, "weekStart": "" } diff --git a/grafana/dashboards/cmode/security.json b/grafana/dashboards/cmode/security.json index c88778df8..4f9e38452 100644 --- a/grafana/dashboards/cmode/security.json +++ b/grafana/dashboards/cmode/security.json @@ -4667,6 +4667,6 @@ }, "timezone": "", "title": "ONTAP: Security", - "uid": "", + "uid": "cdot-security", "version": 4 } diff --git a/grafana/dashboards/cmode/shelf.json b/grafana/dashboards/cmode/shelf.json index fbe5cec19..1287ef333 100644 --- a/grafana/dashboards/cmode/shelf.json +++ b/grafana/dashboards/cmode/shelf.json @@ -2075,6 +2075,6 @@ }, "timezone": "", "title": "ONTAP: Shelf", - "uid": "", + "uid": "cdot-shelf", "version": 8 } diff --git a/grafana/dashboards/cmode/smb.json b/grafana/dashboards/cmode/smb.json index 50dedeabf..4e2110043 100644 --- a/grafana/dashboards/cmode/smb.json +++ b/grafana/dashboards/cmode/smb.json @@ -1806,6 +1806,6 @@ }, "timezone": "", "title": "ONTAP: SMB", - "uid": "", + "uid": "cdot-smb", "version": 4 } diff --git a/grafana/dashboards/cmode/snapmirror.json b/grafana/dashboards/cmode/snapmirror.json index 214e4b48e..a39c2296a 100644 --- a/grafana/dashboards/cmode/snapmirror.json +++ b/grafana/dashboards/cmode/snapmirror.json @@ -5006,6 +5006,6 @@ }, "timezone": "", "title": "ONTAP: SnapMirror", - "uid": "", + "uid": "cdot-snapmirror", "version": 6 } diff --git a/grafana/dashboards/cmode/svm.json b/grafana/dashboards/cmode/svm.json index d446247da..b8fdac488 100644 --- a/grafana/dashboards/cmode/svm.json +++ b/grafana/dashboards/cmode/svm.json @@ -3270,6 +3270,116 @@ ] } ] + }, + { + "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": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "node" + }, + "properties": [ + { + "id": "displayName", + "value": "Current Node" + }, + { + "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": "home_node" + }, + "properties": [ + { + "id": "displayName", + "value": "Home Node" + }, + { + "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}" + } + ] + } + ] } ] }, @@ -3344,20 +3454,15 @@ }, "renameByName": { "address": "Address", - "cluster": "Cluster", - "datacenter": "Datacenter", - "home_node": "Home Node", "home_port": "Home Port", "ipspace": "IPspace", "is_home": "At Home", "lif": "Name", - "node": "Current Node", "port": "Current Port", "protocols": "Protocols", "services": "Services", "status": "Status", "subnet": "Subnet", - "svm": "SVM", "type": "Type" } } @@ -16227,6 +16332,6 @@ }, "timezone": "", "title": "ONTAP: SVM", - "uid": "", + "uid": "cdot-svm", "version": 26 } diff --git a/grafana/dashboards/cmode/volume.json b/grafana/dashboards/cmode/volume.json index 78ec45d93..dbeb40409 100644 --- a/grafana/dashboards/cmode/volume.json +++ b/grafana/dashboards/cmode/volume.json @@ -768,6 +768,94 @@ "value": "bytes" } ] + }, + { + "matcher": { + "id": "byName", + "options": "node" + }, + "properties": [ + { + "id": "displayName", + "value": "Node" + }, + { + "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": "aggr" + }, + "properties": [ + { + "id": "displayName", + "value": "Aggregate" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-aggregate/ontap-aggregate?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Aggregate=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1050,6 +1138,50 @@ "value": "color-background" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1162,6 +1294,50 @@ "value": "Bps" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1275,6 +1451,50 @@ "value": "iops" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1418,6 +1638,50 @@ "value": "color-background" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1530,6 +1794,50 @@ "value": "Bps" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -1643,6 +1951,50 @@ "value": "iops" } ] + }, + { + "matcher": { + "id": "byName", + "options": "svm" + }, + "properties": [ + { + "id": "displayName", + "value": "SVM" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "volume" + }, + "properties": [ + { + "id": "displayName", + "value": "Volume" + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] + } + ] } ] }, @@ -7639,88 +7991,172 @@ { "matcher": { "id": "byName", - "options": "SVM" + "options": "cluster" }, "properties": [ + { + "id": "displayName", + "value": "Cluster" + }, { "id": "custom.width", - "value": 260 + "value": 280 + }, + { + "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": "Volume" + "options": "Predicted 15th Day Value" }, "properties": [ { "id": "custom.width", - "value": 330 + "value": 220 + }, + { + "id": "custom.displayMode", + "value": "gradient-gauge" } ] }, { "matcher": { "id": "byName", - "options": "Cluster" + "options": "datacenter" }, "properties": [ + { + "id": "displayName", + "value": "Datacenter" + }, { "id": "custom.width", - "value": 280 + "value": 190 + }, + { + "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": "Node" + "options": "node" }, "properties": [ + { + "id": "displayName", + "value": "Node" + }, { "id": "custom.width", "value": 260 + }, + { + "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": "Aggr" + "options": "aggr" }, "properties": [ + { + "id": "displayName", + "value": "Aggregate" + }, { "id": "custom.width", "value": 260 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-aggregate/ontap-aggregate?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-Aggregate=${__value.raw}" + } + ] } ] }, { "matcher": { "id": "byName", - "options": "Predicted 15th Day Value" + "options": "svm" }, "properties": [ + { + "id": "displayName", + "value": "SVM" + }, { "id": "custom.width", - "value": 220 + "value": 260 }, { - "id": "custom.displayMode", - "value": "gradient-gauge" + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-svm/ontap-svm?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${__url_time_range}&var-SVM=${__value.raw}" + } + ] } ] }, { "matcher": { "id": "byName", - "options": "Datacenter" + "options": "volume" }, "properties": [ + { + "id": "displayName", + "value": "Volume" + }, { "id": "custom.width", - "value": 190 + "value": 330 + }, + { + "id": "links", + "value": [ + { + "targetBlank": true, + "title": "", + "url": "/d/cdot-volume/ontap-volume?orgId=1&${Datacenter:queryparam}&${Cluster:queryparam}&${SVM:queryparam}&${__url_time_range}&var-Volume=${__value.raw}" + } + ] } ] } @@ -7829,15 +8265,10 @@ "Value #I": "Physical Space Used", "Value #J": "Clone Split Estimate", "__name__": "", - "aggr": "Aggr", "clone_parent_snapshot": "Clone Parent Snapshot", "clone_parent_svm": "Clone Parent SVM", "clone_parent_volume": "Clone Parent Volume", - "cluster": "Cluster", - "datacenter": "Datacenter", - "junction_path": "Junction Path", - "svm": "SVM", - "volume": "Volume" + "junction_path": "Junction Path" } } } @@ -8102,6 +8533,6 @@ }, "timezone": "", "title": "ONTAP: Volume", - "uid": "", + "uid": "cdot-volume", "version": 21 } diff --git a/grafana/dashboards/cmode/workload.json b/grafana/dashboards/cmode/workload.json index 89836fdd8..4f1441945 100644 --- a/grafana/dashboards/cmode/workload.json +++ b/grafana/dashboards/cmode/workload.json @@ -6560,6 +6560,6 @@ }, "timezone": "", "title": "ONTAP: Workload", - "uid": "", + "uid": "cdot-workload", "version": 9 } diff --git a/grafana/dashboards/storagegrid/fabricpool.json b/grafana/dashboards/storagegrid/fabricpool.json index 398c9c68c..c43500eac 100644 --- a/grafana/dashboards/storagegrid/fabricpool.json +++ b/grafana/dashboards/storagegrid/fabricpool.json @@ -1947,6 +1947,6 @@ "timepicker": {}, "timezone": "", "title": "ONTAP: StorageGrid FabricPool", - "uid": "", + "uid": "cdot-storagegrid-fabricpool", "version": 2 } diff --git a/grafana/dashboards/storagegrid/overview.json b/grafana/dashboards/storagegrid/overview.json index c0ec048e3..e63228b5f 100644 --- a/grafana/dashboards/storagegrid/overview.json +++ b/grafana/dashboards/storagegrid/overview.json @@ -2527,6 +2527,6 @@ "timepicker": {}, "timezone": "", "title": "StorageGrid: Overview", - "uid": "", + "uid": "storagegrid-overview", "version": 4 } diff --git a/grafana/dashboards/storagegrid/tenant.json b/grafana/dashboards/storagegrid/tenant.json index c1b712fb0..aca82ea38 100644 --- a/grafana/dashboards/storagegrid/tenant.json +++ b/grafana/dashboards/storagegrid/tenant.json @@ -576,6 +576,6 @@ "timepicker": {}, "timezone": "", "title": "StorageGrid: Tenants", - "uid": "", + "uid": "storagegrid-tenants", "version": 2 } diff --git a/integration/test/dashboard_test.go b/integration/test/dashboard_test.go index 4ccba0f17..78d410eb7 100644 --- a/integration/test/dashboard_test.go +++ b/integration/test/dashboard_test.go @@ -6,7 +6,6 @@ import ( "fmt" "github.com/Netapp/harvest-automation/test/grafana" "github.com/Netapp/harvest-automation/test/utils" - "github.com/netapp/harvest/v2/cmd/harvest/version" "github.com/rs/zerolog/log" "testing" "time" @@ -37,8 +36,8 @@ func TestGrafanaAndPrometheusAreConfigured(t *testing.T) { if !utils.IsURLReachable(utils.GetPrometheusURL()) { panic(errors.New("prometheus is not reachable")) } - cDotFolder = "Harvest-" + version.VERSION + "-cDOT" - sevenModeFolder = "Harvest-" + version.VERSION + "-7mode" + cDotFolder = "Harvest-main-cDOT" + sevenModeFolder = "Harvest-main-7mode" log.Info().Str("cMode", cDotFolder).Str("7mode", sevenModeFolder).Msg("Folder name details") status, out := new(grafana.Mgr).Import() if !status {