Linux
banshee/linux-collection/linux/ssh/
filesystems
Space, inodes and read-only state of each mounted filesystem of a Linux by SSH.
by banshee1 installation3 versions
Filesystems of a Linux, by SSH
Returns, for each mounted filesystem, the used space, the free space, the size, the used and free inodes, and whether it is mounted read-only. Memory and pseudo filesystems are left out. Six watches are offered, each one set on the probe.
What changed since version 1
- Inodes are measured: a filesystem can be full with free space left, when its inodes run out.
- The mount mode is read: an ext4 that meets an error remounts itself read-only, and
read-onlyraises a critical. - The used space is the one
dfshows, used over used plus available, root's reserve excluded; version 1 divided by the whole size, which stayed about 5 % under on ext4. - Filesystems are left out by their type (from
/proc/mounts), no longer by their device name: atmpfsnamedrunorshmis left out too, as areoverlay,squashfs(snaps) and CD images. - A mount point holding blanks is supported, and a mount point shown twice is judged once.
- A
dfthat cannot read one mount (and exits with an error) no longer stops the collector: the other filesystems are still measured. Reading no filesystem at all stops itmisconfigured. sizeis new.used,full-soon,freeandmissingkeep their ids, kinds and defaults: a probe upgraded from version 1 keeps its settings.
How it works
The collector runs three commands:
cat /proc/mounts, for the type and the mode (rworro) of each mount;df -P -k, for the space, in KiB;df -P -i, for the inodes.
- A mount point shown twice (stacked mounts) is judged once. A filesystem of size zero (proc, sysfs, cgroup…) is left out, as are the types
tmpfs,devtmpfs,ramfs,overlay,squashfs,iso9660,udf,efivarfs,fuse.lxcfsandfuse.gvfsd-fuse. - A filesystem that does not count inodes (btrfs, vfat) has no inode values.
- Portable:
/proc/mountsis written by the kernel the same way on Alpine, Debian and Fedora;-P,-kand-iare options ofdfin BusyBox as in GNU coreutils. Nothing is written on the target.
Prerequisites
- an SSH account for monitoring, without write rights;
- the fingerprint of the server's host key, set in
protocol:ssh:fingerprint(not needed when the Security settings trust the first SSH fingerprint presented).
Outputs
| Output | Unit | Per | Meaning |
|---|---|---|---|
used | % | filesystem (its mount point) | used space |
free | MiB | filesystem | space available |
size | GiB | filesystem | size |
inodes-used | % | filesystem | used inodes |
inodes-free | — | filesystem | free inodes |
mode | — | filesystem | rw or ro |
Watches
| Watch | Kind | Defaults | Checked |
|---|---|---|---|
used Used space | above, on used | warning 80, critical 90 | yes |
full-soon Full within a week | above, on used | warning 99, trend 7 d | yes |
free Little free space | below, on free | critical 1024 | no |
inodes Inodes running out | above, on inodes-used | warning 80, critical 90 | yes |
read-only Mounted read-only | state, on mode | critical ro | yes |
missing Filesystem missing | missing, on used | no expected name | yes, raises once names are set |
Limits
- A
dfthat does not know-i(a BusyBox built without it) stops the collectormisconfigured. - A stale network mount can make
dfhang: the run then ends on the SSH timeout,unreachable. - In a mount point, a run of blanks is read as a single one.
- A filesystem mounted read-only on purpose raises
read-only: uncheck it, or leave it out of the selection.