For NetOrk/netork#862: netOrk has a volume_almost_full warning, but nothing ever raised it. pve-dual's root filesystem sat at 94 % (about 400 MB free) for a week, until a kernel upgrade failed with "No space left on device" and left dpkg halfway.
Change
HOST_STATUS_COMMAND gains a [filesystems] section that runs POSIX df -Pk / /boot /var. It needs no root.
parse_host_status returns filesystems: a list of {mountpoint, total, used, available} in bytes, one entry per filesystem. A directory that is not its own mount appears under the filesystem it lives on. If df printed nothing usable, the value is None.
models.py: new FilesystemUsageDict, and HostStatusDict.filesystems (NotRequired).
Version 4.4.0.
No driver needs a change. Linux, Proxmox, BSD and OpenMediaVault already run HOST_STATUS_COMMAND through their shell transport. The threshold is decided in netOrk, not here.
Verification
tests/test_host_status.py: new class TestFilesystems with 9 tests. One of them runs the real command through sh.
The full test suite passed (498).
napalm-linux, napalm-proxmox and napalm-bsd tests are green against this base.
For NetOrk/netork#862: netOrk has a `volume_almost_full` warning, but nothing ever raised it. pve-dual's root filesystem sat at 94 % (about 400 MB free) for a week, until a kernel upgrade failed with "No space left on device" and left dpkg halfway.
## Change
- `HOST_STATUS_COMMAND` gains a `[filesystems]` section that runs POSIX `df -Pk / /boot /var`. It needs no root.
- `parse_host_status` returns `filesystems`: a list of `{mountpoint, total, used, available}` in bytes, one entry per filesystem. A directory that is not its own mount appears under the filesystem it lives on. If df printed nothing usable, the value is `None`.
- `models.py`: new `FilesystemUsageDict`, and `HostStatusDict.filesystems` (NotRequired).
- Version 4.4.0.
No driver needs a change. Linux, Proxmox, BSD and OpenMediaVault already run `HOST_STATUS_COMMAND` through their shell transport. The threshold is decided in netOrk, not here.
## Verification
- `tests/test_host_status.py`: new class `TestFilesystems` with 9 tests. One of them runs the real command through `sh`.
- The full test suite passed (498).
- napalm-linux, napalm-proxmox and napalm-bsd tests are green against this base.
A Proxmox host's root filesystem stood at 94 % with about 400 MB free for a
week; a kernel upgrade failed on it with "No space left on device" and left
dpkg halfway, and nothing had said the disk was full (NetOrk/netork#862).
HOST_STATUS_COMMAND now also runs POSIX `df -Pk / /boot /var`, without root.
get_host_status() returns `filesystems`: each filesystem once (a directory
that is not a mount of its own is the filesystem it lives on), with its
mountpoint, total, used and available bytes, or None when df said nothing.
`available` is what df says an ordinary user can still write, which on ext4
is less than total minus used. How full is too full is the caller's decision.
Version 4.4.0.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
For NetOrk/netork#862: netOrk has a
volume_almost_fullwarning, but nothing ever raised it. pve-dual's root filesystem sat at 94 % (about 400 MB free) for a week, until a kernel upgrade failed with "No space left on device" and left dpkg halfway.Change
HOST_STATUS_COMMANDgains a[filesystems]section that runs POSIXdf -Pk / /boot /var. It needs no root.parse_host_statusreturnsfilesystems: a list of{mountpoint, total, used, available}in bytes, one entry per filesystem. A directory that is not its own mount appears under the filesystem it lives on. If df printed nothing usable, the value isNone.models.py: newFilesystemUsageDict, andHostStatusDict.filesystems(NotRequired).No driver needs a change. Linux, Proxmox, BSD and OpenMediaVault already run
HOST_STATUS_COMMANDthrough their shell transport. The threshold is decided in netOrk, not here.Verification
tests/test_host_status.py: new classTestFilesystemswith 9 tests. One of them runs the real command throughsh.