mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-23 18:38:19 +02:00
Updated check-swap-space.ps1
This commit is contained in:
parent
ffccb6175a
commit
9a8ae08b77
@ -48,11 +48,11 @@ try {
|
|||||||
if ($total -eq 0) {
|
if ($total -eq 0) {
|
||||||
Write-Output "⚠️ No swap space configured"
|
Write-Output "⚠️ No swap space configured"
|
||||||
} elseif ($free -eq 0) {
|
} 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) {
|
} elseif ($free -lt $minLevel) {
|
||||||
Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) free"
|
Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) free"
|
||||||
} elseif ($used -lt 3) {
|
} elseif ($used -lt 3) {
|
||||||
Write-Output "✅ Swap space unused - full $(MB2String $free) free"
|
Write-Output "✅ Swap space unused - $(MB2String $free) available"
|
||||||
} else {
|
} else {
|
||||||
[int64]$percent = ($used * 100) / $total
|
[int64]$percent = ($used * 100) / $total
|
||||||
Write-Output "✅ Swap space at $percent% of $(MB2String $total) - $(MB2String $free) free"
|
Write-Output "✅ Swap space at $percent% of $(MB2String $total) - $(MB2String $free) free"
|
||||||
|
Loading…
Reference in New Issue
Block a user