File: snmpc.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (292 lines) | stat: -rw-r--r-- 8,374 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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>snmpc</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
  <STYLE TYPE="text/css">
<!--
    .REFBODY     { margin-left: 13mm }
    .REFTYPES    { margin-left: 8mm }
-->
  </STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
  <IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>snmpc</H1>
</CENTER>

<H3>MODULE</H3>
<DIV CLASS=REFBODY>
snmpc
</DIV>

<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
 Interface Functions to the SNMP toolkit MIB compiler

</DIV>

<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>

<P>The module <CODE>snmpc</CODE> contains interface functions to the 
SNMP toolkit MIB compiler.
</DIV>

<H3>EXPORTS</H3>

<P><A NAME="compile/1"><STRONG><CODE>compile(File)</CODE></STRONG></A><BR>
<A NAME="compile/2"><STRONG><CODE>compile(File, Options) -&#62; {ok, BinFileName} | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>File = string()</CODE></STRONG><BR>
<STRONG><CODE>Options = [opt()]</CODE></STRONG><BR>
<STRONG><CODE>opt() = db() | deprecated() | description() | group_check() | 
         i() | il() | imports() | module() | module_identity() | outdir() | 
         no_defs() | verbosity() | warnings()</CODE></STRONG><BR>
<STRONG><CODE>db() = {db, volatile|persistent|mnesia}</CODE></STRONG><BR>
<STRONG><CODE>deprecated() = {deprecated, bool()}</CODE></STRONG><BR>
<STRONG><CODE>description() = description</CODE></STRONG><BR>
<STRONG><CODE>group_check() = {group_check, bool()}</CODE></STRONG><BR>
<STRONG><CODE>i() = {i, [dir()]}</CODE></STRONG><BR>
<STRONG><CODE>il() = {il, [dir()]}</CODE></STRONG><BR>
<STRONG><CODE>imports() = imports</CODE></STRONG><BR>
<STRONG><CODE>module() = {module, atom()}</CODE></STRONG><BR>
<STRONG><CODE>module_identity() = module_identity</CODE></STRONG><BR>
<STRONG><CODE>no_defs() = no_defs</CODE></STRONG><BR>
<STRONG><CODE>outdir() = {outdir, dir()}</CODE></STRONG><BR>
<STRONG><CODE>verbosity() = {verbosity, silence|warning|info|log|debug|trace}</CODE></STRONG><BR>
<STRONG><CODE>warnings() = {warnings, bool()}</CODE></STRONG><BR>
<STRONG><CODE>dir() = string()</CODE></STRONG><BR>
<STRONG><CODE>BinFileName = string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>
<A NAME="compiler_opts"><!-- Empty --></A>
<P>Compiles the specified MIB file <CODE>&#60;File&#62;.mib</CODE>. The
         compiled file <CODE>BinFileName</CODE> is called <CODE>&#60;File&#62;.bin</CODE>.

        
<P>
<UL>

<LI>
The option <CODE>db</CODE> specifies which database should
         be used for the default instrumentation. Default is
         <CODE>volatile</CODE>.
         
         
</LI>


<LI>
The option <CODE>deprecated</CODE> specifies if a deprecated 
         definition should be kept or not. If the option is 
         false the MIB compiler will ignore all deprecated
         definitions. Default is <CODE>true</CODE>.

         
</LI>


<LI>
The option <CODE>description</CODE> specifies if the text
         of the DESCRIPTION field will be included or not. By default 
         it is not included, but if this option is present it will
         be.

         
</LI>


<LI>
The option <CODE>group_check</CODE> specifies whether the
         mib compiler should check the OBJECT-GROUP macro and
the NOTIFICATION-GROUP macro for correctness or not. 
Default is <CODE>true</CODE>.
         
         
</LI>


