File: snmpm_user.3

package info (click to toggle)
erlang-manpages 1%3A12.b.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,188 kB
  • ctags: 2
  • sloc: makefile: 68; perl: 30; sh: 15
file content (258 lines) | stat: -rw-r--r-- 5,179 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
.TH snmpm_user 3 "snmp  4.11" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
snmpm_user \- Behaviour module for the SNMP manager user\&.
.SH DESCRIPTION
.LP
This module defines the behaviour of the manager user\&. A \fIsnmpm_user\fR compliant module must export the following functions: 
.RS 2
.TP 2
*
handle_error/3
.TP 2
*
handle_agent/4
.TP 2
*
handle_pdu/5
.TP 2
*
handle_trap/4
.TP 2
*
handle_inform/4
.TP 2
*
handle_report/4
.RE
.LP
The semantics of them and their exact signatures are explained below\&. 

.SH EXPORTS
.LP
.B
handle_error(ReqId, Reason, UserData) -> Reply
.br
.RS
.TP
Types
ReqId = integer()
.br
Reason = {unexpected_pdu, SnmpInfo} | {invalid_sec_info, SecInfo, SnmpInfo} | {empty_message, Addr, Port} | term()
.br
Addr = ip_address()
.br
Port = integer()
.br
UserData = term()
.br
Reply = ignore
.br
.RE
.RS
.LP
This function is called when the manager needs to communicate an "asynchronous" error, to the user: e\&.g\&. failure to send an asynchronous message (i\&.e\&. encoding error), a received message was discarded due to security error, the manager failed to generate a response message to a received inform-request, or when receiving an unexpected PDU from an agent (could be an expired async request)\&. 
.LP
If \fIReqId\fR is less then 0, it means that this information was not available to the manager (that info was never retrieved before the message was discarded)\&. 
.LP
For \fISnmpInfo\fR see handle_agent below\&.
.RE
.LP
.B
handle_agent(Addr, Port, SnmpInfo, UserData) -> Reply
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}
.br
ErrorStatus = atom()
.br
ErrorIndex = integer()
.br
Varbinds = [varbind()]
.br
varbind() = #varbind
.br
UserData = term()
.br
Reply = ignore | {register, UserId, agent_info()}
.br
UserId = term()
.br
agent_info() = [{agent_info_item(), agent_info_value()}]
.br
.RE
.RS
.LP
This function is called when a message is received from an unknown agent\&.
.LP
Note that this will always be the default user that is called\&.
.LP
For more info about the \fIagent_info()\fR, see register_agent\&.
.LP
The only user which would return \fI{register, UserId, agent_info()}\fR is the \fIdefault user\fR\&.
.RE
.LP
.B
handle_pdu(Addr, Port, ReqId, SnmpResponse, UserData) -> Reply
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
ReqId = term()
.br
SnmpResponse = {ErrorStatus, ErrorIndex, Varbinds}
.br
ErrorStatus = atom()
.br
ErrorIndex = integer()
.br
Varbinds = [varbind()]
.br
varbind() = #varbind
.br
UserData = term()
.br
Reply = ignore
.br
.RE
.RS
.LP
Handle the reply to an asynchroneous request, such as ag, agn or as\&.
.LP
It could also be a late reply to a synchronous request\&.
.LP
\fIReqId\fR is returned by the asynchroneous request function\&.
.RE
.LP
.B
handle_trap(Addr, Port, SnmpTrapInfo, UserData) -> Reply
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
SnmpTrapInfo = {Enteprise, Generic, Spec, Timestamp, Varbinds} | {ErrorStatus, ErrorIndex, Varbinds}
.br
Enterprise = oid()
.br
Generic = integer()
.br
Spec = integer()
.br
Timestamp = integer()
.br
ErrorStatus = atom()
.br
ErrorIndex = integer()
.br
Varbinds = [varbind()]
.br
varbind() = #varbind
.br
UserData = term()
.br
Reply = ignore | unregister | {register, UserId, agent_info()}
.br
UserId = term()
.br
agent_info() = [{agent_info_item(), agent_info_value()}]
.br
.RE
.RS
.LP
Handle a trap/notification message from an agent\&.
.LP
For more info about the \fIagent_info()\fR, see register_agent
.LP
The only user which would return \fI{register, UserId, agent_info()}\fR is the \fIdefault user\fR\&.
.RE
.LP
.B
handle_inform(Addr, Port, SnmpInfo, UserData) -> Reply
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}
.br
ErrorStatus = atom()
.br
ErrorIndex = integer()
.br
Varbinds = [varbind()]
.br
varbind() = #varbind
.br
UserData = term()
.br
Reply = ignore | unregister | {register, UserId, agent_info()}
.br
UserId = term()
.br
agent_info() = [{agent_info_item(), agent_info_value()}]
.br
.RE
.RS
.LP
Handle a inform message\&.
.LP
For more info about the \fIagent_info()\fR, see register_agent
.LP
The only user which would return \fI{register, UserId, agent_info()}\fR is the \fIdefault user\fR\&.
.LP
If the inform request behaviour configuration option is set to \fIuser\fR or \fI{user, integer()}\fR, the response (acknowledgment) to this inform-request will be sent when this function returnes\&.
.RE
.LP
.B
handle_report(Addr, Port, SnmpInfo, UserData) -> Reply
.br
.RS
.TP
Types
Addr = ip_address()
.br
Port = integer()
.br
SnmpInfo = {ErrorStatus, ErrorIndex, Varbinds}
.br
ErrorStatus = atom()
.br
ErrorIndex = integer()
.br
Varbinds = [varbind()]
.br
varbind() = #varbind
.br
UserData = term()
.br
Reply = ignore | unregister | {register, UserId, agent_info()}
.br
UserId = term()
.br
agent_info() = [{agent_info_item(), agent_info_value()}]
.br
.RE
.RS
.LP
Handle a report message\&.
.LP
For more info about the \fIagent_info()\fR, see register_agent
.LP
The only user which would return \fI{register, UserId, agent_info()}\fR is the \fIdefault user\fR\&.
.RE