Updated check-swap-space.ps1

This commit is contained in:
Markus Fleschutz 2024-09-06 11:00:13 +02:00
parent ffccb6175a
commit 9a8ae08b77

View File

@ -48,11 +48,11 @@ try {
if ($total -eq 0) {
Write-Output "⚠️ No swap space configured"
} elseif ($free -eq 0) {
Write-Output "⚠️ Swap space of $(MB2String $total) is full"
Write-Output "⚠️ Swap space is FULL ($(MB2String $total))"
} elseif ($free -lt $minLevel) {
Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) free"
} elseif ($used -lt 3) {
Write-Output "✅ Swap space unused - full $(MB2String $free) free"
Write-Output "✅ Swap space unused - $(MB2String $free) available"
} else {
[int64]$percent = ($used * 100) / $total
Write-Output "✅ Swap space at $percent% of $(MB2String $total) - $(MB2String $free) free"