I have a template setup with about 5-6 Powershell monitors calling Perfmon counters on servers. These monitors randomly go into an Unknown status with the error;
PowerShell script error. Scripting Error: Script does not contain the expected parameters or is improperly formatted. 'Statistic' missing.
It will return to normal again a short time later. Testing, running script output, etc. seems to fix it temporarily, but then another will randomly go unknown again. Its like playing whack a mole because different ones randomly do this.
I opened a case with Support and they suggested increasing polling timeout values, but that doesn't seem to work. One is currently set to 2000 seconds and it still does this. Any insight into solving this would be appreciated. I have a NOC team who loses their minds if anything is a color other than green. Here's an example of one of the scripts;
$data = get-counter "\\${IP}\ASP.NET Applications(__Total__)\Sessions Active"
$count = $data.CounterSamples.CookedValue
write-host "Statistic:$count"