Linux disk space over SSH (ssh_disk)
Runs df over SSH and reports how full one mount point is, and its free and total size.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
used_pct | Space used | % | warning above 85, error above 95 |
free_bytes | Free space | B | none |
total_bytes | Total size | B | none |
The used percentage is what df calls Use%: used over used plus available, where available leaves out the blocks the file system reserves for root (5% by default on ext4). snmp_disk counts those reserved blocks as free, so its used percentage and free space are a little lower and higher than this sensor's for the same file system.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
mount | / | The mount point to watch, an absolute path exactly as df prints it. |
port | 22 | TCP port of the SSH server. |
Suggested interval: 300 seconds. Credential: SSH (ssh_password or ssh_key). Discovery adds one sensor for each real disk it finds.
On the target
- A Linux host with an SSH server and an account that can log in and run commands. A read-only, unprivileged account is enough:
dfneeds no privileges. - The command run is
env LC_ALL=C df -Pk '<mount>'. Only the watched path is asked for, so one stalled network mount elsewhere cannot hang the sensor. A login shell that prints a banner is tolerated.
Host key
The first successful connection records the server's host key in the sensor's state (trust on first use). Later polls must present the same key. A different key fails the poll before any credential is sent.
Failures
| Message | Meaning |
|---|---|
SSH host key changed: ... now presents ... but ... was recorded. Nothing was sent. (kind protocol) | The server presents a different key: it was reinstalled, or something is intercepting the connection. If the change is expected, an operator chooses "Forget stored state" in the sensor's settings (DELETE /api/v1/sensors/{id}/state) and the next poll records the new key; see security. |
... rejected the SSH credential for user ... (kind auth_failed) | Wrong user, password or key. |
SSH private key is unusable: ... (kind config) | The stored key is not a valid OpenSSH private key, or its passphrase is wrong. |
this sensor needs an SSH credential ... (kind config) | No SSH credential is assigned or inherited, or it is of the wrong kind. |
SSH connection to ... timed out, ... closed the SSH connection | The host is down, a firewall drops the port, or the server closed the session. |
df failed on the target (exit status N): ... (kind protocol) | The mount point is not listed by df, or df failed. The message quotes the first line of its output. |