Advertisement
stephanlinke

Untitled

Nov 11th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $CPUCurrentLoad = (get-counter -Counter "\processor(_total)\% processor time" -SampleInterval 1 -MaxSamples 15 | select -ExpandProperty countersamples | select -ExpandProperty cookedvalue | Measure-Object -Average).average
  2. if($CPUCurrentLoad -ge 90){
  3.     Write-Host "Load is exceeding threshold, restarting probe service..."
  4.     Get-Service -Computer Percy -Name PRTGProbeService | Restart-Service
  5. }
  6. Else
  7. {Exit}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement