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

NAME

6       snmpa_conf - Utility functions for handling the agent config files.
7

DESCRIPTION

9       The  module  snmpa_conf  contains various utility functions to used for
10       manipulating (write/append/read) the config files of the SNMP agent.
11

DATA TYPES

13       transportDomain() = transportDomainUdpIpv4 | transportDomainUdpIpv6
14
15       transportAddress() =
16           transportAddressIPv4() | transportAddressIPv6()
17
18       transportAddressWithPort() =
19           transportAddressIPv4WithPort() | transportAddressIPv6WithPort()
20
21       transportAddressWithoutPort() =
22           transportAddressIPv4WithoutPort() | transportAddressIPv6WithoutPort()
23
24       transportAddressIPv4() =
25           transportAddressIPv4WithPort() | transportAddressIPv4WithoutPort()
26       transportAddressIPv4WithPort =
27           {transportAddressIPv4WithoutPort(), inet:port_number()} |
28           [byte() x 4, byte() x 2]
29       transportAddressIPv4WithoutPort =
30           inet:ip4_address() | [byte() x 4]
31
32       transportAddressIPv6() =
33           transportAddressIPv6WithPort() | transportAddressIPv6WithoutPort()
34       transportAddressIPv6WithPort =
35           {transportAddressIPv6WithoutPort(), inet:port_number()} |
36           [word() x 8, inet:port_number()] |
37           [word() x 8, byte() x 2] |
38           {byte() x 16, byte() x 2]
39       transportAddressIPv6WithoutPort =
40           inet:ip6_address() | [word() x 8] | [byte() x 16]
41
42       transportAddressMask() =
43           [] | transportAddressWithPort()
44
45       byte() = 0..255
46       word() = 0..65535
47
48
49       For inet:ip4_address(), inet:ip6_address() and inet:port_number(),  see
50       also inet:ip_address()
51

EXPORTS

