Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into rg2-power-watts
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Jul 20, 2023
2 parents 6074812 + 4b66863 commit a378a8b
Show file tree
Hide file tree
Showing 21 changed files with 283 additions and 72 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,10 @@ package: clean deps build test dist-tar ## Package Harvest binary
all: package ## Build, Test, Package

harvest: deps
@# Build the harvest cli
@mkdir -p bin
@# Build the harvest and poller cli
@echo "Building harvest"
@GOOS=$(GOOS) GOARCH=$(GOARCH) $(FLAGS) go build -trimpath -o bin/harvest -ldflags=$(LD_FLAGS) cmd/harvest/harvest.go

@# Build the harvest poller
@echo "Building poller"
@GOOS=$(GOOS) GOARCH=$(GOARCH) $(FLAGS) go build -trimpath -o bin/poller -ldflags=$(LD_FLAGS) cmd/poller/poller.go
@GOOS=$(GOOS) GOARCH=$(GOARCH) $(FLAGS) go build -trimpath -o bin -ldflags=$(LD_FLAGS) ./cmd/harvest ./cmd/poller

@# Build the daemonize for the pollers
@echo "Building daemonize"
Expand Down
2 changes: 1 addition & 1 deletion cmd/collectors/storagegrid/rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func New(poller *conf.Poller, timeout time.Duration, c *auth.Credentials) (*Clie
InsecureSkipVerify: useInsecureTLS}, //nolint:gosec
}
} else {
username := poller.Username
username := pollerAuth.Username
password := pollerAuth.Password
client.username = username
if username == "" {
Expand Down
19 changes: 19 additions & 0 deletions cmd/tools/grafana/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,25 @@ func checkTopKRange(t *testing.T, path string, data []byte) {
}

for _, v := range variables {
if v.name == "TopResources" {
for _, optionVal := range v.options {
selected := optionVal.Get("selected").Bool()
text := optionVal.Get("text").String()
value := optionVal.Get("value").String()

// Test if text and value match, except for the special case with "All" and "$__all"
if text != value && !(text == "All" && value == "$__all") {
t.Errorf("In dashboard %s, variable %s uses topk, but text '%s' does not match value '%s'",
shortPath(path), v.name, text, value)
}

// Test if the selected value matches the expected text "5"
if (text == "5") != selected {
t.Errorf("In dashboard %s, variable %s uses topk, but text '%s' has incorrect selected state: %t",
shortPath(path), v.name, text, selected)
}
}
}
if !strings.Contains(v.query, "topk") || !strings.Contains(v.query, "__range") {
continue
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/tools/grafana/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type variable struct {
query string
refresh string
path string
options []gjson.Result
}

func allVariables(data []byte) []variable {
Expand All @@ -116,6 +117,7 @@ func allVariables(data []byte) []variable {
kind: value.Get("type").String(),
query: value.Get("query.query").String(),
refresh: value.Get("refresh").String(),
options: value.Get("options").Array(),
path: key.String(),
})
return true
Expand Down
2 changes: 2 additions & 0 deletions conf/rest/9.7.0/nfs_clients.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This template is disabled by default because it may slow down data collection

name: NFSClients
query: api/protocols/nfs/connected-clients
object: nfs_clients
Expand Down
2 changes: 1 addition & 1 deletion conf/rest/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ objects:
NetConnections: netconnections.yaml
# NetPort: netport.yaml
NetRoute: netroute.yaml
NFSClients: nfs_clients.yaml
# NFSClients: nfs_clients.yaml
Node: node.yaml
NtpServer: ntpserver.yaml
OntapS3: ontap_s3.yaml
Expand Down
2 changes: 1 addition & 1 deletion conf/restperf/9.12.0/wafl_hya_per_aggr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object: flashpool

counters:
- ^^id
- ^hya_aggr_name => aggr
- ^hya_aggregate_name => aggr
- ^node.name => node
- evict_destage_rate
- evict_remove_rate
Expand Down
21 changes: 8 additions & 13 deletions docs/install/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,13 @@ Instructions on how to install Harvest via [NAbox](https://nabox.org/documentati

## Source

To build Harvest from source code, first make sure you have a working Go environment
with [version 1.19 or greater installed](https://golang.org/doc/install).

Clone the repo and build everything.

```
git clone https://github.com/NetApp/harvest.git
cd harvest
make build
bin/harvest version
```

If you're building on a Mac use `GOOS=darwin make build`
To build Harvest from source code follow these steps.

1. `git clone https://github.com/NetApp/harvest.git`
2. cd `harvest`
3. check the version of go required in the `go.mod` file
4. ensure you have a working Go environment at that version or newer. Go installs found [here](https://golang.org/doc/install).
5. `make build` (if you want to run Harvest from a Mac use `GOOS=darwin make build`)
6. `bin/harvest version`

Checkout the `Makefile` for other targets of interest.
8 changes: 4 additions & 4 deletions grafana/dashboards/cmode/network.json
Original file line number Diff line number Diff line change
Expand Up @@ -3317,8 +3317,8 @@
"allValue": null,
"current": {
"selected": true,
"text": "20",
"value": "20"
"text": "5",
"value": "5"
},
"description": null,
"error": null,
Expand Down Expand Up @@ -3349,7 +3349,7 @@
"value": "4"
},
{
"selected": false,
"selected": true,
"text": "5",
"value": "5"
},
Expand All @@ -3374,7 +3374,7 @@
"value": "15"
},
{
"selected": true,
"selected": false,
"text": "20",
"value": "20"
},
Expand Down
2 changes: 1 addition & 1 deletion grafana/dashboards/cmode/nfs_clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
},
"id": 29,
"options": {
"content": "You must enable the Rest collector in your harvest.yml config and uncomment the nfs_clients.yaml section in your $HARVEST/conf/rest/default.yaml file. Please see https://github.com/NetApp/harvest/wiki/FAQ#nfs-clients-dashboard for more details",
"content": "You must enable the Rest collector in your `harvest.yml` config and uncomment the `nfs_clients.yaml` section in your `$HARVEST/conf/rest/default.yaml` file. Please see [nfs clients dashboard](https://github.com/NetApp/harvest/wiki/FAQ#nfs-clients-dashboard) for more details. Enabling `nfs_clients.yaml` may slow down data collection.",
"mode": "markdown"
},
"pluginVersion": "8.1.8",
Expand Down
10 changes: 5 additions & 5 deletions grafana/dashboards/cmode/node.json
Original file line number Diff line number Diff line change
Expand Up @@ -4815,9 +4815,9 @@
{
"allValue": null,
"current": {
"selected": false,
"text": "8",
"value": "8"
"selected": true,
"text": "5",
"value": "5"
},
"description": null,
"error": null,
Expand Down Expand Up @@ -4848,7 +4848,7 @@
"value": "4"
},
{
"selected": false,
"selected": true,
"text": "5",
"value": "5"
},
Expand All @@ -4858,7 +4858,7 @@
"value": "6"
},
{
"selected": true,
"selected": false,
"text": "8",
"value": "8"
},
Expand Down
10 changes: 5 additions & 5 deletions grafana/dashboards/cmode/qtree.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,9 @@
{
"allValue": null,
"current": {
"selected": false,
"text": "3",
"value": "3"
"selected": true,
"text": "5",
"value": "5"
},
"description": null,
"error": null,
Expand All @@ -906,7 +906,7 @@
"value": "2"
},
{
"selected": true,
"selected": false,
"text": "3",
"value": "3"
},
Expand All @@ -916,7 +916,7 @@
"value": "4"
},
{
"selected": false,
"selected": true,
"text": "5",
"value": "5"
},
Expand Down
Loading

0 comments on commit a378a8b

Please sign in to comment.