Thursday, December 27, 2018

Configuring TIBCO Hawk for EMS - To Monitor Queues, Topics


    We can use TIBCO Hawk to administer and monitor the TIBCO Enterprise Message Service (EMS) server. TIBCO Hawk EMS microagent enables TIBCO Hawk to monitor and manage EMS servers.

    When installing TIBCO Hawk, if "Adapters and Plug-ins" option is selected, then installer installs the hawkemsadmin.hma file.
This file is installed in the <<TIBCO_HOME>>/hawk/<version>/plugin/ems folder and it is used by TIBCO Hawk EMS microagent.

Follow the below steps to configure EMS microagent plug-in :

STEP-1 : Before configuring microagent, make sure that EMS server is up and running. To start EMS server, follow link.

STEP-2 : Copy the hawkemsadmin.hma file from <<TIBCO_HOME>>/hawk/<version>/plugin/ems to <<CONFIG_FOLDER>>/hawk/plugin folder.

STEP-3 : Edit <<CONFIG_FOLDER>>/hawk/plugin/hawkemsadmin.hma file with below list of changes.

i) Specify the Hawk microagent class you wish to use in the <classname> element. EMS has provided below two different classes which are used to monitor the server. We are using the default configuration with HawkController class.

HawkListener  - This class is used only if you want to monitor the server.
HawkController - This class is used if you wan to do both monitor and manage the server.

ii) Specify the username, password and server URL to use to connect to the TIBCO EMS server in the appropriate tags.

STEP-4 : Edit and update the Hawk microagent plug-in directory location in hawkagent.cfg file located in <<TRA_HOME>>\domain\<<DOMAIN_NAME>> folder is as follows :

Update entry : hma_plugin_dir <<CONFIG_FOLDER>>/hawk/plugin

NOTE :
  Make sure that same hawkagent.cfg file is configured in the "hawkagent_<<DOMAIN_NAME>>.tra" file as this config is used while restarting the Hawk Agent.

STEP-5 : Restart the Hawk Agent.

In Windows, Navigate to and start the Hawk Agent as follows:
<<TRA_HOME>>\domain\<<DOMAIN_NAME>>\hawkagent_<<DOMAIN_NAME>>.exe

STEP-6 : 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. Right-click on the agent icon and click on GetMicroAgetns, now you can view the the EMS micro-agent as follows :


Now you can write the rulebases to monitor the destinations (Queues and Topics),Server running status..etc on EMS server.


Read More »

Wednesday, December 26, 2018

TIBCO Hawk - MAR File Deployment


Before moving onto the post, Be familiarize with earlier posts on:
TIBCO Hawk Components and how hawk communication happens in a TIBCO domain?.
Hawk Display Overview | Hawk Rulebase creation To Monitor BW Application.

    The Monitoring Archive(.mar) file contains one or more monitoring configurations. A monitoring configuration is a TIBCO Hawk rulebase template.

    The MAR utility is introduced in Hawk 4.6.0 version and it converts TIBCO Hawk Rulebases into templates so that they can be deployed to any target within any TIBCO Administration Domain.

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

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

Follow the below steps to create and deploy mar file by using MAR utility and Monitoring Console :

STEP-1 : Take the .hrb file (BWEngineStart.hrb) that is created in earlier post by using Hawk Display. The default location of the hrb file is autoconfig folder.
i.e. <<TRA_HOME>>/domain/TechsNib_Domain/autoconfig.

Move the file to some other location C:\Mar\BWEngineStart.hrb as we need to update the file with some generic values, to make it as a template rulebase to create the Mar file.

STEP-2 : Then create a template rulebase, in this rulebase (C:\Mar\BWEngineStart.hrb), you must use the following variable substitution to replace the value(s). such as deployment name, component instance name. These variables would be replaced as long as you deploy the template rulebase in your applications.

%%TIBCO_DOMAIN%%
%%TIBCO_DEPLOYMENT%%
%%TIBCO_COMPONENT_INSTANCE%%
%%TIBCO_COMPONENT_TYPE%%
%%TIBCO_DOMAIN_HOME%%
%%TIBCO_COMPONENT_INSTANCE_TRACE_FILE%%

