diff --git a/src/statd/python/yanger/ietf_interfaces/ethernet.py b/src/statd/python/yanger/ietf_interfaces/ethernet.py index 2a814c95..55003713 100644 --- a/src/statd/python/yanger/ietf_interfaces/ethernet.py +++ b/src/statd/python/yanger/ietf_interfaces/ethernet.py @@ -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 diff --git a/src/statd/python/yanger/ietf_system.py b/src/statd/python/yanger/ietf_system.py index 0ef7a7b7..f82af822 100644 --- a/src/statd/python/yanger/ietf_system.py +++ b/src/statd/python/yanger/ietf_system.py @@ -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: diff --git a/test/case/statd/system/ietf-system.json b/test/case/statd/system/ietf-system.json index a8dde70b..e8575f7f 100644 --- a/test/case/statd/system/ietf-system.json +++ b/test/case/statd/system/ietf-system.json @@ -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" } ] } diff --git a/test/case/statd/system/operational.json b/test/case/statd/system/operational.json index 42832152..8a436a9d 100644 --- a/test/case/statd/system/operational.json +++ b/test/case/statd/system/operational.json @@ -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": { diff --git a/test/case/statd/system/system/run/df_-k_+run b/test/case/statd/system/system/run/df_-k_+run new file mode 100644 index 00000000..40e8f48b --- /dev/null +++ b/test/case/statd/system/system/run/df_-k_+run @@ -0,0 +1,2 @@ +Filesystem 1K-blocks Used Available Use% Mounted on +tmpfs 51200 128 51072 1% /run diff --git a/test/case/statd/system/system/run/df_-k_+tmp b/test/case/statd/system/system/run/df_-k_+tmp new file mode 100644 index 00000000..a628d3f5 --- /dev/null +++ b/test/case/statd/system/system/run/df_-k_+tmp @@ -0,0 +1,2 @@ +Filesystem 1K-blocks Used Available Use% Mounted on +tmpfs 102400 240 102160 1% /tmp