-
Notifications
You must be signed in to change notification settings - Fork 4
Alarm Handlers
#Overview
An alarm handler is a python class that is associated with some alarm. Each handler needs to inherit from the BaseHandler class in order to be registered when the server starts up. Each handler then can implement a raised and/or cleared function that will be called (with the alarm as an argument) if the alarm is raised or cleared.
#Setup
Setting up an alarm handler is pretty easy and the template can be found here. Alarm handlers should be placed in a folder (in your python path) and should be specified as the handler_module param. See the example launch file for how this can be done, as well as the files from the test_handlers folder located here.
#Inherited Parameters
As you can see from the BaseHandler class, each handler can implement the following:
-
alarm_name: The name of the alarm associated with this alarm handler -
severity_required: Allows different handlers to be associated with different severity ranges. By setting this value to a number, only when an alarm with that severity is raised or cleared will that classesclearorraisedfunction be called. By setting this to a range, the associated function will only be called by an alarm with a severity in that range. -
initally_raised: Should this alarm be raised on start up? -
raiseandclear: Functions that should be called when an alarm raises or clears. -
meta_predicate: If the alarm is listed as one of the meta alarms, this function can be used to determine wether to raise the alarm or not given a listing of that meta alarms sub alarms. See the meta alarms page for more information about that.