We updated the BWEngineStart.hrb file with generic values as below :

From Component Instance=Process Archive To Component Instance=%%TIBCO_COMPONENT_INSTANCE%% From Deployment=TechsNibApp To Deployment=%%TIBCO_DEPLOYMENT%%

STEP-3 : Create the MAR file by using Mar utility located at below location.

In Windows, Navigate to
C:\ProgramData\TIBCO_HOME\tibco\cfgmgmt\hawk\bin and run below command from command prompt.

Mar -cvf C:\Mar\BWEngineStart.mar C:\Mar\BWEngineStart.hrb -Xtype bwengine

NOTE: While creating or updating a MAR file (using MAR utility), an incorrect rulebase type is assigned to the rulebase if the rulebase contains one application-specific and one or more agent specific rules. This problem occurs only if agent-specific rule is created first in the rulebase and application-specific rule created later. If this happens, the Domain, Deployment, ComponentInstance values are not substituted. It is recommended that when creating or updating a MAR file, the "-Xtype" option is used to specify the type of the rulebase.

STEP-4 : Monitoring Console lists the monitoring applications that have been added to your domain and it is used to deploy the MAR file. To do this

i) Login to TIBCO Administrator and navigate to "Monitoring Management --> Monitoring Console", select the domain and click on Add to add the new MAR file as below :


ii) in next window, select the "Quick Config" checkbox and select target application name as "TechsNibApp2".

iii) Deploy the MAR file, If the monitoring configuration is successfully deployed, the status changes from Deployable to Deployed (Loaded).

iv) You can observe that rulebase is created for application "TechsNinApp2" from "Monitoring Management --> Hawk Console --> Domain --> Rulebases section in TIBCO Administrator.

NOTE : Please note, If the target application (TechsNibApp2) is not running, the status is changed to Deployed (Not Loaded). When the target application starts, the status changes from Deployed (Not Loaded) to Deployed (Loaded). Make sure that both target application and Hawk Agent are up and running to successfully deploy a monitoring configuration.


Read More »

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 :
COM.TIBCO.ADAPTER.bwengine.%%TIBCO_DOMAIN%%.%%TIBCO_DEPLOYMENT%%.%%TIBCO_COMPONENT_INSTANCE%%
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).


Read More »

Monday, December 24, 2018

TIBCO Hawk Overview | Hawk Components and Hawk Communication in a Domain


       TIBCO Hawk is a tool for monitoring and managing distributed applications (deployed across TIBCO Domain) and Operating systems. TIBCO Hawk uses TIBCO messaging layer (either RV or EMS) for communication between HAWK components exists in a TIBCO Administration domain.

Hawk Components :

TIBCO Hawk consists of different components but we commonly use following components :

  • Hawk Agents
  • Hawk MicroAgents (HMA)
  • Hawk Web Console (Introduced in Hawk 5.0)
  • Hawk Display (Deprecated in Hawk 5.0) and Hawk console
  • Hawk Event Service

Hawk Agents :

       Hawk Agents are installed on each physical machine (Host) that will be monitored. The Hawk Agents communicate with the outside world(external applications) through the TIBCO messaging layer. The Agents themselves don't do the work and they rely on MicroAgents to do the work.

Hawk MicroAgents :

There are two different types of MicroAgents :

  1. Each TIBCO application comes with pre-coded MicroAgents (Ex : To start and stop engines)

  2. OS MicroAgents -- These provide system-level info such as CPU usage, Memory usage etc. When you install Hawk and provide your OS, the appropriate agents are loaded.

Hawk Web Console :

       This component is introduced from TIBCO Hawk 5.0 version. The TIBCO Hawk WebConsole application is a web application that provides a central view of all the distributed components interacting within Hawk System. It is a pictorial view of each of the infrastructure component that is being monitored with the help of Hawk components.

Unlike Hawk Display, Hawk Web Console is added with support for managing multiple Hawk domains using a single WebConsole, each configured with the same or a different transport.

