Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content
  • Monitoring BWCE application logs using Hawk Container Edition in K8


    Manoj Chaurasia

    Table of Contents


    TIBCO Hawk® provides the industry's best, most sophisticated tool for monitoring and managing distributed applications and systems throughout the enterprise. With TIBCO Hawk, system administrators can monitor application parameters, behavior, and loading activities for all nodes in a local or wide-area network and take action when pre-defined conditions occur. In many cases, runtime failures or slowdowns can be repaired automatically within seconds of their discovery, reducing unscheduled outages and slowdowns of critical business systems. 


    TIBCO Hawk Container Edition can be used to monitor application logs for a TIBCO BusinessWorks Container Edition application. This article explains detailed steps about how to set this up using Hawk rulebases and alerts.

    TIBCO Hawk Container Edition has DockerHostMA method named ?onContainerLogs? which has a parameter Container Name.

    Note that in K8s, each container in the pod is created with a different Container ID

     e.g. 6971d7a455bb249b06184c216e251be5131a0a50e9f55ca5c55bca2493e58143

     

    But the Container Name always follows a fixed pattern. E.g.:

     /k8s_bwcehawkadapter_bwcehawkadapter_default_169da183-ef38-11e9-ad19-42010aa000d0_0

     

    The method onContainerLogs supports specifying the containerName with the pattern and not necessarily the full container name.

    So you can write a RuleBase (e.g. MonitorBWCELogs) to monitor the logs from TIBCO BusinessWorks Container Edition application for any keywords/exceptions and generate alerts as follows:

     

    hkcecomm1.thumb.png.0cd92c3b28e9c5f5f28063e5bdf0508a.png

    hkcecomm2.thumb.png.da321adff2471a83692be8b911ee5466.png

    hkcecomm3.png.342a304f485be74bfe1c9428eb17ac07.png

    Problem:

    If the BWCE pod is deleted and then recreated, then the Rulebase stops working.

    Solution:

    1. Create a Rulebase (e.g. LoadUnloadRB) with a test condition to unload the MonitorBWCELogs Rulebase if the HKBWCE Microagent is removed (i.e. if BWCE pod/ container is deleted).
    2. Create a test condition to load the  MonitorBWCELogs Rulebase if the HKBWCE Microagent is back (i.e. BWCE pod/ container is up and the HKBWCE Microagent connects with the Agent).
    3. Use the Self Microagent -> onMicroagentEvent method in the Rule:
    hkcecomm4.png.cf51b354ab3df4eccf858acfcd92bddb.png

    4. The test condition is if Microagent Name is ...HKBWCEMicroagent AND EventType  = Removed

    hkcecomm5_0.thumb.png.bcc347c440126856f91364fcc20ca20e.png

    5. Then Unload the Rulebase: MonitorBWCELogs

    hkcecomm6.thumb.png.ea2774621c38f03594971bab9ab7e036.png

    6. And similarly, if the BWCE microagent is up (when the pod is created/ auto deployed), then load the Rulebase again:

    hkcecomm7.png.b225411f7652b764dc630bce3b0b5d3c.png

    hkcecomm8.thumb.png.9dd2cf0225f8d8800d00877389341d55.png

    Note:

    1. It is important to configure the Hawk Agent with Auto Config Dir option so that the agent stores the Rulebases in it?s Auto Config Dir and loads up from there (RuleBaseEngine ? loadRuleBaseFromFile)

    2. It is recommended to store all RuleBases at RuleBase Repository at the Console side where they could be mapped to persistent volume and persisted.

    7. Verification: Verify that the Alerts are being generated for the RuleBase: MonitorBWCELogs

    8. Now destroy the deployment for BWCE pod:

     $ kubectl delete -f hkbwce.yml

     

    pod "bwcehawkadapter" deleted

    Verify that the Rulebase LoadUnloadRB is triggered and it unloads the Rulebase: MonitorBWCELogs and also generates an alert for it.

    Unload the Rulebase MonitorBWCELogs:

    hkcecomm10.thumb.png.a7274b1d551c19d5cdec50242c451cde.png

    9. Generate an alert for it:

    hkcecomm11.png.9a0ae95aa15b7c669949b36a52924ba3.png

    10. Now deploy the BWCE pod again:

     $ kubectl apply -f hkbwce.yml 

     

    pod/bwcehawkadapter created

    Verify that the Rulebase LoadUnloadRB is triggered and it loads the Rulebase: MonitorBWCELogs and also generates a notification for it.

    Load the Rulebase MonitorBWCELogs:

    hkcecomm12.thumb.png.c6445d8ce31e4cc67c3c6876df801a1a.png

    11. Generate notification that the rulebase is loaded:

    hkcecomm13.png.e06213b07e9bc899f8c0fd8b27a291f0.png

    And it starts generating alerts monitoring the BWCE logs.


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...