mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-09 10:04:45 +02:00
Updated check-swap-space.ps1
This commit is contained in:
parent
a0f0ed7814
commit
9c2bcc5861
@ -46,16 +46,16 @@ try {
|
||||
[int64]$free = ($total - $used)
|
||||
}
|
||||
if ($total -eq 0) {
|
||||
Write-Output "⚠️ No swap space configured"
|
||||
Write-Output "⚠️ No swap space configured."
|
||||
} elseif ($free -eq 0) {
|
||||
Write-Output "⚠️ Swap space with $(MB2String $total) is FULL !!!"
|
||||
Write-Output "⚠️ Swap space of $(MB2String $total) is FULL!"
|
||||
} elseif ($free -lt $minLevel) {
|
||||
Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) left!"
|
||||
} elseif ($used -lt 3) {
|
||||
Write-Output "✅ Swap space has $(MB2String $total) reserved"
|
||||
Write-Output "✅ Swap space has $(MB2String $total) reserved."
|
||||
} else {
|
||||
[int64]$percent = ($used * 100) / $total
|
||||
Write-Output "✅ Swap space uses $(MB2String $used) ($percent%) of $(MB2String $total)"
|
||||
Write-Output "✅ Swap space at $(MB2String $used) ($percent%) of $(MB2String $total)."
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user