File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 7
7
Specifies the minimum level in MB (10 MB by default)
8
8
. EXAMPLE
9
9
PS> ./check-swap-space.ps1
10
- ✅ Swap space uses 21% of 1GB - 1005MB free
10
+ ✅ Swap space uses 1GB ( 21%) of 5GB
11
11
. LINK
12
12
https://github.com/fleschutz/PowerShell
13
13
. NOTES
@@ -48,14 +48,14 @@ try {
48
48
if ($total -eq 0 ) {
49
49
Write-Output " ⚠️ No swap space configured"
50
50
} elseif ($free -eq 0 ) {
51
- Write-Output " ⚠️ Swap space is full ( $ ( MB2String $total ) ) "
51
+ Write-Output " ⚠️ Swap space with $ ( MB2String $total ) is FULL !!! "
52
52
} elseif ($free -lt $minLevel ) {
53
- Write-Output " ⚠️ Swap space has only $ ( MB2String $free ) of $ ( MB2String $total ) left"
53
+ Write-Output " ⚠️ Swap space has only $ ( MB2String $free ) of $ ( MB2String $total ) left! "
54
54
} elseif ($used -lt 3 ) {
55
- Write-Output " ✅ Swap space unused - $ ( MB2String $free ) available "
55
+ Write-Output " ✅ Swap space has $ ( MB2String $total ) reserved "
56
56
} else {
57
- [int64 ]$percent = ($free * 100 ) / $total
58
- Write-Output " ✅ Swap space has $ ( MB2String $free ) of $ ( MB2String $total ) left ( $percent % )"
57
+ [int64 ]$percent = ($used * 100 ) / $total
58
+ Write-Output " ✅ Swap space uses $ ( MB2String $used ) ( $percent %) of $ ( MB2String $total ) "
59
59
}
60
60
exit 0 # success
61
61
} catch {
You can’t perform that action at this time.
0 commit comments