Exclude squashfs/loopback mounts from system.disk_info.

This commit is contained in:
Fabio Manganiello 2023-05-06 18:53:16 +02:00
parent e33a391d25
commit d1f0e1976c
Signed by: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -223,7 +223,12 @@ class SystemPlugin(SensorPlugin, EntityManager):
@staticmethod
def _disk_info() -> List[Disk]:
parts = {part.device: part._asdict() for part in psutil.disk_partitions()}
parts = {
part.device: part._asdict()
for part in psutil.disk_partitions()
if part.fstype != 'squashfs' # Exclude loopback mounts
}
basename_parts = {os.path.basename(part): part for part in parts}
io_stats = {
basename_parts[disk]: stats._asdict()