update scripts

This commit is contained in:
Alex Kup 2023-10-03 22:02:33 +03:00 committed by GitHub
parent 566cebdc96
commit a5a3637b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 6289 additions and 5805 deletions

View file

@ -0,0 +1,15 @@
$WARNING = 25
$CRITICAL = 50
$Interface = $(Get-Counter).CounterSamples.Path[0]
$TransferRate = ((Get-Counter $Interface).countersamples | select -ExpandProperty CookedValue)*8
$NetworkUtilisation = [math]::round($TransferRate/1000000000*100,2)
if ($NetworkUtilisation -gt $CRITICAL){
Write-Output "CRITICAL: $($NetworkUtilisation) % Network utilisation, $($TransferRate.ToString('N0')) b/s"
# exit 2
}
if ($NetworkUtilisation -gt $WARNING){
Write-Output "WARNING: $($NetworkUtilisation) % Network utilisation, $($TransferRate.ToString('N0')) b/s"
# exit 1
}
Write-Output "OK: $($NetworkUtilisation) % Network utilisation, $($TransferRate.ToString('N0')) b/s"
# exit 0