statd: extend mount-points + advertised pmds per interface

- Include /run and /tmp in mount-points, likely more interesting than /.
- Include advertised link modes in operational to compare with supported

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-06-14 18:28:22 +02:00
parent ad28fd9db5
commit f8f73b89cb
6 changed files with 39 additions and 5 deletions
@@ -203,10 +203,11 @@ def link(ifname):
if supported:
eth["infix-ethernet-interface:supported-pmd-types"] = supported
# Suppress when advertised == supported — that's the default
# "advertise everything" state with no diagnostic value.
# Always emit when the PHY is advertising something — even when it equals
# the full supported set, displaying the list alongside supported is
# useful for "show interfaces detail" and the WebUI ethernet card.
advertised = _ethtool_modes_to_pmd_identities(data.get("advertised-link-modes"))
if advertised and set(advertised) != set(supported):
if advertised:
eth["auto-negotiation"]["infix-ethernet-interface:advertised-pmd-types"] = advertised
speed_bps = None
+7 -2
View File
@@ -422,9 +422,14 @@ def add_resource_usage(out):
except (FileNotFoundError, ValueError):
pass
# Filesystem usage
# Filesystem usage. /run and /tmp are tmpfs (RAM-backed) and easily the
# scarcest writable storage on small embedded boards — surface them so
# operators can tell when the box is about to start dropping logs or
# failing to spool config diffs. / is the read-only rootfs (squashfs);
# always 100 % used by design but kept in the list so a flag/limit
# consumer can recognise it.
filesystems = []
for mount in ["/", "/var", "/cfg"]:
for mount in ["/", "/var", "/cfg", "/run", "/tmp"]:
try:
result = HOST.run_multiline(["df", "-k", mount], [])
if len(result) > 1:
+12
View File
@@ -416,6 +416,18 @@
"size": "14073",
"used": "67",
"available": "12860"
},
{
"mount-point": "/run",
"size": "51200",
"used": "128",
"available": "51072"
},
{
"mount-point": "/tmp",
"size": "102400",
"used": "240",
"available": "102160"
}
]
}
+12
View File
@@ -111,6 +111,18 @@
"mount-point": "/cfg",
"size": "14073",
"used": "67"
},
{
"available": "51072",
"mount-point": "/run",
"size": "51200",
"used": "128"
},
{
"available": "102160",
"mount-point": "/tmp",
"size": "102400",
"used": "240"
}
],
"load-average": {
@@ -0,0 +1,2 @@
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 51200 128 51072 1% /run
@@ -0,0 +1,2 @@
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 102400 240 102160 1% /tmp