Updated check-cpu.ps1 and check-smart-devices.ps1

This commit is contained in:
Markus Fleschutz 2024-10-14 16:04:59 +02:00
parent fc66df1797
commit 6659468d18
2 changed files with 9 additions and 4 deletions

View File

@ -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"
}

View File

@ -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