<LI>
The option <CODE>i</CODE> specifies the path to search for
         imported (compiled) MIB files. The directories should be
         strings with a trailing directory delimiter. Default is
         <CODE>[&#34;./&#34;]</CODE>.
         
         
</LI>


<LI>
The option <CODE>il</CODE> (include_lib) also specifies a
         list of directories to search for imported MIBs. It
         assumes that the first element in the directory name
         corresponds to an OTP application. The compiler will find
         the current installed version. For example, the value
         [&#34;snmp/mibs/&#34;] will be replaced by [&#34;snmp-3.1.1/mibs/&#34;]
         (or what the current version may be in the system). The
         current directory and the <CODE>&#60;snmp-home&#62;/priv/mibs/</CODE>
         are always listed last in the include path.

         
</LI>


<LI>
The option <CODE>imports</CODE>, if present, specifies that the
         IMPORT statement of the MIB shall be included in the compiled mib.

         
</LI>


<LI>
The option <CODE>module</CODE>, if present, specifies the
         name of a module which implements all instrumentation
         functions for the MIB. The name of all instrumentation
         functions must be the same as the corresponding managed
         object it implements.

         
</LI>


<LI>
The option <CODE>module_identity</CODE>, if present, specifies 
         that the info part of the MODULE-IDENTITY statement of the MIB 
         shall be included in the compiled mib.

         
</LI>


<LI>
The option <CODE>no_defs</CODE>, if present, specifies 
         that if a managed object does not have an instrumentation
         function, the default instrumentation function should NOT
         be used, instead this is reported as an error, and the
         compilatoin aborts.

         
</LI>


<LI>
The option <CODE>verbosity</CODE> specifies the verbosity of
         the SNMP mib compiler. I.e. if warning, info, log, debug 
         and trace messages shall be shown. Default is <CODE>silence</CODE>.
         Note that if the option <CODE>warnings</CODE> is <CODE>true</CODE> and the 
         option <CODE>verbosity</CODE> is <CODE>silence</CODE>, warning messages will
         still be shown.

         
</LI>


<LI>
The option <CODE>warnings</CODE> specifies whether warning
         messages should be shown. Default is <CODE>true</CODE>.

        
</LI>


</UL>

<P>The MIB compiler understands both SMIv1 and SMIv2 MIBs. It
         uses the <CODE>MODULE-IDENTITY</CODE> statement to determine if the MIB is
         version 1 or 2.


<P>The MIB compiler can be invoked from the OS command line by
         using the command <CODE>erlc</CODE>. <CODE>erlc</CODE> recognises the
         extension <CODE>.mib</CODE>, and invokes the SNMP MIB compiler for
         files with that extension. The options <CODE>db</CODE>, 
         <CODE>group_check</CODE>, <CODE>deprecated</CODE>, <CODE>description</CODE>,
         <CODE>verbosity</CODE>, <CODE>imports</CODE> and <CODE>module_identity</CODE>
         have to be specified to <CODE>erlc</CODE> using the syntax 
         <CODE>+term</CODE>. See <CODE>erlc(1)</CODE> for details.


</DIV>

<P><A NAME="is_consistent/1"><STRONG><CODE>is_consistent(Mibs) -&#62; ok | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>Mibs = [MibName]</CODE></STRONG><BR>
<STRONG><CODE>MibName = string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Checks for multiple usage of object identifiers and traps
         between MIBs.
         

</DIV>

<P><A NAME="mib_to_hrl/1"><STRONG><CODE>mib_to_hrl(MibName) -&#62; ok | {error, Reason}</CODE></STRONG></A><BR>

<DIV CLASS=REFBODY><P>Types:
  <DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>MibName = string()</CODE></STRONG><BR>

  </DIV>
</DIV>

<DIV CLASS=REFBODY>

<P>Generates a <CODE>.hrl</CODE> file with definitions of Erlang
         constants for the objects in the MIB. The <CODE>.hrl</CODE> file is
         called <CODE>&#60;MibName&#62;.hrl</CODE>. The MIB must be compiled, and
         present in the current directory.


<P>The <CODE>mib_to_hrl</CODE> generator can be invoked from the OS
command line by using the command <CODE>erlc</CODE>. <CODE>erlc</CODE>
recognises the extension <CODE>.bin</CODE>, and invokes this function
        for files with that extension.


</DIV>

<H3>See Also</H3>
<DIV CLASS=REFBODY>

<P>erlc(1)


</DIV>

<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Micael Karlberg - support@erlang.ericsson.se<BR>

</DIV>
<CENTER>
<HR>
<SMALL>snmp 4.8.2<BR>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>