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
|
.TH snmpc 3 "snmp 4.11" "Ericsson AB" "ERLANG MODULE DEFINITION"
.SH MODULE
snmpc \- Interface Functions to the SNMP toolkit MIB compiler
.SH DESCRIPTION
.LP
The module \fIsnmpc\fR contains interface functions to the SNMP toolkit MIB compiler\&.
.SH EXPORTS
.LP
.B
compile(File)
.br
.B
compile(File, Options) -> {ok, BinFileName} | {error, Reason}
.br
.RS
.TP
Types
File = string()
.br
Options = [opt()]
.br
opt() = db() | deprecated() | description() | group_check() | i() | il() | imports() | module() | module_identity() | outdir() | no_defs() | verbosity() | warnings()
.br
db() = {db, volatile|persistent|mnesia}
.br
deprecated() = {deprecated, bool()}
.br
description() = description
.br
group_check() = {group_check, bool()}
.br
i() = {i, [dir()]}
.br
il() = {il, [dir()]}
.br
imports() = imports
.br
module() = {module, atom()}
.br
module_identity() = module_identity
.br
no_defs() = no_defs
.br
outdir() = {outdir, dir()}
.br
verbosity() = {verbosity, silence|warning|info|log|debug|trace}
.br
warnings() = {warnings, bool()}
.br
dir() = string()
.br
BinFileName = string()
.br
.RE
.RS
.LP
Compiles the specified MIB file \fI<File>\&.mib\fR\&. The compiled file \fIBinFileName\fR is called \fI<File>\&.bin\fR\&.
.RS 2
.TP 2
*
The option \fIdb\fR specifies which database should be used for the default instrumentation\&. Default is \fIvolatile\fR\&.
.TP 2
*
The option \fIdeprecated\fR 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 \fItrue\fR\&.
.TP 2
*
The option \fIdescription\fR 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\&.
.TP 2
*
The option \fIgroup_check\fR specifies whether the mib compiler should check the OBJECT-GROUP macro and the NOTIFICATION-GROUP macro for correctness or not\&. Default is \fItrue\fR\&.
.TP 2
*
The option \fIi\fR specifies the path to search for imported (compiled) MIB files\&. The directories should be strings with a trailing directory delimiter\&. Default is \fI["\&./"]\fR\&.
.TP 2
*
The option \fIil\fR (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 ["snmp/mibs/"] will be replaced by ["snmp-3\&.1\&.1/mibs/"] (or what the current version may be in the system)\&. The current directory and the \fI<snmp-home>/priv/mibs/\fR are always listed last in the include path\&.
.TP 2
*
The option \fIimports\fR, if present, specifies that the IMPORT statement of the MIB shall be included in the compiled mib\&.
.TP 2
*
The option \fImodule\fR, 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\&.
.TP 2
*
The option \fImodule_identity\fR, if present, specifies that the info part of the MODULE-IDENTITY statement of the MIB shall be included in the compiled mib\&.
.TP 2
*
The option \fIno_defs\fR, 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 compilation aborts\&.
.TP 2
*
The option \fIverbosity\fR specifies the verbosity of the SNMP mib compiler\&. I\&.e\&. if warning, info, log, debug and trace messages shall be shown\&. Default is \fIsilence\fR\&. Note that if the option \fIwarnings\fR is \fItrue\fR and the option \fIverbosity\fR is \fIsilence\fR, warning messages will still be shown\&.
.TP 2
*
The option \fIwarnings\fR specifies whether warning messages should be shown\&. Default is \fItrue\fR\&.
.RE
.LP
The MIB compiler understands both SMIv1 and SMIv2 MIBs\&. It uses the \fIMODULE-IDENTITY\fR statement to determine if the MIB is version 1 or 2\&.
.LP
The MIB compiler can be invoked from the OS command line by using the command \fIerlc\fR\&. \fIerlc\fR recognizes the extension \fI\&.mib\fR, and invokes the SNMP MIB compiler for files with that extension\&. The options \fIdb\fR, \fIgroup_check\fR, \fIdeprecated\fR, \fIdescription\fR, \fIverbosity\fR, \fIimports\fR and \fImodule_identity\fR have to be specified to \fIerlc\fR using the syntax \fI+term\fR\&. See \fIerlc(1)\fR for details\&.
.RE
.LP
.B
is_consistent(Mibs) -> ok | {error, Reason}
.br
.RS
.TP
Types
Mibs = [MibName]
.br
MibName = string()
.br
.RE
.RS
.LP
Checks for multiple usage of object identifiers and traps between MIBs\&.
.RE
.LP
.B
mib_to_hrl(MibName) -> ok | {error, Reason}
.br
.RS
.TP
Types
MibName = string()
.br
.RE
.RS
.LP
Generates a \fI\&.hrl\fR file with definitions of Erlang constants for the objects in the MIB\&. The \fI\&.hrl\fR file is called \fI<MibName>\&.hrl\fR\&. The MIB must be compiled, and present in the current directory\&.
.LP
The \fImib_to_hrl\fR generator can be invoked from the OS command line by using the command \fIerlc\fR\&. \fIerlc\fR recognizes the extension \fI\&.bin\fR, and invokes this function for files with that extension\&.
.RE
.SH SEE ALSO
.LP
erlc(1)
|