Solved Monitor Type with 1 expression for healthy and 2 for warning
Trying to get this to work but all shows healthy when there are som that should be warning.
Anyone notice where i might have gone wrong, cant find that many examples online.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<ConditionDetection ID="UnderWarningFilter" TypeID="System!System.ExpressionFilter"> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="Integer">Property[@Name='PendingCount']</XPathQuery> </ValueExpression> <Operator>LessEqual</Operator> <ValueExpression> <Value Type="Integer">$Config/PendingCountThreshold$</Value> </ValueExpression> </SimpleExpression> </Expression> </ConditionDetection> <ConditionDetection ID="OverWarningFilter" TypeID="System!System.ExpressionFilter"> <Expression> <And> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="Integer">Property[@Name='PendingCount']</XPathQuery> </ValueExpression> <Operator>Greater</Operator> <ValueExpression> <Value Type="Integer">$Config/PendingCountThreshold$</Value> </ValueExpression> </SimpleExpression> </Expression> <Expression> <SimpleExpression> <ValueExpression> <XPathQuery Type="Integer">Property[@Name='DaysSincePatched']</XPathQuery> </ValueExpression> <Operator>Greater</Operator> <ValueExpression> <Value Type="Integer">$Config/DaysSincePatchedThreshold$</Value> </ValueExpression> </SimpleExpression> </Expression> </And> </Expression> </ConditionDetection> |
Best answer
It works as expected. There was a blank space before a ‘ in the add.propertybag part of the MP.
An <And> expression means ALL of the expressions inside must resolve in order for the filter to be selected.
You need to use an <Or> expression which means if ANY one of the expressions inside resolves then the filter is selected.
Answer this question
To reply or comment, use the 'Comment' link on the relevant answer or question.