Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hl_alert_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hardikl committed Sep 23, 2024
2 parents 785af8c + ba08084 commit 3221665
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 113 deletions.
25 changes: 17 additions & 8 deletions docs/configure-harvest-basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,28 @@ At runtime, Harvest will invoke the script specified in the `credentials_script`
- The first argument `$addr` is the address of the cluster taken from the `addr` field under the `Pollers` section of your `harvest.yml` file.
- The second argument `$username` is the username for the cluster taken from the `username` field under the `Pollers` section of your `harvest.yml` file. If your `harvest.yml` does not include a username, nothing will be passed.

The script should communicate the credentials to Harvest by writing the response to its standard output (stdout). Harvest supports two output formats from the script:
The script should communicate the credentials to Harvest by writing the response to its standard output (stdout).
Harvest supports two output formats from the script: YAML and plain text.

1. **YAML format:**
- If the script outputs a YAML object with `username` and `password` keys, Harvest will use both the `username` and `password` from the output. For example, if the script writes the following, Harvest will use `myuser` and `mypassword` for the poller's credentials.
### YAML format

If the script outputs a YAML object with `username` and `password` keys, Harvest will use both the `username` and `password` from the output. For example, if the script writes the following, Harvest will use `myuser` and `mypassword` for the poller's credentials.
```yaml
username: myuser
password: mypassword
```
If only the `password` is provided, Harvest will use the `username` from the `harvest.yml` file, if available. If your username or password contains spaces, `#`, or other characters with special meaning in YAML, make sure you quote the value like so:
`password: "my password with spaces"`
- If the script outputs a YAML object containing an `authToken`, Harvest will use this `authToken` when communicating with ONTAP or StorageGRID clusters. Harvest will include the `authToken` in the HTTP request's authorization header using the Bearer authentication scheme.
If the script outputs a YAML object containing an `authToken`, Harvest will use this `authToken` when communicating with ONTAP or StorageGRID clusters. Harvest will include the `authToken` in the HTTP request's authorization header using the Bearer authentication scheme.
```yaml
authToken: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJEcEVkRmgyODlaTXpYR25OekFvaWhTZ0FaUnBtVlVZSDJ3R3dXb0VIWVE0In0.eyJleHAiOjE3MjE4Mj
```
When using `authToken`, the `username` and `password` fields are ignored if they are present in the script's output.

### Plain text format

2. **Plain text format:** If the script outputs plain text, Harvest will use the output as the password. The `username` will be taken from the `harvest.yml` file, if available. For example, if the script writes the following to its stdout, Harvest will use the username defined in that poller's section of the `harvest.yml` and `mypassword` for the poller's credentials.
If the script outputs plain text, Harvest will use the output as the password. The `username` will be taken from the `harvest.yml` file, if available. For example, if the script writes the following to its stdout, Harvest will use the username defined in that poller's section of the `harvest.yml` and `mypassword` for the poller's credentials.
```
mypassword
```
Expand Down Expand Up @@ -394,6 +398,11 @@ echo "mypassword"

### Troubleshooting

* Make sure your script is executable
* Make sure your script is executable
* If running the poller from a container, ensure that you have mounted the script so that it is available inside the container and that you have updated the path in the `harvest.yml` file to reflect the path inside the container.
* If running the poller from a container, ensure that your [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) references an interpreter that exists inside the container. Harvest containers are built from [Distroless](https://github.com/GoogleContainerTools/distroless) images, so you may need to use `#!/busybox/sh`.
* Ensure the user/group that executes your poller also has read and execute permissions on the script.
`su` as the user/group that runs Harvest and make sure you can execute the script too.
One way to test this is to `su` to the user/group that runs Harvest
and ensure that the `su`-ed user/group can execute the script too.
* When your script outputs YAML, make sure it is valid YAML. You can use [YAML Lint](http://www.yamllint.com/) to check your output.
* When your script outputs YAML and you want to include debug logging, make sure to redirect the debug output to `stderr` instead of `stdout`, or write the debug output as YAML comments prefixed with `#.`
22 changes: 12 additions & 10 deletions grafana/dashboards/cmode/fsa.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"gnetId": null,
"graphTooltip": 1,
"id": null,
"iteration": 1715087315407,
"iteration": 1726748714554,
"links": [
{
"asDropdown": true,
Expand Down Expand Up @@ -929,7 +929,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 30
"y": 34
},
"id": 88,
"options": {
Expand All @@ -956,7 +956,7 @@
"targets": [
{
"exemplar": false,
"expr": "avg(volume_analytics_bytes_used_by_accessed_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"expr": "sum(volume_analytics_bytes_used_by_accessed_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"instant": true,
"interval": "",
"legendFormat": "{{ volume }}",
Expand Down Expand Up @@ -1049,6 +1049,7 @@
},
"lineWidth": 1
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
Expand Down Expand Up @@ -1080,7 +1081,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 30
"y": 34
},
"id": 92,
"options": {
Expand All @@ -1107,7 +1108,7 @@
"targets": [
{
"exemplar": false,
"expr": "avg(volume_analytics_bytes_used_percent_by_accessed_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"expr": "sum(\n volume_analytics_bytes_used_percent_by_accessed_time{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\", activity=~\"$Activity\", dir_name=\".\"}\n * on (cluster, datacenter, svm, volume) group_left()\n volume_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\"}\n) by (time, order)\n/\non (cluster, datacenter, svm, volume)\ngroup_left()\nsum(\n volume_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\"}\n)",
"instant": true,
"interval": "",
"legendFormat": "{{ volume }} - {{ time }}",
Expand Down Expand Up @@ -1232,7 +1233,7 @@
"h": 8,
"w": 12,
"x": 0,
"y": 38
"y": 42
},
"id": 91,
"options": {
Expand All @@ -1259,7 +1260,7 @@
"targets": [
{
"exemplar": false,
"expr": "avg(volume_analytics_bytes_used_by_modified_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"expr": "sum(volume_analytics_bytes_used_by_modified_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"instant": true,
"interval": "",
"legendFormat": "{{ volume }}",
Expand Down Expand Up @@ -1352,6 +1353,7 @@
},
"lineWidth": 1
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "absolute",
Expand Down Expand Up @@ -1383,7 +1385,7 @@
"h": 8,
"w": 12,
"x": 12,
"y": 38
"y": 42
},
"id": 93,
"options": {
Expand All @@ -1410,7 +1412,7 @@
"targets": [
{
"exemplar": false,
"expr": "avg(volume_analytics_bytes_used_percent_by_modified_time{datacenter=~\"$Datacenter\",cluster=~\"$Cluster\",svm=~\"$SVM\",volume=~\"$Volume\",activity=~\"$Activity\",dir_name=\".\"}) by (time,order)",
"expr": "sum(\n volume_analytics_bytes_used_percent_by_modified_time{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\", activity=~\"$Activity\", dir_name=\".\"}\n * on (cluster, datacenter, svm, volume) group_left()\n volume_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\"}\n) by (time, order)\n/\non (cluster, datacenter, svm, volume)\ngroup_left()\nsum(\n volume_size{datacenter=~\"$Datacenter\", cluster=~\"$Cluster\", svm=~\"$SVM\", volume=~\"$Volume\"}\n)",
"instant": true,
"interval": "",
"legendFormat": "{{ volume }}",
Expand Down Expand Up @@ -1769,5 +1771,5 @@
"timezone": "",
"title": "ONTAP: File System Analytics (FSA)",
"uid": "cdot-fsa",
"version": 5
"version": 6
}
Loading

0 comments on commit 3221665

Please sign in to comment.