The Web Console enables you to :

  • View statistical data about events, alerts and actions
  • Enables users to monitor various Hawk Agents, Microagents and other console-API based custom applications.
  • Allows you to administer Rulebases, Rules and actions to be taken.
  • Enables users to create own set of customized dashboards.

Hawk Display and Hawk Console :

Machine and application information retrieved by Agents can be viewed in TIBCO Hawk Display, the Hawk Console in TIBCO Administrator.

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

The Hawk Console is a browser-based utility available for TIBCO Domains only. This option is available through TIBCO Administrator.

NOTE: In earlier Hawk versions(till 4.x), We use Hawk Display to configure Rulebases, Rules and Schedules across different Hawk agents in a TIBCO Domain, later Hawk WebConsole is introduced from Hawk 5.0 version in place of Hawk Display, to do all these configurations.

Hawk Event Service :

       The TIBCO Hawk Event Service is a process that records TIBCO Hawk alerts and changes in agent status. When communication with an agent is lost, the Event Service can invoke a user-provided script. Alerts and notifications can be recorded to log files or a database.

Typically, the TIBCO Hawk Event Service is installed on a minimal number of computers in the network.


--> The Hawk Agent needs to be configured with a set of rules that it can use to monitor the applications and operating systems on the machines.

Hawk Rulebases and Rules :

       A rule is defined by the user and it is dependent on what kind of monitoring and management is desired. A rule usually performs a query using the microagent method, and then take action based on the success or failure returned by the microagent.

       A collection of rules can be stored in a single file known as rulebase. A rulebase file is then sent to the Hawk Agent of a machine. After this, the Hawk Agent starts executing the rules and taking the right actions.

How Hawk components communicate in an TIBCO Domain?

       You can specify either TIBCO EMS/RV as the primary transport. The communication between TIBCO Hawk HMA and primary Application Management Interface (AMI) session remains through TIBCO RV. This means that if you choose TIBCO EMS as primary transport, you still have to specify the RV settings for the TIBCO Hawk HMA and primary AMI session.

Below diagram depicts the overview of Hawk components and their communication in an Administration Domain to monitor both applications and operating systems on machines.

       Hawk Agent sends Alerts and Notifications to the network using the external transport (EMS or RV). The agents also listen for requests on the network and responds to these requests. A Hawk Display can send a broadcast request to multiple agents at once and multiple agents can reply in a point-to-point fashion to the Display.

The Hawk Agents also sends heartbeats periodically to the network. A Hawk Display uses these heartbeats to display the "Running" status of an agent.


Read More »

Monday, December 3, 2018

TIBCO ADB Adapter - Subscription service Configuration


       Typically vendors have their own way of formatting and exposing data. Therefore, integrating the various applications across your enterprise poses significant challenges. An adapter provides a bridge between an application and your TIBCO integration environment. Adapters are responsible for making information from different applications available to other applications across an enterprise.

       TIBCO ActiveMatrix Adapter for Database allows data changes in a database to be sent as they occur to other databases (or) applications. It extends publish-subscribe and request-response technology to databases.

       Publication service is used to listen the database changes and publish it on to ESB layer via a transport(RV/EMS). To get the overview on Publication service, you can check the earlier post on : How to create a Publication Service in TIBCO ADB Adapter and on the other side Subscription service updates database tables for changes in TIBCO ESB layer.

       Precisely TIBCO Application listens to the changes in ESB layer and uses ADB Adapter Subscription service to push the data to database tables via a transport(RV/EMS).

       To demonstrate the Subscription service, We consider the online order system, In which customer does multiple orders and all that information is listen and capture by ESB layer via HTTP call and calls subscription service to update it to database tables.

and to explain the things, We consider Oracle database and EMS(via queue) as transport.

Follow the below steps to configure and test the Subscription service :

STEP-1 : Create the below two tables i.e. CUSTOMER_SUB (parent table) and ORDER_DETAILS_SUB (child table), Adapter Subscription service will update the data to these tables.

STEP-2 : Create System DSN for Oracle, which is used by ADB Adapter service at runtime. To create, Follow the earlier post on : How to create the System DSN for Oracle

