From 6659468d181eda8c69a71c8bfec8acefb25618eb Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 14 Oct 2024 16:04:59 +0200 Subject: [PATCH] Updated check-cpu.ps1 and check-smart-devices.ps1 --- scripts/check-cpu.ps1 | 2 ++ scripts/check-smart-devices.ps1 | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/check-cpu.ps1 b/scripts/check-cpu.ps1 index 5f1052e5..ad080f2b 100755 --- a/scripts/check-cpu.ps1 +++ b/scripts/check-cpu.ps1 @@ -72,6 +72,8 @@ try { } elseif ($celsius -lt 0) { $temp = "$($celsius)°C TOO COLD" $status = "⚠️" + } elseif ($celsius -lt 30) { + $temp = "$($celsius)°C cool" } else { $temp = "$($celsius)°C OK" } diff --git a/scripts/check-smart-devices.ps1 b/scripts/check-smart-devices.ps1 index ba9099d7..c52c085d 100755 --- a/scripts/check-smart-devices.ps1 +++ b/scripts/check-smart-devices.ps1 @@ -63,7 +63,10 @@ try { $capacity = "" } if ($details.temperature.current -gt 50) { - $temp = "$($details.temperature.current)°C (!)" + $temp = "$($details.temperature.current)°C TOO HOT" + $status = "⚠️" + } elseif ($details.temperature.current -lt 0) { + $temp = "$($details.temperature.current)°C TOO COLD" $status = "⚠️" } else { $temp = "$($details.temperature.current)°C" @@ -81,13 +84,13 @@ try { $powerOn = "$($details.power_cycle_count)x on/off" } if ($details.smart_status.passed) { - $selftest = "selftest OK" + $selftest = "test passed" } else { - $selftest = "selftest FAILED" + $selftest = "test FAILED" $status = "⚠️" } $firmwareVersion = $details.firmware_version - Write-Host "$status $capacity$modelName via $protocol ($temp, $hours, $powerOn, v$firmwareVersion) - $selftest" + Write-Host "$status $capacity$modelName via $protocol ($hours, $powerOn, v$firmwareVersion) - $temp & $selftest" } #Write-Progress -completed "Done." exit 0 # success