fix(wiki): address review feedback on health monitoring guide
- Remove 2>&1 from command substitution to avoid corrupting JSON with stderr - Replace hardcoded datetime in example output with format placeholder - Replace --remote/--token references with saved remotes (gordon remotes use)
- commit
- 759791cdf9263bd477b94464da6c92c192faff50
- author
- brice · · 2026-03-24 05:34 UTC
- parent
- e7e0b7a
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +8 -6
M wiki/guides/health-monitoring.md +8 -6
| @@ -8,7 +8,7 @@ Monitor your Gordon routes and get desktop notifications when something goes dow | |||
| 8 | 8 | - `jq` and `notify-send` (libnotify) available | |
| 9 | 9 | - systemd user session (most Linux desktops) | |
| 10 | 10 | ||
| 11 | - | For remote instances, pass `--remote` and `--token` to the gordon command (see [Remote CLI Management](./remote-cli.md)). | |
| 11 | + | For remote instances, configure a saved remote with `gordon remotes add` and `gordon remotes use` (see [Remote CLI Management](./remote-cli.md)). The CLI uses the active remote automatically. | |
| 12 | 12 | ||
| 13 | 13 | --- | |
| 14 | 14 | ||
| @@ -21,10 +21,12 @@ Create `~/.local/bin/gordon-watchdog.sh`: | |||
| 21 | 21 | set -euo pipefail | |
| 22 | 22 | ||
| 23 | 23 | GORDON_CMD="gordon routes list --json" | |
| 24 | - | # For remote monitoring, use: | |
| 25 | - | # GORDON_CMD="gordon routes list --json --remote https://gordon.example.com --token $GORDON_TOKEN" | |
| 24 | + | # For remote monitoring, configure a saved remote first: | |
| 25 | + | # gordon remotes add myserver https://gordon.example.com --token-env GORDON_TOKEN | |
| 26 | + | # gordon remotes use myserver | |
| 27 | + | # The CLI then targets the remote automatically. | |
| 26 | 28 | ||
| 27 | - | json=$($GORDON_CMD 2>&1) || { | |
| 29 | + | json=$($GORDON_CMD) || { | |
| 28 | 30 | notify-send -u critical "Gordon Watchdog" "Cannot reach Gordon" | |
| 29 | 31 | exit 1 | |
| 30 | 32 | } | |
| @@ -79,7 +81,7 @@ Test it: | |||
| 79 | 81 | ||
| 80 | 82 | ```bash | |
| 81 | 83 | ~/.local/bin/gordon-watchdog.sh | |
| 82 | - | # Expected: [2024-01-15T10:30:00+01:00] OK: all routes healthy | |
| 84 | + | # Expected: [YYYY-MM-DDThh:mm:ss+00:00] OK: all routes healthy | |
| 83 | 85 | ``` | |
| 84 | 86 | ||
| 85 | 87 | ## What Gets Flagged | |
| @@ -173,7 +175,7 @@ if [[ "$http_status" -ne 200 ]]; then | |||
| 173 | 175 | fi | |
| 174 | 176 | ``` | |
| 175 | 177 | ||
| 176 | - | **Remote monitoring**: set `GORDON_CMD` to include `--remote` and `--token` flags, or export `GORDON_TOKEN` as an environment variable in the service unit. | |
| 178 | + | **Remote monitoring**: configure a saved remote with `gordon remotes add` and `gordon remotes use`. The script picks it up automatically from `~/.config/gordon/remotes.toml`. | |
| 177 | 179 | ||
| 178 | 180 | --- | |
| 179 | 181 | ||
| @@ -8,7 +8,7 @@ Monitor your Gordon routes and get desktop notifications when something goes dow | |||||
| 8 | - `jq` and `notify-send` (libnotify) available | 8 | - `jq` and `notify-send` (libnotify) available | ||
| 9 | - systemd user session (most Linux desktops) | 9 | - systemd user session (most Linux desktops) | ||
| 10 | 10 | ||||
| 11 | - | For remote instances, pass `--remote` and `--token` to the gordon command (see [Remote CLI Management](./remote-cli.md)). | 11 | + | For remote instances, configure a saved remote with `gordon remotes add` and `gordon remotes use` (see [Remote CLI Management](./remote-cli.md)). The CLI uses the active remote automatically. |
| 12 | 12 | ||||
| 13 | --- | 13 | --- | ||
| 14 | 14 | ||||
| @@ -21,10 +21,12 @@ Create `~/.local/bin/gordon-watchdog.sh`: | |||||
| 21 | set -euo pipefail | 21 | set -euo pipefail | ||
| 22 | 22 | ||||
| 23 | GORDON_CMD="gordon routes list --json" | 23 | GORDON_CMD="gordon routes list --json" | ||
| 24 | - | # For remote monitoring, use: | 24 | + | # For remote monitoring, configure a saved remote first: |
| 25 | - | # GORDON_CMD="gordon routes list --json --remote https://gordon.example.com --token $GORDON_TOKEN" | 25 | + | # gordon remotes add myserver https://gordon.example.com --token-env GORDON_TOKEN |
| 26 | + | # gordon remotes use myserver | |||
| 27 | + | # The CLI then targets the remote automatically. | |||
| 26 | 28 | ||||
| 27 | - | json=$($GORDON_CMD 2>&1) || { | 29 | + | json=$($GORDON_CMD) || { |
| 28 | notify-send -u critical "Gordon Watchdog" "Cannot reach Gordon" | 30 | notify-send -u critical "Gordon Watchdog" "Cannot reach Gordon" | ||
| 29 | exit 1 | 31 | exit 1 | ||
| 30 | } | 32 | } | ||
| @@ -79,7 +81,7 @@ Test it: | |||||
| 79 | 81 | ||||
| 80 | ```bash | 82 | ```bash | ||
| 81 | ~/.local/bin/gordon-watchdog.sh | 83 | ~/.local/bin/gordon-watchdog.sh | ||
| 82 | - | # Expected: [2024-01-15T10:30:00+01:00] OK: all routes healthy | 84 | + | # Expected: [YYYY-MM-DDThh:mm:ss+00:00] OK: all routes healthy |
| 83 | ``` | 85 | ``` | ||
| 84 | 86 | ||||
| 85 | ## What Gets Flagged | 87 | ## What Gets Flagged | ||
| @@ -173,7 +175,7 @@ if [[ "$http_status" -ne 200 ]]; then | |||||
| 173 | fi | 175 | fi | ||
| 174 | ``` | 176 | ``` | ||
| 175 | 177 | ||||
| 176 | - | **Remote monitoring**: set `GORDON_CMD` to include `--remote` and `--token` flags, or export `GORDON_TOKEN` as an environment variable in the service unit. | 178 | + | **Remote monitoring**: configure a saved remote with `gordon remotes add` and `gordon remotes use`. The script picks it up automatically from `~/.config/gordon/remotes.toml`. |
| 177 | 179 | ||||
| 178 | --- | 180 | --- | ||
| 179 | 181 | ||||