feat(host_agent): a disk out of inodes reads as full (#5745)
VDNT-Util01's / ran out of inodes (956 free of 60.8M) with 274G of space
left; every file create failed and Steward's page read healthy at 66%.
- Agent 1.13.0 reports each mount's inodes (statvfs; a filesystem reporting
none, like btrfs, is left without).
- Ingest records inodes_used_pct per mount, and disk_used_pct_worst is the
fullest mount by space or inodes, so existing disk-full rules and the
overview see it.
- The host's health strip, the Hosts widget and the host glance grade / by
whichever is fuller and name inodes when they are ("Disk / 66% · inodes
100%", "Inodes on / ... past its critical threshold").
Hosts pick up the inode figures once their agent is updated to 1.13.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ from collections import deque
|
||||
from concurrent.futures import ThreadPoolExecutor, wait as wait_futures
|
||||
from datetime import datetime, timezone
|
||||
|
||||
AGENT_VERSION = "1.12.0"
|
||||
AGENT_VERSION = "1.13.0"
|
||||
|
||||
# Default path to the local Docker Engine socket. Overridable via the
|
||||
# `docker_socket` config key; collection is silently skipped if it's absent or
|
||||
@@ -188,7 +188,18 @@ def collect_storage(mounts: list[str]) -> list[dict]:
|
||||
u = shutil.disk_usage(m)
|
||||
except (FileNotFoundError, PermissionError):
|
||||
continue
|
||||
out.append({"mount": m, "total_bytes": u.total, "used_bytes": u.used})
|
||||
row = {"mount": m, "total_bytes": u.total, "used_bytes": u.used}
|
||||
# Inodes too (1.13.0): a filesystem can run out of them with space
|
||||
# to spare, and every create then fails with ENOSPC. Some (btrfs)
|
||||
# report none, and are left without.
|
||||
try:
|
||||
st = os.statvfs(m)
|
||||
except OSError:
|
||||
st = None
|
||||
if st is not None and st.f_files:
|
||||
row["inodes_total"] = st.f_files
|
||||
row["inodes_used"] = st.f_files - st.f_ffree
|
||||
out.append(row)
|
||||
return out
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user