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
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
|
||||||||||||
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,
|
||||||||||||
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 ( For example, the following test condition joins two expressions by using the
|
||||||||||||
5 |
Logical operator |
Select the logical operator to join two expressions. The values are: For example, the following test condition joins two expressions by using the
|
||||||||||||
6 |
NOT operator for expression |
Select this For example, the following test condition has an expression whose result is negated by using the
|
||||||||||||
7 |
NOT operator for expressions set |
Select this For example, the following is the test expression when the
|
||||||||||||
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:
|
||||||||||||
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.
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 |
||||||
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 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:
For example, a test monitors each line in a log file for the string |
Test Operators Reference
The following tables describe the test operators you can apply to numeric, text and Boolean test variables while building test expressions.
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 |
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. |
The test expression is true when a match is found by using a regular expression as an operator value. |
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. |