1VARIABLES(5) Net-SNMP VARIABLES(5)
2
3
4
6 variables - Format of specifying variable names to SNMP tools.
7
9 The syntax and semantics of management information in SNMP is given by
10 the definitions of MIB objects, loaded from one or more MIB files (or
11 "MIB modules"). These definitions are not strictly required for the
12 SNMP protocol to operate correctly, but are typically needed by SNMP
13 client applications to display information in a meaningful manner.
14
15 The MIB file also serves as a design document when developing an SNMP
16 agent (or sub-agent) that provides this information, and ensures that
17 client and server share a common understanding about what management
18 information represents.
19
20
22 MIB objects are specified using Object Identifiers (OIDs), which can
23 take a number of forms. Note that all of the examples in this section
24 refer to the same MIB object.
25
26 Numeric OIDs
27 The fundamental format of an OID is a sequence of integer values (or
28 "subidentifiers"), typically written using dots to separate the indi‐
29 vidual subidentifiers.
30 .1.3.6.1.2.1.1.1
31 This is the format that is used within the SNMP protocol itself, in the
32 packets that are sent over the network.
33
34 This form of representing an OID does not require MIB files or MIB ob‐
35 ject definitions to be available. However it does rely on the client
36 application and/or network administrator knowing what a given numeric
37 OID refers to. As such, it is not a particularly helpful representa‐
38 tion to anyone just starting out with SNMP.
39
40 This format can be obtained by giving the command-line option -On to
41 most Net-SNMP commands.
42
43
44 Full OID path
45 A similar (but somewhat more informative) format uses the same dotted
46 list representation, but with the numeric subidentifiers replaced by
47 names, taken from the relevant MIB file(s).
48 .iso.org.dod.internet.mgmt.mib-2.system.sysDescr
49 This uniquely identifies a particular MIB object (as with the numeric
50 OID), but the list of names should hopefully give some indication as to
51 what information this object represents. However it does rely on the
52 relevant MIB files being available (as do all formats other than the
53 purely numeric OID). Such OIDs also tend to be fairly long!
54
55 This format can be obtained by giving the command-line option -Of to
56 most Net-SNMP commands.
57
58 A variant of this (typically used when writing OIDs in descriptive
59 text, rather than running programs), is to combine the name and numeric
60 subidentifier:
61 .iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).system(1)
62 .sysDescr(1)
63
64
65 Module-qualified OIDs
66 An alternative way to (more-or-less) uniquely specify an OID, is to
67 give the name of the MIB object, together with the MIB module where it
68 is defined.
69 SNMPv2-MIB::sysDescr
70 MIB object names are unique within a given module, so as long as there
71 are not two MIB modules with the same name (which is unusual, though
72 not unheard of), this format specifies the desired object in a reason‐
73 ably compact form. It also makes it relatively easy to find the defi‐
74 nition of the MIB object.
75
76 This is the default format for displaying OIDs in Net-SNMP applica‐
77 tions. It can also be specified explicitly by giving the command-line
78 option -OS to most Net-SNMP commands.
79
80
81 Object name
82 Possibly the most common form for specifying MIB objects is using the
83 name of the object alone - without the full path or the name of the
84 module that defines it.
85 sysDescr
86 This is by far the shortest and most convenient way to refer to a MIB
87 object. However the danger is that if two MIB modules each define a
88 MIB object with the same name (which is perfectly legal in some circum‐
89 stances), then it's not necessarily clear which MIB object is actually
90 meant. For day-to-day use, particularly when using standard MIB ob‐
91 jects, this is probaby safe. But it's important to be aware of the po‐
92 tential ambiguities.
93
94 This format can be obtained by giving the command-line option -Os to
95 most Net-SNMP commands.
96
97
98 UCD-format
99 Previous versions of the code (UCD v4.x and earlier) used a simple ap‐
100 proach to shortening the way OIDs were specified. If the full path of
101 the OID began with .iso.org.dod.internet.mgmt.mib-2 then this prefix
102 was removed from the OID before displaying it. All other OIDs were
103 displayed in full.
104
105 Similarly, if an OID was passed to the UCD library that did not begin
106 with a dot (and wasn't in the module::name format), then the same pre‐
107 fix was prepended. The example OID from the formats listed above
108 would therefore be given or displayed as
109 system.sysDescr
110 The inconsistent handling of OIDs, depending on their location within
111 the OID tree, proved to be more trouble than it was worth, and this
112 format is no longer recommended.
113
114 The previous behaviour can be obtained by giving the command-line op‐
115 tion -Ou (for displaying output), or -Iu (for interpreting input OIDs
116 without a leading dot) to most Net-SNMP commands.
117
119 snmpcmd(1)
120
122 The parser of the MIB files file is not expected to handle bizarre (al‐
123 though correct) interpretations of the ASN.1 notation.
124
125
126
127
128
129V5.9.4.pre2 01 Oct 2010 VARIABLES(5)