Skip to content

Commit 7fb107d

Browse files
committed
feat: skip logging for virtual disks in SSD temperature collection
1 parent 2e0a50c commit 7fb107d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sensor-container/sensors.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ collect_ssd_temps() {
4141

4242
# Try to get SMART data (some devices might not support it)
4343
if smartctl -i "$dev_path" >/dev/null 2>&1; then
44-
echo "=== $device ===" >> "$output_file"
45-
4644
# Get device model
4745
local model=$(smartctl -i "$dev_path" 2>/dev/null | grep "Device Model\|Model Number\|Product:" | head -1 | sed 's/.*: *//')
46+
47+
# Skip virtual disks (e.g. VIRTUAL-DISK, VBOX, QEMU, VMware)
48+
if echo "$model" | grep -qiE 'virtual|vbox|qemu|vmware'; then
49+
continue
50+
fi
51+
52+
echo "=== $device ===" >> "$output_file"
53+
4854
if [ -n "$model" ]; then
4955
echo "Model: $model" >> "$output_file"
5056
fi

0 commit comments

Comments
 (0)