~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/sasl/doc/src/alarm_handler.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
 
3
 
 
4
<erlref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1996</year>
 
8
      <year>2007</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>alarm_handler</title>
 
27
    <prepared>Martin Bj&ouml;rklund</prepared>
 
28
    <responsible>Bjarne Dacker</responsible>
 
29
    <docno></docno>
 
30
    <approved>Bjarne D&auml;cker</approved>
 
31
    <checked>Martin Bj&ouml;rklund</checked>
 
32
    <date>1996-09-10</date>
 
33
    <rev>A</rev>
 
34
    <file>alarm_handler.sgml.t1</file>
 
35
  </header>
 
36
  <module>alarm_handler</module>
 
37
  <modulesummary>An Alarm Handling Process</modulesummary>
 
38
  <description>
 
39
    <p>The alarm handler process is a <c>gen_event</c> event manager
 
40
      process which receives alarms in the system. This process is not
 
41
      intended to be a complete alarm handler. It defines a
 
42
      place to which alarms can be sent. One simple event handler is
 
43
      installed in the alarm handler at start-up, but users are
 
44
      encouraged to write and install their own handlers.
 
45
      </p>
 
46
    <p>The simple event handler sends all alarms as info reports to
 
47
      the error logger, and saves all of them in a list which can be
 
48
      passed to a user defined event handler, which may be installed at
 
49
      a later stage. The list can grow large if many alarms are
 
50
      generated. So it is a good reason to install a better user defined
 
51
      handler.
 
52
      </p>
 
53
    <p>There are functions to set and clear alarms. The format of
 
54
      alarms are defined by the user. For example, an event handler
 
55
      for SNMP could be defined, together with an alarm MIB.
 
56
      </p>
 
57
    <p>The alarm handler is part of the SASL application. 
 
58
      </p>
 
59
    <p>When writing new event handlers for the alarm handler, the
 
60
      following events must be handled:
 
61
      </p>
 
62
    <taglist>
 
63
      <tag><c>{set_alarm, {AlarmId, AlarmDescr}}</c></tag>
 
64
      <item>
 
65
        <p>This event is generated by
 
66
          <c>alarm_handler:set_alarm({AlarmId, AlarmDecsr})</c>.
 
67
          </p>
 
68
      </item>
 
69
      <tag><c>{clear_alarm, AlarmId}</c></tag>
 
70
      <item>
 
71
        <p>This event is
 
72
          generated by <c>alarm_handler:clear_alarm(AlarmId)</c>.
 
73
          </p>
 
74
      </item>
 
75
    </taglist>
 
76
    <p>The default simple handler is called <c>alarm_handler</c> and
 
77
      it may be exchanged by calling <c>gen_event:swap_handler/3</c>
 
78
      as <c>gen_event:swap_handler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args})</c>. <c>NewHandler:init({Args, {alarm_handler, Alarms}})</c> is called. Refer to gen_event(3)
 
79
      for further details.
 
80
      </p>
 
81
  </description>
 
82
  <funcs>
 
83
    <func>
 
84
      <name>clear_alarm(AlarmId) -> void()</name>
 
85
      <fsummary>Clear the specified alarms</fsummary>
 
86
      <type>
 
87
        <v>AlarmId = term()</v>
 
88
      </type>
 
89
      <desc>
 
90
        <p>Clears all alarms with id <c>AlarmId</c>.
 
91
          </p>
 
92
      </desc>
 
93
    </func>
 
94
    <func>
 
95
      <name>get_alarms() -> [alarm()]</name>
 
96
      <fsummary>Get all active alarms</fsummary>
 
97
      <desc>
 
98
        <p>Returns a list of all active alarms. This function can only
 
99
          be used when the simple handler is installed.
 
100
          </p>
 
101
      </desc>
 
102
    </func>
 
103
    <func>
 
104
      <name>set_alarm(alarm())</name>
 
105
      <fsummary>Set an alarm with an id</fsummary>
 
106
      <type>
 
107
        <v>alarm() = {AlarmId, AlarmDescription}</v>
 
108
        <v>AlarmId = term()</v>
 
109
        <v>AlarmDescription = term()</v>
 
110
      </type>
 
111
      <desc>
 
112
        <p>Sets an alarm with id <c>AlarmId</c>. This id is used at a
 
113
          later stage when the alarm is cleared.
 
114
          </p>
 
115
      </desc>
 
116
    </func>
 
117
  </funcs>
 
118
 
 
119
  <section>
 
120
    <title>See Also</title>
 
121
    <p>error_logger(3), gen_event(3) 
 
122
      </p>
 
123
  </section>
 
124
</erlref>
 
125