|
| 1 | +--- |
| 2 | +title: cluster-health |
| 3 | +--- |
| 4 | + |
| 5 | +## Description |
| 6 | + |
| 7 | +The `cluster-health` command checks the health of a vSphere cluster, evaluating node status against user‑defined thresholds. |
| 8 | + |
| 9 | +## Options |
| 10 | + |
| 11 | +Besides the [general options](../../general-options/) this command supports the following options: |
| 12 | + |
| 13 | +| option | description | |
| 14 | +|---|---| |
| 15 | +| `--cluster-name CLUSTER_NAME` | Name of the cluster to check | |
| 16 | +| `--cluster-threshold CLUSTER_THRESHOLD` | Cluster threshold: `[max_members:]warn:crit`. Numbers or percentages; max_members optional. | |
| 17 | +| `--nostandby` | Standby nodes are not considered part of the cluster | |
| 18 | +| `--faulty FAULTY` | Fault conditions to treat as failures (e.g., `*inMaintenance`, `*notconnected`, `inStandby`, `inQuarantine`, `overallStatusRed`, `overallStatusYellow`, `overallStatusGrey`). `*` marks default entries | |
| 19 | + |
| 20 | +## --cluster-threshold details |
| 21 | + |
| 22 | +`--cluster-threshold CLUSTER_THRESHOLD` |
| 23 | + |
| 24 | +The syntax is `[max_members:]warn_threshold:crit_threshold`. |
| 25 | + |
| 26 | +- `max_members` (optional) – applies the rule only when the cluster has this many nodes; if omitted it serves as a fallback for any size. |
| 27 | +- `warn_threshold` – number or percentage of faulty nodes that triggers a **WARNING**. |
| 28 | +- `crit_threshold` – number or percentage of faulty nodes that triggers a **CRITICAL**. |
| 29 | + |
| 30 | +Thresholds can be absolute numbers (e.g., `1`) or percentages (e.g., `30%`). Mixed forms are allowed (e.g., `4:1:3`). Multiple `--cluster-threshold` flags may be given for different cluster sizes. Exactly one `--cluster-threshold` must omit `max_members` and acts as a fallback for any cluster size. |
| 31 | + |
| 32 | +Examples: |
| 33 | + |
| 34 | +- `1:1:1` – a 1‑node cluster is critical if any node fails. |
| 35 | +- `4:1:3` – a 4‑node cluster warns at 1 faulty node, critical at 3. |
| 36 | +- `30%:50%` – for clusters larger than 4 nodes, warn at ≥30 % failures, critical at ≥50 % failures. |
| 37 | + |
| 38 | +## Examples |
| 39 | + |
| 40 | +```bash |
| 41 | +check_vsphere cluster-health \ |
| 42 | + --host vcenter.example.com \ |
| 43 | + -nossl \ |
| 44 | + -u naemon@vsphere.local \ |
| 45 | + -p "PW" \ |
| 46 | + --cluster-threshold '1:1:1' \ |
| 47 | + --cluster-threshold '4:1:3' \ |
| 48 | + --cluster-threshold '30%:50%' \ |
| 49 | + --cluster-name CLUSTERNAME |
| 50 | +``` |
0 commit comments