TIBCO HAWK EMS Monitoring: Monitor EMS Queue Using HAWK

By | February 3, 2015

In one of my previous HAWK tutorials; I explained how you can add hawk monitoring rule for some deployed application to raise an alert when service is not active. In this tutorial, I am going to explain step by step how you can monitor queue on EMS server using HAWK as monitoring tool.

Business Scenario:

For this tutorial; let’s take a scenario that we have EMS Server where a queue with the name queue.tutorialspedia is being used for EMS based communication. We want to monitor this queue through HAWK rules and want to send Email to operations team whenever pending message count on this queue reaches to a certain number (let’s take the number as 10 for this example though in real time scenarios we won’t be raising alerts for only 10 pending messages).

 

Step 1: Setup Environment for HAWK EMS Monitoring

In order to enable HAWK based monitoring for EMS, some initial steps are required to ensure that required JAR files are placed in the right location. There are two classes provided by EMS which are used to monitor EMS:

1. HawkListener Class which provides different methods for monitoring destinations (queues, topics), routes and other EMS items on EMS server.

2. HawkController Class which provides EMS administrative methods for management of EMS Server as well other than the methods available in HawkListener class.

Following steps are needed in Windows environment for installing these classes to enable HAWK EMS monitoring.

i. Go to the location EMS_HOME\samples\admin\hawk and copy tibjmsadmin.hma file from this location and paste it in the directory hawk\admin-plugins

ii. Go to the directory EMS_HOME\lib and copy tibjmsadmin.jar, tibjms.jar, jms.jar and tibcrypt.jar files and place these JAR files in the hawk admin plugin directory hawk\admin-plugins

iii. Now open Hawk configuration utility and properly browse and choose admin plugins directory as shown in the screenshot below:

hawk configuration admin plugin directory

iv. Now go to your admin plugins directory and open the file tibjmsadmin.hma in any text editor. Specify the hawk microagent class to be used and also specify EMS Server details like username, password etc. For my case, Its shown as below:

<microagent>

<classname>com.tibco.tibjms.admin.hawk.HawkController</classname>
<arguments>
<arg>-user</arg>
<arg>admin</arg>
<arg>-password</arg>
<arg></arg>

</arguments>
<classpath>
<!– this is always required –>
<path>tibjmsadmin.jar</path>
<path>tibjms.jar</path>
<path>jms.jar</path>
<path>tibcrypt.jar</path>
</classpath>

</microagent>

 

Now we are done with all the sub-steps involved in setting up the environment for HAWK EMS monitoring.

Step 2: Configure HAWK Rules for Monitoring EMS Server Queue

Open HAWK Display and then in the Agent View, for the discovered agent; right click and choose Get Configuration–>Rulebases

tibco hawk rulebase get configuration

A new window will open with listing of existing Rulebases. In my case, no rulebase exists. Click on Create button which will open a new window. Give some name to the Rulebase. I named it as QueueManagementRule.  Now click on Create button for Rules. In new opened window, for Data Source, click on Edit option and It will open Microagents, methods and arguments window.

Choose JMS_Controller microagent and getQueues method from methods list. In the method arguments  in Regular Expression text filed; specify name of the queue (queue.tutorialspedia) as shown below:

hawk rulebase select microagent method

Now in the Tests, click on Create option and Rulebase editor window will open.  Click on Edit button in front of If textbox and then in the parameter list, choose pendingMessageCount and in the arguments >=10 as shown below:

hawk test builder screenshot

 

Now click on Create button for Then part of Rulebase editor so that action editor window gets opened.

In the action type, choose Email and then specify email related information similar way as shown below (use correct configuration information about mail server and recipient in order to send the email):

tibco hawk email action builder

 

This completes our HAWK Rule configuration step. Now we are monitoring the queue queue.tutorialspedia on our EMS Server and Email notification will be sent to the given email address when count of pending messages on the queue will reach to 10.

You can test this now by just designing a simple BW process and use JMS Queue Sender activity in the process in a loop to send 10 or more messages to the queue queue.tutorialspedia.

Hope you liked this tutorial. Feel free to comment/contact for any further queries or help. Thanks

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

8 thoughts on “TIBCO HAWK EMS Monitoring: Monitor EMS Queue Using HAWK

  1. Prabhakar

    Hi Ajmal,
    Your tutorials are very useful to all to learn new things. Its great tibco tutorials to all.
    Do You have any tibco related videso also.
    Thank you.

    Reply
  2. Dilip

    Hi Ajmal

    i tried to configure EMS for hawk but after configuring all when i try to start hawk display getting error ” unable to find start class”

    any resolution?

    Reply
  3. Bhanu Sahu

    Detailed explanation, Very useful, Thank you so much for sharing the knowledge.

    Reply
  4. Djk

    Hi,
    Thanks for the fantastic tutorials 🙂

    What is Hawk configuration utility and where can I find it ?

    Reply
  5. Prabhakar

    How to add the ems server to admin, Can you explain step by step?

    Reply
  6. pankaj

    Hi sir i followed each steps but finally i am not able to view JMS in my micro agent..

    As my location is C:\tibco\tra\domain\test\plugin where i copied all files and configured my .hma file to.. even configured hawk too..!

    Thank u

    Reply
  7. Jimmy

    Hi,

    I have done it in all my Tibco Environment but now, i need to watch if message enter in the loop.
    Do you know how to verify if some message enter in the BW/ In the loop?

    Thanks alot.

    Reply
    1. Raja

      Hi Jimmy,

      Yes, you can try monitoring the Pending message count and send alert as it increases or you can create conditions for the count and can monitor.

      Thanks,
      Shun

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *