Hi,
First off thank you so much for developing and sharing the PAL tool, it’s a fantastic to parse and analyse large amounts of data
What I am trying to achieve is to set two thresholds based on an average and a maximum value.
An example of this would be for the following Exchange 2010 counter, where I want to have a warning for an average value of higher than 20 and for a maximum value higher than 50.
Counter: \\*\MSExchange Database Instances(*)\I/O Database Reads Average Latency
Average: Should be 20 ms on average.
Max: Should show 50 ms spikes.
Source: https://technet.microsoft.com/en-us/library/bb201689(v=exchg.80).aspx
Taking the following example counter below from the “SamplePerfmonLog.blg” file, I have attempted to change the threashold values as per below to try and achieve what I am after using the following logic:
\Processor(*)\% Privileged Time
Avg (20) -gt 20 = True
Max (53) -gt 60 = False
Standard Return Stats:
Condition \Processor(*)\% Privileged Time Min Avg Max
OK ZACH-PC/_Total 15 30(Warn) 53(Crit)
OK ZACH-PC/0 15 30(Warn) 53(Crit)
What I would like returned :
Condition \Processor(*)\% Privileged Time Min Avg Max
OK ZACH-PC/_Total 15 30(Warn) 53
OK ZACH-PC/0 15 30(Warn) 53
Warning PowerShell Threshold Code:
```
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg -Operator 'gt' -Threshold 20
```
Critical PowerShell Threshold Code:
```
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessorPercentPrivilegedTimeAll[0].Max -Operator 'gt' -Threshold 60
```
When running PAL with the above amendments, it errors with the following:
Overall progress... Status: Applying thresholds, PAL 2.7.5 Progress: 82%... Applying thresholds, Processor % Privileged Time
An error occurred on...
For ($i=0;$i -lt $CollectionOfCounterInstances.Count;$i++)
At D:\\PAL_Flatfiles_v2.7.5_x64\PAL.ps1:4036 char:15 + For ($i=0;$i -lt $CollectionOfCounterInstances.Count;$i++) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Am I declaring the correct values within the PowerShell or is there something else I should be doing, as no matter what I but in the Powershell code it is always treating the values as the same .
I have tried the following but still had to joy
```
$CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg
$($CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg)
$($CollectionOfProcessorPercentPrivilegedTimeAll[0]).Avg
$($CollectionOfProcessorPercentPrivilegedTimeAll).Avg
```
Many thanks
James
Comments: ** Comment from web user: brownjamesauk **
First off thank you so much for developing and sharing the PAL tool, it’s a fantastic to parse and analyse large amounts of data
What I am trying to achieve is to set two thresholds based on an average and a maximum value.
An example of this would be for the following Exchange 2010 counter, where I want to have a warning for an average value of higher than 20 and for a maximum value higher than 50.
Counter: \\*\MSExchange Database Instances(*)\I/O Database Reads Average Latency
Average: Should be 20 ms on average.
Max: Should show 50 ms spikes.
Source: https://technet.microsoft.com/en-us/library/bb201689(v=exchg.80).aspx
Taking the following example counter below from the “SamplePerfmonLog.blg” file, I have attempted to change the threashold values as per below to try and achieve what I am after using the following logic:
\Processor(*)\% Privileged Time
Avg (20) -gt 20 = True
Max (53) -gt 60 = False
Standard Return Stats:
Condition \Processor(*)\% Privileged Time Min Avg Max
OK ZACH-PC/_Total 15 30(Warn) 53(Crit)
OK ZACH-PC/0 15 30(Warn) 53(Crit)
What I would like returned :
Condition \Processor(*)\% Privileged Time Min Avg Max
OK ZACH-PC/_Total 15 30(Warn) 53
OK ZACH-PC/0 15 30(Warn) 53
Warning PowerShell Threshold Code:
```
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg -Operator 'gt' -Threshold 20
```
Critical PowerShell Threshold Code:
```
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessorPercentPrivilegedTimeAll[0].Max -Operator 'gt' -Threshold 60
```
When running PAL with the above amendments, it errors with the following:
Overall progress... Status: Applying thresholds, PAL 2.7.5 Progress: 82%... Applying thresholds, Processor % Privileged Time
An error occurred on...
For ($i=0;$i -lt $CollectionOfCounterInstances.Count;$i++)
At D:\\PAL_Flatfiles_v2.7.5_x64\PAL.ps1:4036 char:15 + For ($i=0;$i -lt $CollectionOfCounterInstances.Count;$i++) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Am I declaring the correct values within the PowerShell or is there something else I should be doing, as no matter what I but in the Powershell code it is always treating the values as the same .
I have tried the following but still had to joy
```
$CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg
$($CollectionOfProcessorPercentPrivilegedTimeAll[0].Avg)
$($CollectionOfProcessorPercentPrivilegedTimeAll[0]).Avg
$($CollectionOfProcessorPercentPrivilegedTimeAll).Avg
```
Many thanks
James
Comments: ** Comment from web user: brownjamesauk **
Issue resolved, added new functions as detail here: https://pal.codeplex.com/discussions/650364