Test Condition Builder Reference

You can define a simple test condition by using just a test variable, a test operator, and a test value. If needed, you can also define a compound test condition by using multiple test expressions at multiple levels joined by logical operators.

Test Condition Builder Core Elements

The following figure shows a sample compound test condition and has numbers to mark different test elements. The following table lists the test elements marked in the figure that you can use to define the test condition.

Figure 44: Sample Test Condition with Element Markers

Test Condition Elements

Legend No.

Test Element

Description

1

Test variable

Select the test variable for your test expression. The drop-down lists all the result fields of the microagent method used in the parent rule.

For example, the following variables are listed for the Self:getUptime() method:

Uptime
Total days
Total hours
Total millisec

2

Test operator

Select the test operator for your test expression. The drop-down lists all the valid test operators based on the data type of the test variable.

For the list of operators displayed based on the data type, see Test Operators Reference.

3

Test value

Enter the value of the test variable that you want to check for the test condition. Provide the values according to the data type of the test variable.

When a test variable, the test operator, and a test value are provided, a test expression is created. For example,

Uptime !Equals 0

4

Add Expression

Click the Add Expression icon to add one more expression to the test condition at the same level. The expressions are joined by using the logical operator specified (AND or OR)

For example, the following test condition joins two expressions by using the AND operator:

((Uptime !Equals 0) AND (NOT (Total hours < 20))

5

Logical operator

Select the logical operator to join two expressions. The values are: AND and OR. You can use the Add Expression icon to add one more expression to the test condition.

For example, the following test condition joins two expressions by using the AND operator:

((Uptime !Equals 0) AND (NOT (Total hours < 20))

6

NOT operator for expression

Select this NOT operator for the expression if you want to negate the result of that single expression.

For example, the following test condition has an expression whose result is negated by using the NOT operator:

((Uptime !Equals 0) AND (NOT (Total hours < 20))

7

NOT operator for expressions set

Select this NOT operator for the set of expressions if you want to negate the result of that set of expressions.

For example, the following is the test expression when the NOT operator is selected:

(NOT ((Uptime !Equals 0) AND (NOT (Total hours < 20)))

8

Add sub-expression

Click to add a sub-expression, that is another set of test expression that is one level under (nested).

For example, the following test condition has two expressions at the same level but another set of expression is nested:

((Uptime !Equals 0) AND (NOT (Total hours < 20)) AND ((Total days == 1) AND (Total hours == 5)))

9

Remove Expression

Click the Remove Expression icon to remove the test expression from the test condition.

Note: You must have at least one test expression to create a test condition.

Advance Options Fields

The following table lists the Advance Options fields displayed for the new test.

 

Test Condition Advance Options Fields

Fields

Description

True Count Threshold

Enter the number of true evaluation for the test condition after which the action is triggered.

For example, to check for consistently high CPU usage and ignore any brief spikes, you can set the true test counter for the test to five. The action is triggered when the test expression (CPU use high) is true for five consecutive test evaluations.

The default value is 1.

Schedules

Select the schedule that you want to apply for the test. The drop-down lists all the schedules deployed on the Hawk agent.

The drop-down also lists the negative of the schedules as well, which when selected means that the conditions are checked at times other than the schedule. For example, if the Weekend schedule defines the time interval for every Saturday and Sunday then the !Weekend schedule means the time interval other than every Saturday and Sunday.

By default, the test is always active.

For more details about schedules, see Schedule Management.

Clear Condition Policy

Select a clear condition for the test. The values are:

(Default)CLEAR_ON_FIRST_FALSE - After the test becomes true, the test is cleared when the first time the test changes from true to false. This is the default behavior for a test with a synchronous data source.
CLEAR_TIMER - Specify a wait interval in seconds. After the test becomes true it remains true until this interval has passed without an additional true test. This is the default behavior for a test with an asynchronous data source, and the default wait interval is 900 seconds (15 minutes).
CLEAR_TEST - Specify an extra test expression for clearing the test. After the test becomes true, it becomes false only when the clear test expression becomes true. The clear test uses the microagent method result fields of the data source as input.

For example, a test monitors each line in a log file for the string Feed Line Down. If this string is found, an alert is generated. A clear test for the original test checks for a log file line that signals the condition is resolved, such as Feed Line Up. When the clear test evaluates to true, the original alert message is cleared.

Test Operators Reference

The following tables describe the test operators you can apply to numeric, text and Boolean test variables while building test expressions.

Test Operators for Numeric Method Results

Operator

Description

==
!
=

The test expression is true when the value of the test parameter is (equal to, not equal to) the operator value.

<
<=
>
>=

The test expression is true when the value of the test parameter is (less than, less than or equal to, greater than, greater than or equal to) the operator value.

InRange

The test expression is true when the value of the test parameter is between two extremes of a range. Endpoints are included.

OutOfRange

The test expression is true when the value of the test parameter is outside the range of two operator values. Endpoints are excluded.

Increase

The test expression is true when the value of the test parameter has increased at least by the operator value between two successive test evaluations. For example, the amount of disk space in use has increased by more than 10 MB in a sample period.

%Increase

The test expression is true when the value of the test parameter increases by at least the operator value as a percentage (the increase divided by the previous value times 100) between two successive test evaluations. For example, the amount of disk space in use has increased by more than 10 percent in a sample period.

Decrease

The test expression is true when the value of the test parameter decreases by at least the operator value between two successive tests.

%Decrease

The test expression is true when the value of the test parameter decreases by at least the operator value as a percentage (the decrease divided by the previous value times 100) between two successive test evaluations.

NetChange

The test expression is true when the value of the test parameter increases or decreases by at least the operator value between two successive test evaluations. The operator value specifies the absolute value of the increase or decrease.

%NetChange

The test expression is true when the value of the test parameter increases or decreases by at least the operator value as a percentage (the increase or decrease divided by the previous value times 100) between two successive test evaluations. The operator value specifies the absolute value of the percentage increase or decrease.

postedConditionExi

sts

The test expression is true when the specified posted condition

exists. This operator displays when a posted condition is

selected in the parameter list. For more information, see Creating and Using Posted Conditions in Hawk Console

!postedConditionEx

ists

The test expression is true when the specified posted condition

does not exist. This operator displays when a posted condition

is selected in the parameter list. For more information, see Creating and Using Posted Conditions in Hawk Console

 

 

Test Operators for Text String Results

Operator

Description

Equals

The test expression is true when the value of the test parameter exactly matches the operator value. This is a case-sensitive match.

!Equals

The test expression is true when the value of the test parameter does not exactly match the operator value. This is a case-sensitive match.

StartsWith

The test expression is true when the value of the test parameter starts with the operator value. This is a case-sensitive match.

Contains

The test expression is true when the value of the test parameter contains the operator value. This is a case-sensitive match.

!Contains

The test expression is true when the value of the test parameter does not contain the operator value. This is a case-sensitive match.

Perl5 PatternMatch

The test expression is true when a match is found by using a regular expression as an operator value.

 

Test Operators for Boolean Results

Operator

Description

isTrue

The test expression is true when the value of the test parameter is true.

isFalse

The test expression is true when the value of the test parameter is false.