Code

Revert "Revert "Merge tag 'upstream/5.5.0'""
[pkg-collectd.git] / src / collectd-snmp.5
1 .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is turned on, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
60 .    if \nF \{
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "COLLECTD-SNMP 5"
136 .TH COLLECTD-SNMP 5 "2015-03-10" "5.4.1.805.g42e4d6c" "collectd"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 collectd\-snmp \- Documentation of collectd's "snmp plugin"
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 .Vb 10
146 \&  LoadPlugin snmp
147 \&  # ...
148 \&  <Plugin snmp>
149 \&    <Data "powerplus_voltge_input">
150 \&      Type "voltage"
151 \&      Table false
152 \&      Instance "input_line1"
153 \&      Scale 0.1
154 \&      Values "SNMPv2\-SMI::enterprises.6050.5.4.1.1.2.1"
155 \&    </Data>
156 \&    <Data "hr_users">
157 \&      Type "users"
158 \&      Table false
159 \&      Instance ""
160 \&      Shift \-1
161 \&      Values "HOST\-RESOURCES\-MIB::hrSystemNumUsers.0"
162 \&    </Data>
163 \&    <Data "std_traffic">
164 \&      Type "if_octets"
165 \&      Table true
166 \&      Instance "IF\-MIB::ifDescr"
167 \&      Values "IF\-MIB::ifInOctets" "IF\-MIB::ifOutOctets"
168 \&    </Data>
169 \&
170 \&    <Host "some.switch.mydomain.org">
171 \&      Address "192.168.0.2"
172 \&      Version 1
173 \&      Community "community_string"
174 \&      Collect "std_traffic"
175 \&      Interval 120
176 \&    </Host>
177 \&    <Host "some.server.mydomain.org">
178 \&      Address "192.168.0.42"
179 \&      Version 2
180 \&      Community "another_string"
181 \&      Collect "std_traffic" "hr_users"
182 \&    </Host>
183 \&    <Host "secure.router.mydomain.org">
184 \&      Address "192.168.0.7"
185 \&      Version 3
186 \&      SecurityLevel "authPriv"
187 \&      Username "cosmo"
188 \&      AuthProtocol "SHA"
189 \&      AuthPassphrase "setec_astronomy"
190 \&      PrivacyProtocol "AES"
191 \&      PrivacyPassphrase "too_many_secrets"
192 \&      Collect "std_traffic"
193 \&    </Host>
194 \&    <Host "some.ups.mydomain.org">
195 \&      Address "192.168.0.3"
196 \&      Version 1
197 \&      Community "more_communities"
198 \&      Collect "powerplus_voltge_input"
199 \&      Interval 300
200 \&    </Host>
201 \&  </Plugin>
202 .Ve
203 .SH "DESCRIPTION"
204 .IX Header "DESCRIPTION"
205 The \f(CW\*(C`snmp plugin\*(C'\fR queries other hosts using \s-1SNMP,\s0 the simple network
206 management protocol, and translates the value it receives to collectd's
207 internal format and dispatches them. Depending on the write plugins you have
208 loaded they may be written to disk or submitted to another instance or
209 whatever you configured.
210 .PP
211 Because querying a host via \s-1SNMP\s0 may produce a timeout multiple threads are
212 used to query hosts in parallel. Depending on the number of hosts between one
213 and ten threads are used.
214 .SH "CONFIGURATION"
215 .IX Header "CONFIGURATION"
216 Since the aim of the \f(CW\*(C`snmp plugin\*(C'\fR is to provide a generic interface to \s-1SNMP,\s0
217 it's configuration is not trivial and may take some time.
218 .PP
219 Since the \f(CW\*(C`Net\-SNMP\*(C'\fR library is used you can use all the environment variables
220 that are interpreted by that package. See \fIsnmpcmd\fR\|(1) for more details.
221 .PP
222 There are two types of blocks that can be contained in the
223 \&\f(CW\*(C`<Plugin\ snmp>\*(C'\fR block: \fBData\fR and \fBHost\fR:
224 .SS "The \fBData\fP block"
225 .IX Subsection "The Data block"
226 The \fBData\fR block defines a list of values or a table of values that are to be
227 queried. The following options can be set:
228 .IP "\fBType\fR \fItype\fR" 4
229 .IX Item "Type type"
230 collectd's type that is to be used, e.\ g. \*(L"if_octets\*(R" for interface
231 traffic or \*(L"users\*(R" for a user count. The types are read from the \fBTypesDB\fR
232 (see \fIcollectd.conf\fR\|(5)), so you may want to check for which types are
233 defined. See \fItypes.db\fR\|(5) for a description of the format of this file.
234 .IP "\fBTable\fR \fItrue|false\fR" 4
235 .IX Item "Table true|false"
236 Define if this is a single list of values or a table of values. The difference
237 is the following:
238 .Sp
239 When \fBTable\fR is set to \fBfalse\fR, the OIDs given to \fBValues\fR (see below) are
240 queried using the \f(CW\*(C`GET\*(C'\fR \s-1SNMP\s0 command (see \fIsnmpget\fR\|(1)) and transmitted to
241 collectd. \fBOne\fR value list is dispatched and, eventually, one file will be
242 written.
243 .Sp
244 When \fBTable\fR is set to \fBtrue\fR, the OIDs given to \fBValues\fR (see below) are
245 queried using the \f(CW\*(C`GETNEXT\*(C'\fR \s-1SNMP\s0 command until the subtree is left. After all
246 the lists (think: all columns of the table) have been read \fBseveral\fR values
247 sets will be dispatches and, eventually, several files will be written. If you
248 configure a \fBType\fR (see above) which needs more than one data source (for
249 example \f(CW\*(C`if_octets\*(C'\fR which needs \f(CW\*(C`rx\*(C'\fR and \f(CW\*(C`tx\*(C'\fR) you will need to specify more
250 than one (two, in the example case) OIDs with the \fBValues\fR option. This has
251 nothing to do with the \fBTable\fR setting.
252 .Sp
253 For example, if you want to query the number of users on a system, you can use
254 \&\f(CW\*(C`HOST\-RESOURCES\-MIB::hrSystemNumUsers.0\*(C'\fR. This is one value and belongs to one
255 value list, therefore \fBTable\fR must be set to \fBfalse\fR. Please note that, in
256 this case, you have to include the sequence number (zero in this case) in the
257 \&\s-1OID.\s0
258 .Sp
259 Counter example: If you want to query the interface table provided by the
260 \&\f(CW\*(C`IF\-MIB\*(C'\fR, e.\ g. the bytes transmitted. There are potentially many
261 interfaces, so you will want to set \fBTable\fR to \fBtrue\fR. Because the
262 \&\f(CW\*(C`if_octets\*(C'\fR type needs two values, received and transmitted bytes, you need to
263 specify two OIDs in the \fBValues\fR setting, in this case likely
264 \&\f(CW\*(C`IF\-MIB::ifHCInOctets\*(C'\fR and \f(CW\*(C`IF\-MIB::ifHCOutOctets\*(C'\fR. But, this is because of
265 the \fBType\fR setting, not the \fBTable\fR setting.
266 .Sp
267 Since the semantic of \fBInstance\fR and \fBValues\fR depends on this setting you
268 need to set it before setting them. Doing vice verse will result in undefined
269 behavior.
270 .IP "\fBInstance\fR \fIInstance\fR" 4
271 .IX Item "Instance Instance"
272 Sets the type-instance of the values that are dispatched. The meaning of this
273 setting depends on whether \fBTable\fR is set to \fItrue\fR or \fIfalse\fR:
274 .Sp
275 If \fBTable\fR is set to \fItrue\fR, \fIInstance\fR is interpreted as an SNMP-prefix
276 that will return a list of values. Those values are then used as the actual
277 type-instance. An example would be the \f(CW\*(C`IF\-MIB::ifDescr\*(C'\fR subtree.
278 \&\fIvariables\fR\|(5) from the \s-1SNMP\s0 distribution describes the format of OIDs.
279 .Sp
280 If \fBTable\fR is set to \fItrue\fR and \fBInstance\fR is omitted, then \*(L"\s-1SUBID\*(R"\s0 will be
281 used as the instance.
282 .Sp
283 If \fBTable\fR is set to \fIfalse\fR the actual string configured for \fIInstance\fR is
284 copied into the value-list. In this case \fIInstance\fR may be empty, i.\ e.
285 "".
286 .IP "\fBInstancePrefix\fR \fIString\fR" 4
287 .IX Item "InstancePrefix String"
288 If \fBTable\fR is set to \fItrue\fR, you may feel the need to add something to the
289 instance of the files. If set, \fIString\fR is prepended to the instance as
290 determined by querying the agent. When \fBTable\fR is set to \fIfalse\fR this option
291 has no effect.
292 .Sp
293 The \f(CW\*(C`UPS\-MIB\*(C'\fR is an example where you need this setting: It has voltages of
294 the inlets, outlets and the battery of an \s-1UPS.\s0 However, it doesn't provide a
295 descriptive column for these voltages. In this case having 1, 2,\ ... as
296 instances is not enough, because the inlet voltages and outlet voltages may
297 both have the subids 1, 2,\ ... You can use this setting to distinguish
298 between the different voltages.
299 .IP "\fBValues\fR \fI\s-1OID\s0\fR [\fI\s-1OID\s0\fR ...]" 4
300 .IX Item "Values OID [OID ...]"
301 Configures the values to be queried from the \s-1SNMP\s0 host. The meaning slightly
302 changes with the \fBTable\fR setting. \fIvariables\fR\|(5) from the \s-1SNMP\s0 distribution
303 describes the format of OIDs.
304 .Sp
305 If \fBTable\fR is set to \fItrue\fR, each \fI\s-1OID\s0\fR must be the prefix of all the
306 values to query, e.\ g. \f(CW\*(C`IF\-MIB::ifInOctets\*(C'\fR for all the counters of
307 incoming traffic. This subtree is walked (using \f(CW\*(C`GETNEXT\*(C'\fR) until a value from
308 outside the subtree is returned.
309 .Sp
310 If \fBTable\fR is set to \fIfalse\fR, each \fI\s-1OID\s0\fR must be the \s-1OID\s0 of exactly one
311 value, e.\ g. \f(CW\*(C`IF\-MIB::ifInOctets.3\*(C'\fR for the third counter of incoming
312 traffic.
313 .IP "\fBScale\fR \fIValue\fR" 4
314 .IX Item "Scale Value"
315 The gauge-values returned by the SNMP-agent are multiplied by \fIValue\fR.  This
316 is useful when values are transferred as a fixed point real number. For example,
317 thermometers may transfer \fB243\fR but actually mean \fB24.3\fR, so you can specify
318 a scale value of \fB0.1\fR to correct this. The default value is, of course,
319 \&\fB1.0\fR.
320 .Sp
321 This value is not applied to counter-values.
322 .IP "\fBShift\fR \fIValue\fR" 4
323 .IX Item "Shift Value"
324 \&\fIValue\fR is added to gauge-values returned by the SNMP-agent after they have
325 been multiplied by any \fBScale\fR value. If, for example, a thermometer returns
326 degrees Kelvin you could specify a shift of \fB273.15\fR here to store values in
327 degrees Celsius. The default value is, of course, \fB0.0\fR.
328 .Sp
329 This value is not applied to counter-values.
330 .IP "\fBIgnore\fR \fIValue\fR [, \fIValue\fR ...]" 4
331 .IX Item "Ignore Value [, Value ...]"
332 The ignore values allows to ignore Instances based on their name and the patterns
333 specified by the various values you've entered. The match is a glob-type shell
334 matching.
335 .IP "\fBInvertMatch\fR \fItrue|false(default)\fR" 4
336 .IX Item "InvertMatch true|false(default)"
337 The invertmatch value should be use in combination of the Ignore option.
338 It changes the behaviour of the Ignore option, from a blacklist behaviour
339 when InvertMatch is set to false, to a whitelist when specified to true.
340 .SS "The Host block"
341 .IX Subsection "The Host block"
342 The \fBHost\fR block defines which hosts to query, which \s-1SNMP\s0 community and
343 version to use and which of the defined \fBData\fR to query.
344 .PP
345 The argument passed to the \fBHost\fR block is used as the hostname in the data
346 stored by collectd.
347 .IP "\fBAddress\fR \fIIP-Address\fR|\fIHostname\fR" 4
348 .IX Item "Address IP-Address|Hostname"
349 Set the address to connect to.
350 .IP "\fBVersion\fR \fB1\fR|\fB2\fR|\fB3\fR" 4
351 .IX Item "Version 1|2|3"
352 Set the \s-1SNMP\s0 version to use. When giving \fB2\fR version \f(CW\*(C`2c\*(C'\fR is actually used.
353 .IP "\fBCommunity\fR \fICommunity\fR" 4
354 .IX Item "Community Community"
355 Pass \fICommunity\fR to the host. (Ignored for SNMPv3).
356 .IP "\fBUsername\fR \fIUsername\fR" 4
357 .IX Item "Username Username"
358 Sets the \fIUsername\fR to use for SNMPv3 security.
359 .IP "\fBSecurityLevel\fR \fIauthPriv\fR|\fIauthNoPriv\fR|\fInoAuthNoPriv\fR" 4
360 .IX Item "SecurityLevel authPriv|authNoPriv|noAuthNoPriv"
361 Selects the security level for SNMPv3 security.
362 .IP "\fBContext\fR \fIContext\fR" 4
363 .IX Item "Context Context"
364 Sets the \fIContext\fR for SNMPv3 security.
365 .IP "\fBAuthProtocol\fR \fI\s-1MD5\s0\fR|\fI\s-1SHA\s0\fR" 4
366 .IX Item "AuthProtocol MD5|SHA"
367 Selects the authentication protocol for SNMPv3 security.
368 .IP "\fBAuthPassphrase\fR \fIPassphrase\fR" 4
369 .IX Item "AuthPassphrase Passphrase"
370 Sets the authentication passphrase for SNMPv3 security.
371 .IP "\fBPrivacyProtocol\fR \fI\s-1AES\s0\fR|\fI\s-1DES\s0\fR" 4
372 .IX Item "PrivacyProtocol AES|DES"
373 Selects the privacy (encryption) protocol for SNMPv3 security.
374 .IP "\fBPrivacyPassphrase\fR \fIPassphrase\fR" 4
375 .IX Item "PrivacyPassphrase Passphrase"
376 Sets the privacy (encryption) passphrase for SNMPv3 security.
377 .IP "\fBCollect\fR \fIData\fR [\fIData\fR ...]" 4
378 .IX Item "Collect Data [Data ...]"
379 Defines which values to collect. \fIData\fR refers to one of the \fBData\fR block
380 above. Since the config file is read top-down you need to define the data
381 before using it here.
382 .IP "\fBInterval\fR \fISeconds\fR" 4
383 .IX Item "Interval Seconds"
384 Collect data from this host every \fISeconds\fR seconds. This option is meant for
385 devices with not much \s-1CPU\s0 power, e.\ g. network equipment such as
386 switches, embedded devices, rack monitoring systems and so on. Since the
387 \&\fBStep\fR of generated \s-1RRD\s0 files depends on this setting it's wise to select a
388 reasonable value once and never change it.
389 .SH "SEE ALSO"
390 .IX Header "SEE ALSO"
391 \&\fIcollectd\fR\|(1),
392 \&\fIcollectd.conf\fR\|(5),
393 \&\fIsnmpget\fR\|(1),
394 \&\fIsnmpgetnext\fR\|(1),
395 \&\fIvariables\fR\|(5),
396 \&\fIunix\fR\|(7)
397 .SH "AUTHORS"
398 .IX Header "AUTHORS"
399 Florian Forster <octo@collectd.org>
400 Michael Pilat <mike@mikepilat.com>