Tuesday, December 25, 2018

Hawk Display Overview | Create Hawk Rulebase To monitor BW Application

Before moving onto the post, Follow the earlier post to get overview on "TIBCO Hawk Components and how hawk communication happens in a TIBCO domain?".

       The Hawk Display discovers agents through the heartbeats that they sent on the network. It can then interact with these agents and configure the Rulebases, Rules, Schedules for these agents. It can also listen to alerts and notifications sent by these agents, and display them in various windows.

A Hawk Display can run anywhere on the network, as it is not a centralized console. Multiple Hawk displays can be run on the network as well.

To demonstrate this, We consider the below TIBCO domain and the application which we are going to monitor by using Hawk :

TIBCO Domain : TechsNib_Domain - created in earlier post, How to create TIBCO Administrator Domain?
TIBCO Application : TechsNibApp - Deployed in earlier post, How to deploy application in TIBCO Administrator Domain?

Follow the below steps to connect to Hawk Display and to create a Hawk Rulebase to monitor application deployed to one of BW machines in an TIBCO Administration domain.

STEP-1 : Configure the HAWK configuration with domain name and transport details.

In Windows, Navigate to Start --> All Programs --> TIBCO --> Hawk --> Click on Hawk Configuration icon and update as below.

NOTE: If transport is EMS and it is in FT mode, please try to connect to active EMS transport and finally save the configuration.

STEP-2 : Open the Hawk Display as mentioned below.

In Windows, Navigate to Start --> All Programs --> TIBCO --> Hawk --> Click on Hawk Display icon and it will show you the list of Hawk Agent(s) exist in a domain.

As it is a domain exist in a local machine, So we can see only one Hawk Agent as below :

The Hawk Agent needs to be configured with a set of rules ( i.e. Rulebase) that it can use to monitor the applications and operating system on the machines. So we can create the rules through Hawk Display.

STEP-3 : Create Rulebases using TIBCO Hawk Display. After creating the rulebase you can save it to a file or distribute it to agents on the network.

To create a new Rulebase :

i) In TIBCO Hawk Display, right-click on the agent icon where you want to create the rulebase, and select Get Configuration> Rulebases from the menu.

ii) The Rulebase list for Agent dialog displays. This dialog lists rulebases loaded by the selected agent and provides options for performing rulebase options. To create new Rulebase,click on create icon as shown below :
iii) The Rulebase Editor displays as follows, Type the "Rulebase Name" field. The rulebase name must be unique on the agent. Click create on the toolbar to begin the Rule building process.
       A Rulebase must have at least one rule, a rule must have at least one test, and a test have at least one action. Now we see building a Rule, contains instructions for specifying a data source, and defines tests an actions in a Rule.

STEP-4 : Next step, Build the Rule :-

       Rules consists 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.

use-case : we are going to create Rules to monitor the BW application to know the status whether it is RUNNING or STOPPED. In turn, Hawk sends notifications/alerts and also starts the application automatically once it is STOPPED.

To create a new Rule on an agent, Click Edit next to the Data Source field. The Microagents, Methods and Arguments dialog displays :

STEP-5 : Configure DataSource :-

This dialog contains a list of microagents you can use as a data source for the Rule. TIBCO Hawk default microagents are listed, along with microagents for TIBCO applications, gateways and instrumented applications.

MicroAgent of TIBCO application will look like :
Example : COM.TIBCO.ADAPTER.bwengine.TechsNib_Domain.TechsNibApp.Process Archive

Specify data source by configuring microagent, method and arguments is as below and then Click "OK" button.

       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.

STEP-6 : As per use-case, configure Test-1 with one test condition and one Action :-

In Rule Editor dialog, click on create Test and write the test condition in "Test Builder" dialog and then click "OK" button.

Then click on create Action that needs to be performed once rule satisfy the condition specified in the earlier step.

in Action Editor, we can view the below list of Action Types :

Alert      --> Sends an Alert message to TIBCO Hawk Display

Execute     --> Executes a command on TIBCO Hawk agent machine like custom scripts.

Notification   --> Sends notification message to TIBCO Hawk display

Method     --> Invokes a microagent method on the TIBCO Hawk agent machine

Email      ---> To send an email message

Post Condition ---> Creates a posted condition to use in another rule in the same Rulebase.

We consider Notification action type with message as below :

NOTE: We can use Insert button to get ${Internal.Hawk Domain}, ${Internal.Agent Name} internal variables.

STEP-7 : Similar way, configure Test-2 with one test condition and two different actions :-

STEP-8 : Click on "OK" button(s) to save the configuration and then click on "Apply Changes" button in "Rulebase List For Agents" dialog to save Rulebase to an agent.

NOTE: Once click on "Apply Changes" button, rulebase file (BWEngineStart.hrb) will be saved to <<TRA_HOME>>/domain/TechsNib_Domain/autoconfig location with ".hrb" as extension.

STEP-9 : Test the Rulebase :-

Stop the "TechsNibApp" application and you can observe that Hawk automatically starts the application and can check Hawk Alerts either through Hawk Display (or) from TIBCO Administrator web console (Monitoring Management --> All Alerts).

No comments:

Post a Comment

back to top