mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-29 13:14:49 +02:00
Update the scripts
This commit is contained in:
parent
3dcc84e4dd
commit
c05fcfe32b
@ -28,7 +28,7 @@ try {
|
|||||||
} elseif ($Temp -gt 50) {
|
} elseif ($Temp -gt 50) {
|
||||||
"✔️ CPU has $Temp °C: quite high"
|
"✔️ CPU has $Temp °C: quite high"
|
||||||
} elseif ($Temp -gt 0) {
|
} elseif ($Temp -gt 0) {
|
||||||
"✔️ CPU has $Temp °C: good"
|
"✔️ CPU has $Temp °C"
|
||||||
} elseif ($Temp -gt -20) {
|
} elseif ($Temp -gt -20) {
|
||||||
"✔️ CPU has $Temp °C: quite low"
|
"✔️ CPU has $Temp °C: quite low"
|
||||||
} else {
|
} else {
|
||||||
|
@ -31,7 +31,7 @@ try {
|
|||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
$Average = [math]::round($Count / $Elapsed, 1)
|
$Average = [math]::round($Count / $Elapsed, 1)
|
||||||
"✔️ DNS resolves $Average domains/sec ($Count domains in $Elapsed sec)"
|
"✔️ DNS resolves $Average domains/sec ($Count in $Elapsed sec)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
@ -30,7 +30,7 @@ try {
|
|||||||
write-warning "Drive $Drive has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
write-warning "Drive $Drive has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
"✔️ Drive $Drive has $Free GB left ($Used of $Total GB used)"
|
"✔️ Drive $Drive has $Free GB left ($Total GB total)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
@ -47,7 +47,7 @@ if ($IsLinux) {
|
|||||||
|
|
||||||
$Hostname = $(hostname)
|
$Hostname = $(hostname)
|
||||||
if ($Healthy) {
|
if ($Healthy) {
|
||||||
"✔️ $Hostname is healthy"
|
"✔️ $Hostname seems healthy"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} else {
|
} else {
|
||||||
write-warning "$Hostname is NOT healthy"
|
write-warning "$Hostname is NOT healthy"
|
||||||
|
@ -37,7 +37,7 @@ try {
|
|||||||
}
|
}
|
||||||
$Avg = $Avg / $Pings.count
|
$Avg = $Avg / $Pings.count
|
||||||
|
|
||||||
"✔️ Ping is $Avg ms average ($Min ms min, $Max ms max, using $($Pings.count) hosts)"
|
"✔️ Ping is $Avg ms average ($Min ms min, $Max ms max, $($Pings.count) hosts used)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
@ -39,7 +39,7 @@ try {
|
|||||||
write-warning "Swap space has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
write-warning "Swap space has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
"✔️ Swap space has $Free GB left ($Used of $Total GB used)"
|
"✔️ Swap space has $Free GB left ($Total GB total)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user