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

NAME

6       snmpc - Interface Functions to the SNMP toolkit MIB compiler
7

DESCRIPTION

9       The  module  snmpc contains interface functions to the SNMP toolkit MIB
10       compiler.
11

EXPORTS

13       compile(File)
14       compile(File, Options) -> {ok, BinFileName} | {error, Reason}
15
16              Types:
17
18                 File = string()
19                 Options = [opt()]
20                 opt() = db() | relaxed_row_name_assign_check() | deprecated()
21                 |  description() | reference() | group_check() | i() | il() |
22                 imports() | module()  |  module_identity()  |  module_compli‐
23                 ance()  |  agent_capabilities() | outdir() | no_defs() | ver‐
24                 bosity() | warnings() | warnings_as_errors()
25                 db() = {db, volatile|persistent|mnesia}
26                 deprecated() = {deprecated, bool()}
27                 relaxed_row_name_assign_check()    =     relaxed_row_name_as‐
28                 sign_check
29                 description() = description
30                 reference() = reference
31                 group_check() = {group_check, bool()}
32                 i() = {i, [dir()]}
33                 il() = {il, [dir()]}
34                 imports() = imports
35                 module() = {module, atom()}
36                 module_identity() = module_identity
37                 module_compliance() = module_compliance
38                 agent_capabilities() = agent_capabilities
39                 no_defs() = no_defs
40                 outdir() = {outdir, dir()}
41                 verbosity()    =   {verbosity,   silence|warning|info|log|de‐
42                 bug|trace}
43                 warnings() = {warnings, bool()}
44                 warnings_as_errors() = warnings_as_errors
45                 dir() = string()
46                 BinFileName = string()
47
48              Compiles the specified MIB file <File>.mib.  The  compiled  file
49              BinFileName is called <File>.bin.
50
51                * The  option  db  specifies which database should be used for
52                  the default instrumentation.
53
54                  Default is volatile.
55
56                * The option deprecated specifies if a  deprecated  definition
57                  should  be  kept or not. If the option is false the MIB com‐
58                  piler will ignore all deprecated definitions.
59
60                  Default is true.
61
62                * The option relaxed_row_name_assign_check, if present, speci‐
63                  fies  that  the  row  name  assign  check  shall not be done
64                  strictly according to the SMI (which allows only  the  value
65                  1).  With  this  option, all values greater than zero is al‐
66                  lowed (>= 1). This means that the error will be converted to
67                  a warning.
68
69                  By default it is not included, but if this option is present
70                  it will be.
71
72                * The option description specifies if the text of the DESCRIP‐
73                  TION field will be included or not.
74
75                  By default it is not included, but if this option is present
76                  it will be.
77
78                * The option reference specifies if the text of the  REFERENCE
79                  field, when found in a table definition, will be included or
80                  not.
81
82                  By default it is not included, but if this option is present
83                  it  will  be. The reference text will be placed in the allo‐
84                  cList field of the mib-entry record (#me{}) for the table.
85
86                * The option group_check specifies whether  the  mib  compiler
87                  should  check  the  OBJECT-GROUP macro and the NOTIFICATION-
88                  GROUP macro for correctness or not.
89
90                  Default is true.
91
92                * The option i specifies the path to search for imported (com‐
93                  piled)  MIB  files. The directories should be strings with a
94                  trailing directory delimiter.
95
96                  Default is ["./"].
97
98                * The option il (include_lib) also specifies a list of  direc‐
99                  tories  to  search  for  imported  MIBs. It assumes that the
100                  first element in the directory name corresponds  to  an  OTP
101                  application.  The  compiler  will find the current installed
102                  version. For example, the value ["snmp/mibs/"] will  be  re‐
103                  placed  by ["snmp-3.1.1/mibs/"] (or what the current version
104                  may be in the system). The current directory and the  <snmp-
105                  home>/priv/mibs/ are always listed last in the include path.
106
107                * The  option  imports,  if present, specifies that the IMPORT
108                  statement of the MIB shall be included in the compiled mib.
109
110                * The option module, if present, specifies the name of a  mod‐
111                  ule  which  implements all instrumentation functions for the
112                  MIB.
113
114                  The name of all instrumentation functions must be  the  same
115                  as the corresponding managed object it implements.
116
117                * The  option  module_identity, if present, specifies that the
118                  info part of the MODULE-IDENTITY statement of the MIB  shall
119                  be included in the compiled mib.
120
121                * The option module_compliance, if present, specifies that the
122                  MODULE-COMPLIANCE statement of the  MIB  shall  be  included
123                  (with a mib-entry record) in the compiled mib. The mib-entry
124                  record of the module-compliance will contain  reference  and
125                  module part(s) this info in the assocList field).
126
127                * The  option  agent_capabilities,  if present, specifies that
128                  the AGENT-CAPABILITIES statement of the  MIB  shall  be  in‐
129                  cluded  (with  a  mib-entry record) in the compiled mib. The
130                  mib-entry record of the agent-capabilitie will contain  ref‐
131                  erence  and  modules  part(s)  this  info  in  the assocList
132                  field).
133
134                * The option no_defs, if present, specifies that if a  managed
135                  object  does  not  have an instrumentation function, the de‐
136                  fault instrumentation function should NOT be  used,  instead
137                  this is reported as an error, and the compilation aborts.
138
139                * The option verbosity specifies the verbosity of the SNMP mib
140                  compiler. I.e. if warning, info, log, debug and  trace  mes‐
141                  sages shall be shown.
142
143                  Default is silence.
144
145                  Note that if the option warnings is true and the option ver‐
146                  bosity is silence, warning messages will still be shown.
147
148                * The  option  warnings  specifies  whether  warning  messages
149                  should be shown.
150
151                  Default is true.
152
153                * The option warnings_as_errors, if present, specifies whether
154                  warnings should be treated as errors.
155
156              The MIB compiler understands both SMIv1 and SMIv2 MIBs. It  uses
157              the MODULE-IDENTITY statement to determine if the MIB is version
158              1 or 2.
159
160              The MIB compiler can be invoked from the OS command line by  us‐
161              ing  the  command  erlc. erlc recognizes the extension .mib, and
162              invokes the SNMP MIB compiler for files with that extension. The
163              options db, group_check, deprecated, description, verbosity, im‐
164              ports and module_identity have to be specified to erlc using the
165              syntax +term. See erlc(1) for details.
166
167       is_consistent(Mibs) -> ok | {error, Reason}
168
169              Types:
170
171                 Mibs = [MibName]
172                 MibName = string()
173
174              Checks  for  multiple  usage of object identifiers and traps be‐
175              tween MIBs.
176
177       mib_to_hrl(MibName) -> ok | {error, Reason}
178
179              Types:
180
181                 MibName = string()
182
183              Generates a .hrl file with definitions of Erlang  constants  for
184              the  objects  in the MIB. The .hrl file is called <MibName>.hrl.
185              The MIB must be compiled, and present in the current directory.
186
187              The mib_to_hrl generator can be invoked from the OS command line
188              by  using  the command erlc. erlc recognizes the extension .bin,
189              and invokes this function for files with that extension.
190

SEE ALSO

192       erlc(1)
193
194
195
196Ericsson AB                       snmp 5.13.3                         snmpc(3)
Impressum