.TH alarm_handler 3erl "sasl 2.2.1" "Ericsson AB" "Erlang Module Definition" .SH NAME alarm_handler \- An Alarm Handling Process .SH DESCRIPTION .LP The alarm handler process is a \fIgen_event\fR\& event manager process which receives alarms in the system\&. This process is not intended to be a complete alarm handler\&. It defines a place to which alarms can be sent\&. One simple event handler is installed in the alarm handler at start-up, but users are encouraged to write and install their own handlers\&. .LP The simple event handler sends all alarms as info reports to the error logger, and saves all of them in a list which can be passed to a user defined event handler, which may be installed at a later stage\&. The list can grow large if many alarms are generated\&. So it is a good reason to install a better user defined handler\&. .LP There are functions to set and clear alarms\&. The format of alarms are defined by the user\&. For example, an event handler for SNMP could be defined, together with an alarm MIB\&. .LP The alarm handler is part of the SASL application\&. .LP When writing new event handlers for the alarm handler, the following events must be handled: .RS 2 .TP 2 .B \fI{set_alarm, {AlarmId, AlarmDescr}}\fR\&: This event is generated by \fIalarm_handler:set_alarm({AlarmId, AlarmDecsr})\fR\&\&. .TP 2 .B \fI{clear_alarm, AlarmId}\fR\&: This event is generated by \fIalarm_handler:clear_alarm(AlarmId)\fR\&\&. .RE .LP The default simple handler is called \fIalarm_handler\fR\& and it may be exchanged by calling \fIgen_event:swap_handler/3\fR\& as \fIgen_event:swap_handler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args})\fR\&\&. \fINewHandler:init({Args, {alarm_handler, Alarms}})\fR\& is called\&. Refer to gen_event(3erl) for further details\&. .SH EXPORTS .LP .B clear_alarm(AlarmId) -> void() .br .RS .LP Types: .RS 3 AlarmId = term() .br .RE .RE .RS .LP Clears all alarms with id \fIAlarmId\fR\&\&. .RE .LP .B get_alarms() -> [alarm()] .br .RS .LP Returns a list of all active alarms\&. This function can only be used when the simple handler is installed\&. .RE .LP .B set_alarm(alarm()) .br .RS .LP Types: .RS 3 alarm() = {AlarmId, AlarmDescription} .br AlarmId = term() .br AlarmDescription = term() .br .RE .RE .RS .LP Sets an alarm with id \fIAlarmId\fR\&\&. This id is used at a later stage when the alarm is cleared\&. .RE .SH "SEE ALSO" .LP error_logger(3erl), gen_event(3erl)