diff --git a/backend/services/system_info.py b/backend/services/system_info.py index 763b912..92129b2 100644 --- a/backend/services/system_info.py +++ b/backend/services/system_info.py @@ -297,7 +297,17 @@ def get_network_traffic() -> Dict[str, Any]: return {"error": str(e)} +def _is_container() -> bool: + try: + r = subprocess.run(["/usr/bin/systemd-detect-virt"], capture_output=True, text=True, timeout=3) + return r.returncode == 0 and r.stdout.strip() not in ("none", "") + except Exception: + return False + + def get_disk_io() -> Dict[str, Any]: + if _is_container(): + return {"disks": []} try: with open("/proc/diskstats", "r") as f: lines = f.readlines()