![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
Appendix A Configuring TIBCO ActiveMatrix 3.x Hawk Rulebase SamplesThe sample provides the following functionality related to the AMX Host microagent and the TIBCO EMS microagent:
• Detect when the connected ActiveMatrix Host (TibcoHost) is abnormally shutdown and restart it. Restart is only attempted if, the connected EMS server is running.
• Detect when the Administrator Node (SystemNode) was abnormally shutdown and restart it. (Assumes that the SystemNode is also managed by the connected ActiveMatrix Host). Restart is only attempted when the Admin database (if external) is running, and the connected EMS server is running.A sample DBping microagent is included to support this scenario. Note that the rulebases to support this scenario B are only setup when the ActiveMatrix Administrator instance is created via TCT.
• Auto-detect runtime nodes managed by the connected ActiveMatrix 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.The rulebases and scripts are auto-configured from the output of a TIBCO Configuration Tool (TCT) run.When TCT is run on a machine to setup either an ActiveMatrix Administrator instance or a TIBCO Host instance, its output directory can be used to configure the Hawk rulebases and scripts to manage the installed ActiveMatrix Administrator and/or TIBCO Host and nodes.For detailed information on configuring the rulebases and scripts, refer to Configuration Instructions.Detect when connected TIBCO Host is abnormally shutdown, and restart only if EMS server is running:
• Use AMXHost.isHostRunning() to determine if the tibcohost is runningif Running is Falsethen post 'th_not_running' condition and send Medium level alert: "TibcoHost is not running".
• Use AMXHost.getHostInfo to determine runtime state of the tibcohost.then post 'th_lost_contact' condition and send Medium alert: "Lost Contact with Tibco Host, Host is in a NOT_RUNNING state".
• Use HawkListener<tibcohost.ems.url>.isRunning() to determine the state of the EMS server connected to tibcohost.if running is Truethen post ems.server.<tibcohost.ems.url>.isrunning conditionif running is False
• Use Process.getInstanceCount(ProcessName='tibcohost') to determineems.server.<tibcohost.ems.url>.isrunning AND th_not_running then execute start_tibcohost script, and send High alert: "ActiveMatrix Host is not running, going to restart it."Detect when the Administrator Node (SystemNode) was abnormally shutdown and restart it, only if the external database (if used) is alive, and if the connected EMS server is running.
• For external database - SystemNodeRB-extdb-${tibcohost.instance.name}
• For embedded database - SystemNodeRB-${tibcohost.instance.name}
• Use AMXHost.onNodeEvent to determine runtime state of the SystemNode.then post th_lost_contact_systemnode condition and send High Alert: "Lost Contact with SystemNode"
• Use HawkListener<tibcohost.ems.url>.isRunning() to determine the state of the EMS server connected to tibcohost.if running is Truethen post ems.server.<tibcohost.ems.url>.isrunning condition
• Use DBPingMicroAgent.ping() to determine the state of the external Database.if ping is Truethen post systemnode.db.isRunning condition
• Use Process.getInstanceCount(ProcessName='SystemNode') to determine whether there is a running OS process for the SystemNode.then execute AMXHost.startNode('SystemNode')
• Use AMXHost.onNodeEvent to determine runtime state of the SystemNode.then post th_lost_contact_systemnode condition and send High Alert: "Lost Contact with SystemNode".
• Use HawkListener<tibcohost.ems.url>.isRunning() to determine the state of the EMS server connected to tibcohost.if running is Truethen post ems.server.<tibcohost.ems.url>.isrunning condition.
• Use Process.getInstanceCount(ProcessName='SystemNode') to determine whether there is a running OS process for the SystemNode.ems.server.<tibcohost.ems.url>.isrunning AND th_lost_contact_systemnodethen execute AMXHost.startNode('SystemNode').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.Use AMXHost.getNodeInfo to determine the names of all nodes (every 30 seconds)then execute the ANT project : 'scripts/antrunner generate-noderb.xml' with argument amx.node.name= Node Namethen execute the method RuleBaseEngine.loadRuleBaseFromFile(${Node Name}RB-${tibcohost.instance.name}.hrb).
The ANT project generate-noderb.xml will generate a rulebase file in the Hawk autoconfig folder called '${Node Name}RB-${tibcohost.instance.name}.hrb.
• Use AMXHost.onNodeEvent to determine runtime state of the AMXNode.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 Truethen 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.ems.server.<tibcohost.ems.url>.isrunning AND th_lost_contact_nodethen execute AMXHost.startNode('${Node Name}').
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |