Scenario C: Runtime Nodes Managed by connected ActiveMatrix Service Grid Host

Auto-detect runtime nodes managed by the connected ActiveMatrix Service Grid host, and provide or generate rule bases for each node that restart the node when abnormally shut down. 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 run the ANT project: 'scripts/antrunner generate-noderb.xml' with argument amx.node.name= Node Name. After it, then run the method RuleBaseEngine.loadRuleBaseFromFile(${Node Name}RB-${tibcohost.instance.name}.hrb).

Note: The ANT project generate-noderb.xml generates 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
  1. Use AMXHost.onNodeEvent to determine the runtime state of the ActiveMatrix Service Grid node.

    if Runtime State = 'LOST_CONTACT' or Runtime State='NOT_RUNNING'

    then post theth_lost_contact_node condition and send High Alert: "Lost Contact with ${Node Name}".

  2. Use HawkListener<tibcohost.ems.url>.isRunning() to determine the state of the EMS server connected to the ActiveMatrix Service Grid host.

    if running is True

    then post ems.server.<tibcohost.ems.url>.isrunning condition.

  3. Use Process.getInstanceCount(ProcessName=${Node Name}) to determine whether there is a running OS process for the ActiveMatrix Service Grid node.
Result

if Process Count < 1 AND the following posted conditions exist:

ems.server.<tibcohost.ems.url>.isrunning AND th_lost_contact_node

then runAMXHost.startNode('${Node Name}').