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


Appendix D Application Monitoring and Management by Processing Rulebases : Building a Rule

Building a Rule
Most monitoring tasks consist of periodic checking for some problematic conditions. When a problem is detected, an alarm is sent or corrective actions are taken. If the application goes down, for example, capture some diagnostics and execute a startup script. If too much disk space is consumed, delete some temporary files. If duplicate processes are running, terminate the most recent one. When you create a rule, you specify this monitoring logic and package it for a TIBCO Hawk agent. The agent can apply the rule again and again without intervention. If a problem occurs, the agent can solve it by taking corrective action, or notify you that the problem requires attention, or both, depending on rule design.
For example, a notification is sent if the heartbeat of Interior Server Instance or the last heartbeat of a Gateway Instance is detected. An alarm is sent if the Poller is potentially hung, so you can execute the method to destroy the hanging thread when the Poller is hung. The inbound or outbound information can also be sent to TIBCO Administrator GUI.
Rules consist of data sources, tests, and actions. Data sources are microagent methods that periodically collect or asynchronously return information to an agent. One or more tests are applied to the resulting data set. When a particular test evaluates to true, one or more actions can be triggered.
To create a new rule on an agent, click Edit next to the Data Source field.
Figure 53 Creating a New Rule
This window contains a list of microagents you are allowed to use as a data source for the rule. TIBCO BusinessConnect microagents are listed, for example, the Gateway Instance, Interior Server Instance, and Pollers.
Export MAD allows you to save the microagent descriptor in its XML representation. For more information on exporting and importing microagent descriptors using their XML representation, refer to TIBCO Hawk Configuration Object API Reference.
See Building a Rule in TIBCO Hawk Administrator’s Guide for more details.
Specifying a Data Source
The data source for a rule is its source of input data, and is always a method of a microagent. When a rule is active, the TIBCO Hawk agent subscribes to the specified method and passes method results to the test. The following example uses the BusinessConnect-zhezhang-dt-Interior-Server_name=CANCELPOLLER microagent as a representative data source.
To define the data source of a rule, perform the following steps:
1.
Click the BusinessConnect-zhezhang-dt-Interior-Server_name=CANCELPOLLER microagent.
2.
Click the _getisHung method.
Fields for method arguments and a data delivery interval are displayed on the right side of the window. A detailed text description of the method, including arguments and return values, is displayed in the lower panel.
3.
When invoked, the _getisHung() method returns information about the status of the CANCELPOLLER thread.
This is a synchronous method. When the rule is active, the agent subscribes to this method and receives data every 60 seconds, by default. For asynchronous methods, such as onMBeanNotification() in the BusinessConnect-zhezhang-dt-Interior-Server:type=mgmt,name=InteriorController-Heartbeat microagent, no collection interval is required.
Figure 54 Specifying a Data Source
4.
The rule is now configured to use the _getisHung() method of the BusinessConnect-zhezhang-dt-Interior-Server_name=CANCELPOLLER microagent as a data source. In the Rule Editor window, _getisHung():60 is displayed in the Data Source field.

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