Using the SCOM Alert Criteria Parameters for OpsLogix ServiceNow Connector and Teams Connector for SCOM
You can construct a criteria expression to find objects in the Operations Manager database. The following sections provide syntax reference information that is useful when creating a criteria expression that includes any of the following elements:
-
Comparison operators
-
Wildcard characters
-
DateTime values
-
Integer enumeration values
Example
The example below will pull any alert in Resolution State 0 (New) and where the severity doesn't match 0 (Informational)
ResolutionState = 0 AND Severity != 0
Using the Operations Manager Shell, you can verify the results before applying the filters using Get-SCOMAlert.
Get-SCOMAlert -Criteria "ResolutionState = 0 AND Severity != 0"
The following example gives you Critical and Warnings from two specific Resolution States.
Get-SCOMAlert -Criteria "ResolutionState = 1 OR ResolutionState = 3 AND Severity != 0"
Comparison Operators
You can use comparison operators when constructing a criteria expression. The valid operators are described in the following table:
Operator | Description | Example(s) |
---|---|---|
=, == |
Evaluates to true if the left and right operand are equal. |
Name = 'mymachine.mydomain.com' |
!=, <> |
Evaluates to true if the left and right operand are unequal. |
Name != 'mymachine.mydomain.com' |
> |
Evaluates to true if the left operand is greater than the right operand. |
Severity > 0 |
< |
Evaluates to true if the left operand is less than the right operand. |
Severity < 2 |
>= |
Evaluates to true if the left operand is greater than or equal to the right operand. |
Severity >= 1 |
<= |
Evaluates to true if the left operand is less than or equal to the right operand. |
Severity <= 3 |
LIKE |
Evaluates to true if the left operand matches the pattern that is defined by the right operand. Use the characters in the wildcard table later in this topic to define the pattern. |
Name 'LIKE SQL%' Evaluates to true if the Name value is "SQLEngine." Name LIKE '%SQL%' Evaluates to true if the Name value is "MySQLEngine." |
MATCHES |
Evaluates to true if the left operand matches the regular expression defined by the right operand. For information about and examples of regular expression syntax, see the MSDN topic, .NET Framework Regular Expressions. |
Name MATCHES 'SQL*05' Evaluates to true if the Name value is "SQL2005." |
IS NULL |
Evaluates to true if the value of the left operand is null. |
ConnectorId IS NULL Evaluates to true if the ConnectorId property does not contain a value. |
IS NOT NULL |
Evaluates to true if the value of the left operand is not null. |
ConnectorId IS NOT NULL Evaluates to true if the ConnectorId property contains a value. |
IN |
Evaluates to true if the value of the left operand is in the list of values defined by the right operand.
|
Id IN ('080F192C-52D2-423D-8953-B3EC8C3CD001', '080F192C-53B2-403D-8753-B3EC8C3CD002') Evaluates to true if the value of the Id property is one of the two globally unique identifiers provided in the expression. |
AND |
Evaluates to true if the left and right operands are both true. |
Name = 'SQL%' AND Description LIKE 'MyData%' |
OR |
Evaluates to true if either the left or right operand is true. |
Name = 'SQL%' OR Description LIKE 'MyData%' |
NOT |
Evaluates to true if the right operand is not true. |
NOT (Name = 'IIS' OR Name = 'SQL') |
Wildcard Characters
The following table defines the wildcard characters you can use to construct a pattern when using the LIKE operator:
Wildcard | Description | Example |
---|---|---|
% |
A wildcard that matches any number of characters. |
Name LIKE 'SQL%' Evaluates to true if the Name value is "SQLEngine." Name LIKE '%SQL%' Evaluates to true if the Name value is "MySQLEngine." |
_ |
A wildcard that matches a single character. |
Name LIKE 'SQL200_' Evaluates to true for the following Name values: "SQL2000" "SQL2005" Note The expression evaluates to false for "SQL200" because the symbol _ must match exactly one character in the Name value.
|
[] |
A wildcard that matches any one character that is enclosed in the character set. Note Brackets are also used when qualifying references to MonitoringObject properties. For more information, see Defining Queries for Monitoring Objects.
|
Name LIKE 'SQL200[05]' Evaluates to true for the following Name values: "SQL2000" "SQL2005" The expression evaluates to false for "SQL2003." |
[^] |
A wildcard that matches any one character that is not enclosed in the character set. |
Name LIKE 'SQL200[^05]' Evaluates to true for "SQL2003." The expression evaluates to false for "SQL2000" and "SQL2005." |