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.



No comments:

Post a Comment

back to top