![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
The following procedure shows how to build a test expression by specifying a test parameter and test operator in the Test screen. This example uses the MemUsage microagent method result field and a numeric operator.
1. Go to the Test screen.
Figure 12Test Editing Screen
The Test screen helps you create multiple tests.
3. Select Mem Usage from the Process Name dropdown list. This is used as the test parameter. (On UNIX, use Virtual KBytes.)Mem Usage is one of 10 result fields returned by the getProcess() method, the data source for this rule. The text area in the Microagents, Methods and Arguments screen displays a short description of each parameter. In the description for this method, you can see that Process Name is a string value, and Mem Usage is an integer.
4. Select the > operator from the Operator dropdown list. Only operators that apply to the current parameter are included in the list. Mem Usage is an integer field, so numeric operators are listed. All test operators are described on the following pages.
5.
6. Select the name of an existing schedule from the Schedule dropdown list to apply to this test. This is an optional field. By default, the test is always active. For more information, see Working with Schedules and Period Groups.
7. To specify Advanced option, click on the Show Advanced Options link. Refer to Using Advanced Test Features for further details.
8. Click the Apply Changes button to save the test expression.This test now checks for instances of the process rvd using more than 1000 Kilobytes, or 1 MB, of memory when the test is evaluated. If all instances found are using less than 1 MB of memory, no problem condition exists and the test is false. Since getProcess is a synchronous method, the agent evaluates the test every 60 seconds by default.
The test expression is true when the specified posted condition exists. This operator displays when a posted condition is selected in the parameter list. PostedConditionExists is equivalent to ${Posted.x} > 0. 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. !PostedConditionExists is equivalent to ${Posted.x} == 0 when x is the posted condition name.
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 Command microagent method result field and a text string operator, to the sample test expression. These instructions are provided in the test definition section (step 7 of Creating a Test section). Both conditions in the new test expression must be satisfied for the test to evaluate to true.This test checks for rvd processes started with specific command options.
2. Select Match All from the dropdown list to group the highlighted expression and add the AND operator.
3.
4. Figure 13Compound Test Fields
5. Click the Apply Changes button to insert the expression into the highlighted set of parentheses. The compound test now looks like the following:This test evaluates to true when the specified rvd process uses more than 1000 Kilobytes, or 1 MB of memory. If the memory threshold is exceeded, the test could trigger an action for restarting the process and notifying the system administrator. For more information, see Creating Actions.Processes named rvd that were started using different parameters, such as -listen tcp:7475 are unaffected.
6. Click the Apply Changes button to save the test.A test includes the test expression (such as Processes > 10) and any extra conditions, such as counters, timers and additional tests. These advanced options add extra requirements for a test to evaluate as true or false.
1. Figure 14 Advanced Options
2. To specify a true test counter, type the number of true evaluations in the True Test Counter field. The default value is 1.With a true test counter, the action is triggered only after the test expression has been true for the specified number of test evaluations. For example, to check for consistently high CPU usage and ignore any brief spikes, you could 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.
3.
− 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: Click Edit Clear Test to 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.then click the Apply & Add Action button.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |