Auto-detect runtime nodes managed by the connected AMX Host (TibcoHost), and provide or generate rulebases for each node that restart the node when abnormally shutdown. Restart is only attempted when the connected EMS server is running.
Rulebase Name:
AMXNodeManagerRB
Microagents Used:
- com.tibco.hawk.amx.AMXHost
- COM.TIBCO.hawk.microagent.RuleBaseEngine
Use
AMXHost.getNodeInfo to determine the names of all nodes (every 30 seconds).
If
Node Name != 'SystemNode'then execute the ANT project : 'scripts/antrunner generate-noderb.xml' with argument
amx.node.name= Node Name. After it, then execute the method
RuleBaseEngine.loadRuleBaseFromFile(${Node Name}RB-${tibcohost.instance.name}.hrb).
Note: The ANT project
generate-noderb.xml
will generate a rulebase file in the Hawk autoconfig folder called
'${Node Name}RB-${tibcohost.instance.name}.hrb.
This rulebase is based on a template that has the following behavior.
Rulebase Template Name:
AMXNodeRB
Microagents Used:
- com.tibco.hawk.amx.AMXHost
- com.tibco.hawk.tibjms.HawkListener
- COM.TIBCO.hawk.hma.Process
Procedure
-
Use
AMXHost.onNodeEvent to determine runtime state of the AMXNode.
if Runtime State = 'LOST_CONTACT' or Runtime State='NOT_RUNNING'
then post
th_lost_contact_node condition and send High Alert: "Lost Contact with ${Node Name}".
-
Use
HawkListener<tibcohost.ems.url>.isRunning() to determine the state of the EMS server connected to tibcohost.
if running is True
then post
ems.server.<tibcohost.ems.url>.isrunning condition.
-
Use
Process.getInstanceCount(ProcessName=${Node Name})
to determine whether there is a running OS process for the AMXNode.
Result
if Process Count < 1 AND the following posted conditions exist:
ems.server.<tibcohost.ems.url>.isrunning AND
th_lost_contact_node
then execute
AMXHost.startNode('${Node Name}').
Copyright © Cloud Software Group, Inc. All rights reserved.