1alarm_handler(3)           Erlang Module Definition           alarm_handler(3)
2
3
4

NAME

6       alarm_handler - An Alarm Handling Process
7

DESCRIPTION

9       The  alarm  handler  process  is a gen_event event manager process that
10       receives alarms in the system. This process is not  intended  to  be  a
11       complete alarm handler. It defines a place to which alarms can be sent.
12       One simple event handler is installed in the alarm handler at  startup,
13       but users are encouraged to write and install their own handlers.
14
15       The  simple event handler sends all alarms as info reports to the error
16       logger, and saves all in a list. This list can be  passed  to  a  user-
17       defined  event handler, which can be installed later. The list can grow
18       large if many alarms are generated. This is a good reason to install  a
19       better user-defined handler.
20
21       Functions  are  provided  to  set and clear alarms. The alarm format is
22       defined by the user. For example, an event  handler  for  SNMP  can  be
23       defined, together with an alarm Management Information Base (MIB).
24
25       The alarm handler is part of the SASL application.
26
27       When  writing  new  event handlers for the alarm handler, the following
28       events must be handled:
29
30         {set_alarm, {AlarmId, AlarmDescr}}:
31           This event is generated by alarm_handler:set_alarm({AlarmId,  Alar‐
32           mDecsr}).
33
34         {clear_alarm, AlarmId}:
35           This event is generated by alarm_handler:clear_alarm(AlarmId).
36
37       The  default  simple  handler  is  called  alarm_handler  and it can be
38       exchanged by calling  gen_event:swap_handler/3  as  gen_event:swap_han‐
39       dler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args}). NewHan‐
40       dler:init({Args, {alarm_handler, Alarms}}) is called. For more details,
41       see gen_event(3) in STDLIB.
42

EXPORTS

44       clear_alarm(AlarmId) -> void()
45
46              Types:
47
48                 AlarmId = term()
49
50              Sends event clear_alarm to all event handlers.
51
52              When receiving this event, the default simple handler clears the
53              latest received alarm with id AlarmId.
54
55       get_alarms() -> [alarm()]
56
57              Returns a list of all active alarms. This function can  only  be
58              used when the simple handler is installed.
59
60       set_alarm(alarm())
61
62              Types:
63
64                 alarm() = {AlarmId, AlarmDescription}
65                 AlarmId = term()
66                 AlarmDescription = term()
67
68              Sends event set_alarm to all event handlers.
69
70              When receiving this event, the default simple handler stores the
71              alarm. AlarmId identifies the alarm and is used when  the  alarm
72              is cleared.
73

SEE ALSO

75       error_logger(3), gen_event(3)
76
77
78
79Ericsson AB                        sasl 3.3                   alarm_handler(3)
Impressum