TIBCO HAWK is a well known and widely used monitoring tool used to monitor distributed applications and processes in real time to take necessary corrective and pre-emptive actions at the right time to avoid major financial losses for the businesses.
In this step by step HAWK tutorial, I am going to explain how to create new rules in the RuleBase for a deployed TIBCO Application and then generate alerts based on the configured rules.
Example Scenario:
As an example case, I am taking a simple scenario for this tutorial. I have developed a simple BW process that received HTTP Request, Queries a database table and then sends back HTTP Response. In case of any exception in the process, process starter is suspended by using Engine Command (this suspension logic is only valid for this example and in real projects, you won’t be having such suspension logic on exceptions).
Let’s now go step by step with this TIBCO Hawk Tutorial.
Step 1: Design TIBCO BW Process and Create its EAR
The process that I have created (HTTP Test Process), queries a database table TBL_TEMP_FILES as shown in below screenshot:
After catching the exception, below engine command is used to suspend the process starter as I will be creating alert using TIBCO HAWK based on this state change:
I am not going to explain each and every activity of the process as most of them are just straight forward.
Validate the process and then create Its EAR by dragging Enterprise Archive resource from General Palette.
In the EAR, include the above process in the PAR. Once added, Build the EAR file.
In the next Step, we will deploy the EAR in the Administrator.
Step 2: Deploy EAR in TIBCO Administrator
Go to Application Management–>All Applications and then select New Application option and choose the EAR file that you created in previous step.
Deploy the EAR and make sure that Its successfully deployed and Its Service Instance is in Running state:
Now we move forward to the main step of this tutorial in which we will create monitoring rule for this deployed service.
Step 3: Create HAWK Monitoring Rulebase and Add Rules and Alerts
Open HAWK Display. HAWK Agents will be discovered as shown below:
As you can see in above screenshot, no Rulebase has been added yet. In the Agent View, right click on the machine name and then by choosing the option Get Configuration, select Rulebases as shown below:
A new window will be opened. In the Rulebase List, click on Create option to create a new Rulebase.
Give this Rulebase a name (I named it as TestRuleBase). Click on Create option in the Rules section. In new opened window, select Data Source. As we want to create rules on our newly deployed service, choose the same. In the Micro Agent methods, choose OnStarterStateChanged:
Now in the Tests option, Create New Test. In the Test Editor, choose the condition by clicking on Edit option.
In the Test Builder window, choose State in Parameter, !Equals in the Operator and give the value ACTIVE in the arguments. By this, we want to test the situations when Process Starter state is not equal to ACTIVE.
After clicking OK button on Test Builder, use Create Option in the Then panel. It will open Action Builder window.
In the Action Builder window, choose Alert as Action Type and give a message in the Message Text Field as shown below:
In the Rulebase List, click on Apply Changes option. We are done with the creation of rulebase, addition of Rule and setting up conditions and actions for the Rule.
Now we move to the next step in which we will test the scenario that how Alerts are triggered and associated actions are performed.
Step 4: Monitor TIBCO Services and View Alerts in Monitoring Management Module
As we built a scenario in which Process Starter Change is being monitored by the HAWK Rule, so we need to take some action which can change the Process Starter state so that Rule condition is met.
In our process that we developed, Engine Command is used to change the Process Starter state in case of any exception in the process. We can cause an exception in the process by introducing some exceptional scenario in the JDBC Query activity. This can be done by dropping the table TBL_TEMP_FILES from the database so that JDBC Query results in an exception.
Use below command in SQL Developer/PlSql Developer to drop the table:
drop table tbl_temp_files
Now, send HTTP Request to the deployed service by using any browser. HTTP Connection that I created in my project was using Localhost as Host and 9858 as port. And data is the GET parameter for the HTTP Receiver.
So I use below URL to send a request to the deployed service:
http://localhost:9858/?data=ajmal
Now go to Monitoring Management–>All Alerts in TIBCO Administrator and you will see below alert which got created based on the Rule that we added to the Rulebase:
That’s it. Contact me for any further help.
Pingback: TIBCO HAWK EMS Monitoring: Monitor EMS Queue Using HAWK | TutorialsPedia
i need appmanege deployent steps
The required is available at:
https://tutorialspedia.com/tibco-appmanage-utility-ear-deployment-step-by-step-tutorial/
Ajmal,
Good share !!! Thanks !!
Iam aware of the process for monitoring the EMS Queues, here if you would be able to guide me a way to send alert if particular queue whose message size reaches 100MB, and the final alert should be collection of queues of same size but consolidated in single alert ( an single email ) – expecting EMS Rulebase of this type.
Thanks in Advance.
Raja
Hi Ajmal,
Thanks for all your Tutorials which helping a lot for the people.
I am trying to config Hawk rule base using this tutorial. while configuring it not finding “OnStarterStateChanged” as mentioned in Step3. Finding “OnInstanceChange” using that not seeing Alerts in console when JDBC error catches.
Followed all these steps as mentioned in this tutorial.
I thought of attaching screen shot but not finding option.
Please help me in this.
Thanks
Sei
GREAT tutorial…….worth reading before the interview…@same time……we can learn also.
Step-WISE-step !!!
Hi Ajmal,
I tried to setup hawk rules exactly as you mentioned above. I have few starters running in Flow controlled state as well. So i tried the condition State !Equals ACTIVE AND State !Equals FLOW_CONTROLLED. But alerts are raising only when the status is changed to ACTIVE. I tried all other possible combinations of conditions. But could not achieve what i need. Could you please assist on this?
Hi ,
Can you please show me how to create HAWK rules for below metrics for both BW & BE
Created Number of process instances created for this process definition.
Suspended Number of times process instances have been suspended.
Completed Number of process instances that have been successfully completed.
TotalExecution Total execution time (in milliseconds) for all successfully completed process instances.
AverageExecution Average execution time (in milliseconds) for all successfully completed process instances.
AverageElapsed Average elapsed clock time (in milliseconds) for all successfully completed process instances.
MinElapsed Elapsed clock time (in milliseconds) of the process instance that has completed in the shortest amount of elapsed time.
MaxElapsed Elapsed clock time (in milliseconds) of the process instance that has completed in the longest amount of elapsed time.
MinExecution Execution time (in milliseconds) of the process instance that has completed in the shortest amount of execution time.
MaxExecution Execution time (in milliseconds) of the process instance that has completed in the longest amount of execution time.
MostRecentExecutionTime Execution time (in milliseconds) of the most recently completed process instance.
MostRecentElapsedTime Elapsed clock time (in milliseconds) of the most recently completed process instance.
CountSinceReset Number of process instances that have completed since the last reset of the statistics.
Thanks
Very informative site. Is it possible to get the status of the BW Processes running, The users will be informd on a custom dashboard if the process / engines are running or not.
We do not have the Hawk Interface where we describe the rule sets.
Can we use BW Engine command inside the designer and then log the information to a table.
Hi Ajamal,your ifo is very useful.
can you provide solution for: how to apply single hawk rule for all bw process running in tibco admin.
Hi Prashansa,
You can do this with mar file. You need to create mar file for the rule and configure all application in mar.
Nice tutorial.
i am facing an issue in 5.2
i am able to send the msgs via email. But i am not getting line feed . all message is comine and coming.
Expecting:-
Hi ,
Hru?
coming:-
Hi,Hru.
Create the message in HTML tab.
It will work.
Hi Sir,
Thanks for the explaniation. How will create the hawk rules for activity status check(if status is error we want the mail).
Can you please suggest on this
Hi Ajmal,
I need help in creating hawk rulebase for files present in linux server, where in we should get a alert(ticket and email) when files are there in the folder and no alerts are required when there are no files. Can you please help. Thanks.
Hi Ajmal,
Could you help me to write a hawk rule for the condition like, if the logs of a particular service instance is not getting updated a hawk alert should come
Hi ,
I am unable to see the BW microagents in hawkwebconsole
i am using BW 5.13and hawk 5.2 .Please help
Hi,
How to monitor long running active tibco BW process using Tibco Hawk rules and restart the process archive.
Hi Ajmal,
When we deploy our bw in some hosts and we have more than 10 instances, when we need to monitoring them we create a rulebase template with mar utility, can you create some example as extension of this article?
Best regards