I have a problem. I want to create an SCOM subscription that filters my alarms. The problem is I want to check for multiple values of a single attribute.
Problem:
Alarm Severity critical and Custom Field 8 must not contain A or B.
The XML OR group is accepted by SCOM when updating, but the subscription does not work.
Regex is not supported: -> no success
The element ‘Expression’ has invalid child element ‘RegExExpression’. List of possible elements expected: ‘SimpleExpression, UnaryExpression, And, Or’.
Last idea was the use of SQL-style Wildcards… -> no success
SCOM works in this case with the ‘like’ operator and in this case i need the ‘notlike’. I have updated the operator to notlike at the subscription and the update was a success but the subscription stopped working…
This is the reason why I gave up on SCOM:s notification and built my own. Also the lack of “where criteria not like”
I use powershell and get-scomalert | where- yadayada…
In your example, are you just interested in alerts with a resolution status of new or all alerts (severity = critical, custom field 8 <> A and <> B? I’ll give this a spin my lab.
If you take the scripting route suggested by jannep then ideally use get-scomalert -criteria rather than get-scomalert | where …
If I change the Alert Resolution State of a critical alert to “Test:” which has a value of 10 and Custom Field 8 to either A or B then I do not get a notification.
If I change the Alert Resolution State of a critical alert to “Test:” which has a value of 10 and Custom Field 8 to something other than A or B then I do get a notification.
Is this what you are looking for? You probably want to change the resolution state to zero but other than that I “think” that is what you wanted ??