STEP-3 : Click the Project folder (AdaptersTestApp/Adapter Services), then Drag the ActiveDatabase Adapter Configuration icon from the Palette panel to Design panel and fill the Configuration tab fields as follows.

  • Enter instance name field -- "ADBAdapter-CustSub-Config"
  • Select the database type as Oracle from the Vendor drop down list as we are using Oracle.
  • Check the Write to Database on Save check box. This default option writes configuration information to the database when you save the project in TIBCO designer.

STEP-4 : Click the Design Time Connection tab and specify database connection parameters for your environment and then click on Test Connection button to verify the parameters entered are correct or not and then click on OK button to the confirmation message dialog that appears, then click on Apply button.

STEP-5 : Click the Run-time Connection tab and enter System DSN created in "STEP-2" and also check and configure "Maximum Number of Reconnect Attempts" and "interval between Reconnect Attempts" values if required (or) else leave the default values.

NOTE : TIBCO ActiveMatrix Adapter for Database uses JDBC to access your database during design time and uses ODBC to access your database during runtime.

STEP-6 : Click the Configuration tab and check the Show All Tabs checkbox, then click the General tab and update the Termination Topic details and then click Apply button.

STEP-7 : Click the Adapter Services tab and check the Use Exception Table checkbox under ALL Subscription Services section.

STEP-8 : Click on Adapter Services folder and drag Subscription Service from Palette panel to Design panel and in Configuration tab, select JMS from the Transport Type drop-down list, and the fields in the configuration tab will be changed.

STEP-9 : Click the Table tab, then click the Add Table icon in the toolbar. The Question dialog appears and click OK button to retrieve the tables from the database and Add Table dialog appears with the available tables, select the CUSTOMER_SUB table and click OK button.

STEP-10 : Click the Table tab again and expand the CUSTOMER_SUB item. With the CUSTOMER_SUB table highlighted, click the Add Child Table icon in the toolbar. The Add dialog appears, Select the ORDER_DETAILS_SUB table from the Add Table drop-down list, then click OK button.
Expand the ORDER_DETAILS_SUB table, and add the join between the CUSTOMER_SUB table and ORDER_DETAILS_SUB table by configuring UserKey and JoinTo checkboxes as shown in below diagram.

STEP-11 : Click the Subscriber Options tab and provide Exception table name value as CUSTOMER_SUB_EXCEPTION and then click the Apply button, then configuration is saved and creates Exception table (CUSTOMER_SUB_EXCEPTION) automatically in the database as we already check Write to Database on Save checkbox in STEP-3.

STEP-12 : Click on Advanced tab and provide the Destination name. TIBCO application writes the ESB layer changes to this destination and Adapter Subscription service read the message from this destination and writes the data to database tables.

STEP-13 : Create a Business Process with HTTP receiver(listens to Customer and Order information) and also configure Publish to Adapter activity with Adapter Subscription service(ADBSubscriber).

HTTP Receiver triggers once you receive a customer order information via HTTP call then we parse data with Parse XML activity and calls "Publish to Adapter" and sends data on to destination (EMS Queue : ADBAdapter-CustSub-Config.ADBSubscriber) and in turn subscription service listens to this data and writes to database tables.

Even we created one "SubServiceTest.process", which will create customer order information and send a HTTP Request to trigger above said HTTP receiver process.

STEP-14 : To test this, First start the Adapter instance by clicking Tools --> Show Adapter Tester and it opens a dialog, Configure the Run Settings --> Working Directory with <<ADB_HOME>>/bin directory and then click on Start button to run the adapter instance.

NOTE : Please note that, as part of Enterprise Archive(ear) file, Adapter service will be added to Adapter Archive and will run in separate engine/service and it won't be a part of process archive.

And also run two Business Processes (ADBAdapterSubService.process and SubServiceTest.process) in test mode then create a job for SubServiceTest process and it internally sends customer order information via HTTP request and in turn ADBAdapterSubService process is triggered and publishes data to Adapter.

STEP-15 : Finally you can observe that customer order information is written to database tables.


Read More »
back to top