53       agent_entry(Tag, Val) -> agent_entry()
54
55              Types:
56
57                 Tag = intAgentTransports | intAgentUDPPort | intAgentMaxPack‐
58                 etSize | snmpEngineMaxMessageSize | snmpEngineID
59                 Val = term()
60                 agent_entry() = term()
61
62              Create an entry for the agent config file, agent.conf.
63
64              The type of Val depends on the value of Tag, see Agent  Informa‐
65              tion for more info.
66
67       write_agent_config(Dir, Conf) -> ok
68       write_agent_config(Dir, Hdr, Conf) -> ok
69
70              Types:
71
72                 Dir = string()
73                 Hdr = string()
74                 Conf = [agent_entry()]
75
76              Write the agent config to the agent config file.
77
78              Dir is the path to the directory where to store the config file.
79
80              Hdr  is  an optional file header (note that this text is written
81              to the file as is).
82
83              See Agent Information for more info.
84
85       append_agent_config(Dir, Conf) -> ok
86
87              Types:
88
89                 Dir = string()
90                 Conf = [agent_entry()]
91
92              Append the config to the current agent config file.
93
94              Dir is the path to the directory where to store the config file.
95
96              See Agent Information for more info.
97
98       read_agent_config(Dir) -> Conf
99
100              Types:
101
102                 Dir = string()
103                 Conf = [agent_entry()]
104
105              Read the current agent config file.
106
107              Dir is the path to the directory where to store the config file.
108
109              See Agent Information for more info.
110
111       standard_entry(Tag, Val) -> standard_entry()
112
113              Types:
114
115                 Tag = sysDescr | sysObjectID | sysContact | sysName |  sysLo‐
116                 cation | sysServices | snmpEnableAuthenTraps
117                 Val = term()
118                 standard_entry() = term()
119
120              Create  an  entry  for  the  agent  standard  config file, stan‐
121              dard.conf.
122
123              The type of Val depends on the value of Tag, see System Informa‐
124              tion for more info.
125
126       write_standard_config(Dir, Conf) -> ok
127       write_standard_config(Dir, Hdr, Conf) -> ok
128
129              Types:
130
131                 Dir = string()
132                 Hdr = string()
133                 Conf = [standard_entry()]
134
135              Write  the  agent  standard  config to the agent standard config
136              file.
137
138              Dir is the path to the directory where to store the config file.
139
140              Hdr is an optional file header (note that this text  is  written
141              to the file as is).
142
143              See System Information for more info.
144
145       append_standard_config(Dir, Conf) -> ok
146
147              Types:
148
149                 Dir = string()
150                 Conf = [standard_entry()]
151
152              Append  the standard config to the current agent standard config
153              file.
154
155              Dir is the path to the directory where to store the config file.
156
157              See System Information for more info.
158
159       read_standard_config(Dir) -> Conf
160
161              Types:
162
163                 Dir = string()
164                 Conf = [standard_entry()]
165
166              Read the current agent standard config file.
167
168              Dir is the path to the directory where to store the config file.
169
170              See System Information for more info.
171
172       context_entry(Context) -> context_entry()
173
174              Types:
175
176                 Context = string()
177                 context_entry() = term()
178
179              Create an entry for the agent context config file, context.conf.
180
181              See Contexts for more info.
182
183       write_context_config(Dir, Conf) -> ok
184       write_context_config(Dir, Hdr, Conf) -> ok
185
186              Types:
187
188                 Dir = string()
189                 Hdr = string()
190                 Conf = [context_entry()]
191
192              Write the agent context config to the agent context config file.
193
194              Dir is the path to the directory where to store the config file.
195
196              Hdr is an optional file header (note that this text  is  written
197              to the file as is).
198
199              See Contexts for more info.
200
201       append_context_config(Dir, Conf) -> ok
202
203              Types:
204
205                 Dir = string()
206                 Conf = [context_entry()]
207
208              Append  the  context  config to the current agent context config
209              file.
210
211              Dir is the path to the directory where to store the config file.
212
213              See Contexts for more info.
214
215       read_context_config(Dir) -> Conf
216
217              Types:
218
219                 Dir = string()
220                 Conf = [context_entry()]
221
222              Read the current agent context config file.
223
224              Dir is the path to the directory where to store the config file.
225
226              See Contexts for more info.
227
228       community_entry(CommunityIndex) -> community_entry()
229       community_entry(CommunityIndex,  CommunityName,  SecName,  ContextName,
230       TransportTag) -> community_entry()
231
232              Types:
233
234                 CommunityIndex = string()
235                 CommunityName = string()
236                 SecName = string()
237                 CtxName = string()
238                 TransportTag = string()
239                 community_entry() = term()
240
241              Create  an  entry  for  the  agent community config file, commu‐
242              nity.conf.
243
244              CommunityIndex must be a non-empty string.
245
246              community_entry("public") translates to the following call: com‐
247              munity_entry(CommunityIndex, CommunityIndex, "initial", "", "").
248
249              community_entry("all-rights")  translates to the following call:
250              community_entry(CommunityIndex, CommunityIndex,  CommunityIndex,
251              "", "").
252
253              See Community for more info.
254
255       write_community_config(Dir, Conf) -> ok
256       write_community_config(Dir, Hdr, Conf) -> ok
257
258              Types:
259
260                 Dir = string()
261                 Hdr = string()
262                 Conf = [community_entry()]
263
264              Write  the  agent community config to the agent community config
265              file.
266
267              Dir is the path to the directory where to store the config file.
268
269              Hdr is an optional file header (note that this text  is  written
270              to the file as is).
271
272              See Community for more info.
273
274       append_community_config(Dir, Conf) -> ok
275
276              Types:
277
278                 Dir = string()
279                 Conf = [community_entry()]
280
281              Append  the community config to the current agent community con‐
282              fig file.
283
284              Dir is the path to the directory where to store the config file.
285
286              See Community for more info.
287
288       read_community_config(Dir) -> Conf
289
290              Types:
291
292                 Dir = string()
293                 Conf = [community_entry()]
294
295              Read the current agent community config file.
296
297              Dir is the path to the directory where to store the config file.
298
299              See Communities for more info.
300
301       target_addr_entry(Name, Domain, Addr, TagList, ParamsName, EngineId) ->
302       target_addr_entry()
303       target_addr_entry(Name,  Domain,  Addr,  TagList, ParamsName, EngineId,
304       TMask) -> target_addr_entry()
305       target_addr_entry(Name, Domain, Addr,  TagList,  ParamsName,  EngineId,
306       TMask, MaxMessageSize) -> target_addr_entry()
307       target_addr_entry(Name,  Domain,  Addr,  Timeout,  RetryCount, TagList,
308       ParamsName, EngineId, TMask, MaxMessageSize) -> target_addr_entry()
309
310              Types:
311
312                 Name = string()
313                 Domain = transportDomain()
314                 Ip = transportAddress() (depends on Domain)
315                 Timeout = integer()
316                 RetryCount = integer()
317                 TagList = string()
318                 ParamsName = string()
319                 EngineId = string()
320                 TMask = transportAddressMask() (depends on Domain)
321                 MaxMessageSize = integer()
322                 target_addr_entry() = term()
323
324              Create an entry for the  agent  target_addr  config  file,  tar‐
325              get_addr.conf.
326
327              Name must be a non-empty string.
328
329              target_addr_entry/6  translates  to  the  following  call:  tar‐
330              get_addr_entry(Name,   Domain,   Addr,   TagList,    ParamsName,
331              EngineId, []).
332
333              target_addr_entry/7  translates  to  the  following  call:  tar‐
334              get_addr_entry(Name,   Domain,   Addr,   TagList,    ParamsName,
335              EngineId, TMask, 2048).
336
337              target_addr_entry/8  translates  to  the  following  call:  tar‐
338              get_addr_entry(Name, Domain, Addr, 1500, 3, TagList, ParamsName,
339              EngineId, TMask, MaxMessageSize).
340
341              See Target Address Definitions for more info.
342
343       write_target_addr_config(Dir, Conf) -> ok
344       write_target_addr_config(Dir, Hdr, Conf) -> ok
345
346              Types:
347
348                 Dir = string()
349                 Hdr = string()
350                 Conf = [target_addr_entry()]
351
352              Write the agent target_addr config to the agent target_addr con‐
353              fig file.
354
355              Dir is the path to the directory where to store the config file.
356
357              Hdr is an optional file header (note that this text  is  written
358              to the file as is).
359
360              See Target Address Definitions for more info.
361
362       append_target_addr_config(Dir, Conf) -> ok
363
364              Types:
365
366                 Dir = string()
367                 Conf = [target_addr_entry()]
368
369              Append  the  target_addr config to the current agent target_addr
370              config file.
371
372              Dir is the path to the directory where to store the config file.
373
374              See Target Address Definitions for more info.
375
376       read_target_addr_config(Dir) -> Conf
377
378              Types:
379
380                 Dir = string()
381                 Conf = [target_addr_entry()]
382
383              Read the current agent target_addr config file.
384
385              Dir is the path to the directory where to store the config file.
386
387              See Target Address Definitions for more info.
388
389       target_params_entry(Name, Vsn) -> target_params_entry()
390       target_params_entry(Name,   Vsn,    SecName,    SecLevel)    ->    tar‐
391       get_params_entry()
392       target_params_entry(Name, MPModel, SecModel, SecName, SecLevel) -> tar‐
393       get_params_entry()
394
395              Types:
396
397                 Name = string()
398                 Vsn = v1 | v2 | v3
399                 MPModel = v1 | v2c | v3
400                 SecModel = v1 | v2c | usm
401                 SecName = string()
402                 SecLevel = noAuthNoPriv | authNoPriv | authPriv
403                 target_params_entry() = term()
404
405              Create an entry for the agent target_params  config  file,  tar‐
406              get_params.conf.
407
408              Name must be a non-empty string.
409
410              Vsn translates into MPModel and SecModel as follows:
411
412              \011  Vsn = v1 => MPModel = v1,  SecModel = v1
413              \011  Vsn = v2 => MPModel = v2c, SecModel = v2c
414              \011  Vsn = v3 => MPModel = v3,  SecModel = usm
415
416
417              target_params_entry/2  translates  to  the  following call: tar‐
418              get_params_entry(Name, Vsn, "initial", noAuthNoPriv).
419
420              target_params_entry/4 translates to  the  following  call:  tar‐
421              get_params_entry(Name,  MPModel,  SecModel,  SecName,  SecLevel)
422              where MPModel and SecModel is mapped from Vsn, see above.
423
424              See Target Parameters Definitions for more info.
425
426       write_target_params_config(Dir, Conf) -> ok
427       write_target_params_config(Dir, Hdr, Conf) -> ok
428
429              Types:
430
431                 Dir = string()
432                 Hdr = string()
433                 Conf = [target_params_entry()]
434
435              Write the agent target_params config to the agent  target_params
436              config file.
437
438              Dir is the path to the directory where to store the config file.
439
440              Hdr  is  an optional file header (note that this text is written
441              to the file as is).
442
443              See Target Parameters Definitions for more info.
444
445       append_target_params_config(Dir, Conf) -> ok
446
447              Types:
448
449                 Dir = string()
450                 Conf = [target_params_entry()]
451
452              Append the  target_params  config  to  the  current  agent  tar‐
453              get_params config file.
454
455              Dir is the path to the directory where to store the config file.
456
457              See Target Parameters Definitions for more info.
458
459       read_target_params_config(Dir) -> Conf
460
461              Types:
462
463                 Dir = string()
464                 Conf = [target_params_entry()]
465
466              Read the current agent target_params config file.
467
468              Dir is the path to the directory where to store the config file.
469
470              See Target Parameters Definitions for more info.
471
472       vacm_s2g_entry(SecModel, SecName, GroupName) -> vacm_s2g_entry()
473       vacm_acc_entry(GroupName,  Prefix, SecModel, SecLevel, Match, ReadView,
474       WriteView, NotifyView) -> vacm_acc_entry()
475       vacm_vtf_entry(ViewIndex, ViewSubtree) -> vacm_vtf_entry()
476       vacm_vtf_entry(ViewIndex,   ViewSubtree,   ViewStatus,   ViewMask)   ->
477       vacm_vtf_entry()
478
479              Types:
480
481                 SecModel = v1 | v2c | usm
482                 SecName = string()
483                 GroupName = string()
484                 Prefix = string()
485                 SecLevel = noAuthNoPriv | authNoPriv | authPriv
486                 Match = prefix | exact
487                 ReadView = string()
488                 WriteView = string()
489                 NotifyView = string()
490                 ViewIndex = integer()
491                 ViewSubtree = [integer()]
492                 ViewStatus = included | excluded
493                 ViewMask = null | [zero_or_one()]
494                 zero_or_one() = 0 | 1
495                 vacm_s2g_entry() = term()
496                 vacm_acc_entry() = term()
497                 vacm_vtf_entry() = term()
498
499              Create an entry for the agent vacm config file, vacm.conf.
500
501              vacm_vtf_entry/2    translates    to    the    following   call:
502              vacm_vtf_entry(ViewIndex, ViewSubtree, included, null).
503
504              See MIB Views for VACM for more info.
505
506       write_vacm_config(Dir, Conf) -> ok
507       write_vacm_config(Dir, Hdr, Conf) -> ok
508
509              Types:
510
511                 Dir = string()
512                 Hdr = string()
513                 Conf = [vacm_entry()]
514                 vacm_entry()  =   vacm_sg2_entry()   |   vacm_acc_entry()   |
515                 vacm_vtf_entry()
516
517              Write the agent vacm config to the agent vacm config file.
518
519              Dir is the path to the directory where to store the config file.
520
521              Hdr  is  an optional file header (note that this text is written
522              to the file as is).
523
524              See MIB Views for VACM for more info.
525
526       append_vacm_config(Dir, Conf) -> ok
527
528              Types:
529
530                 Dir = string()
531                 Conf = [vacm_entry()]
532
533              Append the vacm config to the current agent vacm config file.
534
535              Dir is the path to the directory where to store the config file.
536
537              See MIB Views for VACM for more info.
538
539       read_vacm_config(Dir) -> Conf
540
541              Types:
542
543                 Dir = string()
544                 Conf = [vacm_entry()]
545
546              Read the current agent vacm config file.
547
548              Dir is the path to the directory where to store the config file.
549
550              See MIB Views for VACM for more info.
551
552       usm_entry(EngineId) -> usm_entry()
553       usm_entry(EngineID, UserName, SecName, Clone, AuthP,  AuthKeyC,  OwnAu‐
554       thKeyC,  PrivP,  PrivKeyC,  OwnPrivKeyC,  Public,  AuthKey, PrivKey) ->
555       usm_entry()
556
557              Types:
558
559                 EngineId = string()
560                 UserName = string()
561                 SecName = string()
562                 Clone = zeroDotZero | [integer()]
563                 AuthP = usmNoAuthProtocol | usmHMACMD5AuthProtocol,  |  usmH‐
564                 MACSHAAuthProtocol
565                 AuthKeyC = string()
566                 OwnAuthKeyC = string()
567                 PrivP    =    usmNoPrivProtocol    |   usmDESPrivProtocol   |
568                 usmAesCfb128Protocol
569                 PrivKeyC = string()
570                 OwnPrivKeyC = string()
571                 Public = string()
572                 AuthKey = [integer()]
573                 PrivKey = [integer()]
574                 usm_entry() = term()
575
576              Create an entry for the agent vacm config file, vacm.conf.
577
578              usm_entry/1 translates to the  following  call:  usm_entry("ini‐
579              tial", "initial", zeroDotZero, usmNoAuthProtocol, "", "", usmNo‐
580              PrivProtocol, "", "", "", "", "").
581
582              See Security data for USM for more info.
583
584       write_usm_config(Dir, Conf) -> ok
585       write_usm_config(Dir, Hdr, Conf) -> ok
586
587              Types:
588
589                 Dir = string()
590                 Hdr = string()
591                 Conf = [usm_entry()]
592
593              Write the agent usm config to the agent usm config file.
594
595              Dir is the path to the directory where to store the config file.
596
597              Hdr is an optional file header (note that this text  is  written
598              to the file as is).
599
600              See Security data for USM for more info.
601
602       append_usm_config(Dir, Conf) -> ok
603
604              Types:
605
606                 Dir = string()
607                 Conf = [usm_entry()]
608
609              Append the usm config to the current agent vacm config file.
610
611              Dir is the path to the directory where to store the config file.
612
613              See Security data for USM for more info.
614
615       read_usm_config(Dir) -> Conf
616
617              Types:
618
619                 Dir = string()
620                 Conf = [usm_entry()]
621
622              Read the current agent usm config file.
623
624              Dir is the path to the directory where to store the config file.
625
626              See Security data for USM for more info.
627
628       notify_entry(Name, Tag, Type) -> notify_entry()
629
630              Types:
631
632                 Name = string()
633                 Tag = string()
634                 Type = trap | inform
635                 community_entry() = term()
636
637              Create an entry for the agent notify config file, notify.conf.
638
639              Name must be a non-empty string.
640
641              See Notify Definitions for more info.
642
643       write_notify_config(Dir, Conf) -> ok
644       write_notify_config(Dir, Hdr, Conf) -> ok
645
646              Types:
647
648                 Dir = string()
649                 Hdr = string()
650                 Conf = [notify_entry()]
651
652              Write the agent notify config to the agent notify config file.
653
654              Dir is the path to the directory where to store the config file.
655
656              Hdr  is  an optional file header (note that this text is written
657              to the file as is).
658
659              See Notify Definitions for more info.
660
661       append_notify_config(Dir, Conf) -> ok
662
663              Types:
664
665                 Dir = string()
666                 Conf = [notify_entry()]
667
668              Append the notify config to  the  current  agent  notify  config
669              file.
670
671              Dir is the path to the directory where to store the config file.
672
673              See Notify Definitions for more info.
674
675       read_notify_config(Dir) -> Conf
676
677              Types:
678
679                 Dir = string()
680                 Conf = [community_entry()]
681
682              Read the current agent notify config file.
683
684              Dir is the path to the directory where to store the config file.
685
686              See Notify Definitions for more info.
687
688
689
690Ericsson AB                        snmp 5.8                      snmpa_conf(3)
Impressum