.TH alarm_handler 3erl "sasl 3.0.2" "Ericsson AB" "Erlang Module Definition" .SH NAME alarm_handler \- An Alarm Handling Process .SH DESCRIPTION .LP The alarm handler process is a \fB\fIgen_event\fR\&\fR\& event manager process that 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 startup, 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 in a list\&. This list can be passed to a user-defined event handler, which can be installed later\&. The list can grow large if many alarms are generated\&. This is a good reason to install a better user-defined handler\&. .LP Functions are provided to set and clear alarms\&. The alarm format is defined by the user\&. For example, an event handler for SNMP can be defined, together with an alarm Management Information Base (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 can be exchanged by calling \fB\fIgen_event:swap_handler/3\fR\&\fR\& as \fIgen_event:swap_handler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args})\fR\&\&. \fINewHandler:init({Args, {alarm_handler, Alarms}})\fR\& is called\&. For more details, see \fB\fIgen_event(3erl)\fR\&\fR\& in STDLIB\&. .SH EXPORTS .LP .B clear_alarm(AlarmId) -> void() .br .RS .LP Types: .RS 3 AlarmId = term() .br .RE .RE .RS .LP Sends event \fIclear_alarm\fR\& to all event handlers\&. .LP When receiving this event, the default simple handler clears the latest received alarm 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 Sends event \fIset_alarm\fR\& to all event handlers\&. .LP When receiving this event, the default simple handler stores the alarm\&. \fIAlarmId\fR\& identifies the alarm and is used when the alarm is cleared\&. .RE .SH "SEE ALSO" .LP \fB\fIerror_logger(3erl)\fR\&\fR\&, \fB\fIgen_event(3erl)\fR\&\fR\&