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
But the Container Name always follows a fixed pattern. E.g.:
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:
If the BWCE pod is deleted and then recreated, then the Rulebase stops working.
- 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).
- 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).
- Use the Self Microagent -> onMicroagentEvent method in the Rule:
4. The test condition is if Microagent Name is ...HKBWCEMicroagent AND EventType = Removed
5. Then Unload the Rulebase: MonitorBWCELogs
6. And similarly, if the BWCE microagent is up (when the pod is created/ auto deployed), then load the Rulebase again:
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)
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:
9. Generate an alert for it:
10. Now deploy the BWCE pod again:
$ kubectl apply -f hkbwce.yml
Verify that the Rulebase LoadUnloadRB is triggered and it loads the Rulebase: MonitorBWCELogs and also generates a notification for it.
Load the Rulebase MonitorBWCELogs:
11. Generate notification that the rulebase is loaded:
And it starts generating alerts monitoring the BWCE logs.