Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Appendix D Application Monitoring and Management by Processing Rulebases : Defining Tests

Defining Tests
The data source of a rule provides information about some conditions on a managed node. After information is received, one or more tests are applied to evaluate it. Each sample of data from the data source is distributed to all tests in the rule. Each test uses the data to compute a true or false value which is used in determining when to trigger actions.
See Defining Tests in TIBCO Hawk Administrator’s Guide for more details.
Creating a New Test
To create a new test in the current rule, perform the following steps:
1.
In the Rule Editor window, click Create on the toolbar.
2.
In the Test Editor window, the If field is for the test expression, which you create in the Test Builder window. You access this window by clicking Edit. The Then field is for one or more actions to perform if the test evaluates to true, which you specify in the Action Editor window. You access this window using toolbar buttons in the Test Editor window.
3.
Click Edit next to the If field.
Figure 55 Creating a New Test
A test consists of a test expression and other parameters that determine how and when the test is applied. Tests created in the Test Builder window have the following form:
If <expression is true> then <perform actions>
The first set of angle brackets contains the test expression. It consists of a parameter, a return value of the microagent method used as a data source, and a test operator, such as isTrue. Test operators you can use in an expression depend on the type of value returned by the microagent method. Numeric, string and Boolean values can all be used as input in a test expression.
Building a Test Expression
The following procedure shows how to build a test expression by specifying a test parameter and test operator in the Test Builder window. This example uses the BusinessConnect-zhezhang-dt-Interior-Server:name=GatewayInstance-192.168.69.105-11000 microagent _getinboundReceivedHTTP() method result field and a numeric operator.
1.
Click inboundReceivedHTTP to use as the test parameter.
inboundReceivedHTTP is returned by the _getinboundReceivedHTTP() method, the data source for this rule. The text area in the Microagents, Methods and Arguments window displays a short description of each parameter. In the description for this method, you can see that inboundReceivedHTTP is a double value.
2.
Click > in the Operator field. Only operators that apply to the current parameter are included in the list. inboundReceivedHTTP is a double value, so numeric operators are listed.
3.
Type 1000 in the Greater than field.
4.
Click OK to save the test expression.
This test checks the HTTP inbound value of the Gateway Instance. If the value is less than 1000, no problem occurs and the test is false. Since the _getinboundReceivedHTTP() is a synchronous method, the agent evaluates the test every 60 seconds by default.
See Building a Test Expression in TIBCO Hawk Administrator’s Guide for more details.
Building Compound Tests
A compound test uses the same operators as a simple test, but allows you to combine multiple expressions using the logical operators AND, NOT, and OR. You can group expressions and insert operators in the compound test editor.
The following procedure shows how to build a compound test expression by modifying a simple expression. This example adds a second condition, using the BusinessConnect-zhezhang-dt-Interior-Server:name=GatewayInstance-192.168.69.105-11000 microagent _getinboundReceivedHTTP() method result field and a text string operator, to the sample test expression on page 292. Both conditions in the new test expression must be satisfied for the test to evaluate to true.
To build a compound test, perform the following steps:
1.
In the Test Editor window, click Compound. The current text expression is highlighted in the Test Expression field, for example:
(inboundReceivedHTTP > 1000.0)
This test checks for the inboundReceivedHTTP value is greater than a specific number.
2.
Click And to group the highlighted expression and add the AND operator. The compound test editor automatically adds the correct number of parentheses to the expression:
Figure 56 Building a Compound Test
3.
In the lower half of the window, click inboundReceivedHTTP in the Parameter field and the < in the Operator field.
4.
In the Less than field, type 2000.
5.
Click Apply to insert the expression into the highlighted set of parentheses. The compound test now looks like the following:
((inboundReceivedHTTP > 1000.0) AND (inboundReceivedHTTP <    2000))
This test evaluates to true when the specified value in the inboundReceivedHTTP process is greater than 1000, and less than 2000. If the threshold is exceeded, the test triggers an action for restarting the process and notifying the system administrator. For more information, see Defining Actions.
6.
Click OK to save the test, or Undo to cancel the last change.
Using Advanced Test Features
A test includes the test expression, such as inboundReceivedHTTP > 10 and any extra conditions, for example, counters, timers and additional tests. These advanced options add extra requirements for a test to be evaluated as true or false.
To access advanced test options, see Using Advanced Test Features in TIBCO Hawk Administrator’s Guide for more details.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved