update scripts
This commit is contained in:
parent
566cebdc96
commit
a5a3637b5c
14 changed files with 6289 additions and 5805 deletions
15
Scripts/Get-NetUtilMon.ps1
Normal file
15
Scripts/Get-NetUtilMon.ps1
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue