|
Some systems periodically signal to state that they are OK, which is typically referred as heartbeats. When monitoring a system that sends heartbeat events, the monitoring logic is somewhat reversed. As long as the event is received, the system is assumed to be OK, and if an event is not received for longer than a specified duration, it indicates a problem. A reference implementation has been included with RapidOSS to handle monitoring of these systems. This is a three step simple mechanism: Step 1 - Monitoring ConfigurationRsHeartBeat modeled class is used to represent systems being monitored. A system is configured in a script by invoking the configureHeartBeatMonitoring operation which adds an instance of the RsHeartBeat class with the following 2 properties:
Step 2 - Receiving HeartbeatsThe monitored system is now responsible for sending heartbeat signals to RappidInsight. This is typically done in the connector for the monitored system, by simply invoking the recordHeartBeat operation of the RsHertBeat class by passing in the unique name of the monitored system: RsHeartBeat.recordHeartBeat("System1")
RsHeartBeat will update its lastChangedAt (set to current time) and consideredDownAt (set to current time + interval in milliseconds) properties. This operation will clear any previous "system down" events for this monitored system when the heartbeat is received, hence the system is back up. Step 3 - Checking HeartbeatFinally, a script will be scheduled to simply call the processHeartBeats operation of the RsHeartBeat class RsHeartBeat.processHeartBeats() This operation will call checkHeartBeat opeation which will iterate the RsHeartBeat instances and find those that have not received a heartbeat in the specified interval and will crate an event indicating that the monitored system is down. To customize how events are created, one can either modify RsHeartBeat.processHeartBeats operation or call RsHeartBeat.checkHeartBeat from the script to get the list of RsHeartBeat instances and process them in the script. Review RS_HOME/RapidSuite/operations/RsHeartBeatOperations.groovy for more information. Installation of Heartbeat Monitoring Module
|