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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
plugin_name: go.d.plugin
modules:
- meta:
id: collector-go.d.plugin-snmp
plugin_name: go.d.plugin
module_name: snmp
monitored_instance:
name: SNMP devices
link: ""
icon_filename: snmp.png
categories:
- data-collection.generic-data-collection
keywords:
- snmp
related_resources:
integrations:
list: []
info_provided_to_referring_integrations:
description: ""
most_popular: true
overview:
data_collection:
metrics_description: |
This collector monitors any SNMP devices and uses the [gosnmp](https://github.com/gosnmp/gosnmp) package.
It supports:
- all SNMP versions: SNMPv1, SNMPv2c and SNMPv3.
- any number of SNMP devices.
- each SNMP device can be used to collect data for any number of charts.
- each chart may have any number of dimensions.
- each SNMP device may have a different update frequency.
- each SNMP device will accept one or more batches to report values (you can set `max_request_size` per SNMP server, to control the size of batches).
Keep in mind that many SNMP switches and routers are very slow. They may not be able to report values per second.
`go.d.plugin` reports the time it took for the SNMP device to respond when executed in the debug mode.
Also, if many SNMP clients are used on the same SNMP device at the same time, values may be skipped.
This is a problem of the SNMP device, not this collector. In this case, consider reducing the frequency of data collection (increasing `update_every`).
method_description: ""
supported_platforms:
include: []
exclude: []
multi_instance: true
additional_permissions:
description: ""
default_behavior:
auto_detection:
description: ""
limits:
description: ""
performance_impact:
description: ""
setup:
prerequisites:
list:
- title: Find OIDs
description: |
Use `snmpwalk`, like this:
```sh
snmpwalk -t 20 -O fn -v 2c -c public 192.0.2.1
```
- `-t 20` is the timeout in seconds.
- `-O fn` will display full OIDs in numeric format.
- `-v 2c` is the SNMP version.
- `-c public` is the SNMP community.
- `192.0.2.1` is the SNMP device.
configuration:
file:
name: go.d/snmp.conf
options:
description: |
The following options can be defined globally: update_every, autodetection_retry.
folding:
title: Config options
enabled: true
list:
- name: update_every
description: Data collection frequency.
default_value: 1
required: false
- name: autodetection_retry
description: Recheck interval in seconds. Zero means no recheck will be scheduled.
default_value: 0
required: false
- name: hostname
description: Target ipv4 address.
default_value: 127.0.0.1
required: true
- name: community
description: SNMPv1/2 community string.
default_value: public
required: false
- name: options.version
description: "SNMP version. Available versions: 1, 2, 3."
default_value: 2
required: false
- name: options.port
description: Target port.
default_value: 161
required: false
- name: options.retries
description: Retries to attempt.
default_value: 1
required: false
- name: options.timeout
description: SNMP request/response timeout.
default_value: 10
required: false
- name: options.max_request_size
description: Maximum number of OIDs allowed in one one SNMP request.
default_value: 60
required: false
- name: user.name
description: SNMPv3 user name.
default_value: ""
required: false
- name: user.name
description: Security level of SNMPv3 messages.
default_value: ""
required: false
- name: user.auth_proto
description: Security level of SNMPv3 messages.
default_value: ""
required: false
detailed_description: |
The security of an SNMPv3 message as per RFC 3414 (`user.level`):
| String value | Int value | Description |
|:------------:|:---------:|------------------------------------------|
| none | 1 | no message authentication or encryption |
| authNoPriv | 2 | message authentication and no encryption |
| authPriv | 3 | message authentication and encryption |
- name: user.name
description: Authentication protocol for SNMPv3 messages.
default_value: ""
required: false
detailed_description: |
The digest algorithm for SNMPv3 messages that require authentication (`user.auth_proto`):
| String value | Int value | Description |
|:------------:|:---------:|-------------------------------------------|
| none | 1 | no message authentication |
| md5 | 2 | MD5 message authentication (HMAC-MD5-96) |
| sha | 3 | SHA message authentication (HMAC-SHA-96) |
| sha224 | 4 | SHA message authentication (HMAC-SHA-224) |
| sha256 | 5 | SHA message authentication (HMAC-SHA-256) |
| sha384 | 6 | SHA message authentication (HMAC-SHA-384) |
| sha512 | 7 | SHA message authentication (HMAC-SHA-512) |
- name: user.auth_key
description: Authentication protocol pass phrase.
default_value: ""
required: false
- name: user.priv_proto
description: Privacy protocol for SNMPv3 messages.
default_value: ""
required: false
detailed_description: |
The encryption algorithm for SNMPv3 messages that require privacy (`user.priv_proto`):
| String value | Int value | Description |
|:------------:|:---------:|-------------------------------------------------------------------------|
| none | 1 | no message encryption |
| des | 2 | ES encryption (CBC-DES) |
| aes | 3 | 128-bit AES encryption (CFB-AES-128) |
| aes192 | 4 | 192-bit AES encryption (CFB-AES-192) with "Blumenthal" key localization |
| aes256 | 5 | 256-bit AES encryption (CFB-AES-256) with "Blumenthal" key localization |
| aes192c | 6 | 192-bit AES encryption (CFB-AES-192) with "Reeder" key localization |
| aes256c | 7 | 256-bit AES encryption (CFB-AES-256) with "Reeder" key localization |
- name: user.priv_key
description: Privacy protocol pass phrase.
default_value: ""
required: false
- name: charts
description: List of charts.
default_value: "[]"
required: true
- name: charts.id
description: Chart ID. Used to uniquely identify the chart.
default_value: ""
required: true
- name: charts.title
description: Chart title.
default_value: "Untitled chart"
required: false
- name: charts.units
description: Chart units.
default_value: num
required: false
- name: charts.family
description: Chart family.
default_value: charts.id
required: false
- name: charts.type
description: Chart type (line, area, stacked).
default_value: line
required: false
- name: charts.priority
description: Chart priority.
default_value: 70000
required: false
- name: charts.multiply_range
description: Used when you need to define many charts using incremental OIDs.
default_value: "[]"
required: false
- name: charts.dimensions
description: List of chart dimensions.
default_value: "[]"
required: true
- name: charts.dimensions.oid
description: Collected metric OID.
default_value: ""
required: true
- name: charts.dimensions.name
description: Dimension name.
default_value: ""
required: true
- name: charts.dimensions.algorithm
description: Dimension algorithm (absolute, incremental).
default_value: absolute
required: false
- name: charts.dimensions.multiplier
description: Collected value multiplier, applied to convert it properly to units.
default_value: 1
required: false
- name: charts.dimensions.divisor
description: Collected value divisor, applied to convert it properly to units.
default_value: 1
required: false
examples:
folding:
title: Config
enabled: true
list:
- name: SNMPv1/2
description: |
In this example:
- the SNMP device is `192.0.2.1`.
- the SNMP version is `2`.
- the SNMP community is `public`.
- we will update the values every 10 seconds.
- we define 2 charts `bandwidth_port1` and `bandwidth_port2`, each having 2 dimensions: `in` and `out`.
> **SNMPv1**: just set `options.version` to 1.
> **Note**: the algorithm chosen is `incremental`, because the collected values show the total number of bytes transferred, which we need to transform into kbps. To chart gauges (e.g. temperature), use `absolute` instead.
config: |
jobs:
- name: switch
update_every: 10
hostname: 192.0.2.1
community: public
options:
version: 2
charts:
- id: "bandwidth_port1"
title: "Switch Bandwidth for port 1"
units: "kilobits/s"
type: "area"
family: "ports"
dimensions:
- name: "in"
oid: "1.3.6.1.2.1.2.2.1.10.1"
algorithm: "incremental"
multiplier: 8
divisor: 1000
- name: "out"
oid: "1.3.6.1.2.1.2.2.1.16.1"
multiplier: -8
divisor: 1000
- id: "bandwidth_port2"
title: "Switch Bandwidth for port 2"
units: "kilobits/s"
type: "area"
family: "ports"
dimensions:
- name: "in"
oid: "1.3.6.1.2.1.2.2.1.10.2"
algorithm: "incremental"
multiplier: 8
divisor: 1000
- name: "out"
oid: "1.3.6.1.2.1.2.2.1.16.2"
multiplier: -8
divisor: 1000
- name: SNMPv3
description: |
To use SNMPv3:
- use `user` instead of `community`.
- set `options.version` to 3.
The rest of the configuration is the same as in the SNMPv1/2 example.
config: |
jobs:
- name: switch
update_every: 10
hostname: 192.0.2.1
options:
version: 3
user:
name: username
level: authPriv
auth_proto: sha256
auth_key: auth_protocol_passphrase
priv_proto: aes256
priv_key: priv_protocol_passphrase
- name: Multiply range
description: |
If you need to define many charts using incremental OIDs, you can use the `charts.multiply_range` option.
This is like the SNMPv1/2 example, but the option will multiply the current chart from 1 to 24 inclusive, producing 24 charts in total for the 24 ports of the switch `192.0.2.1`.
Each of the 24 new charts will have its id (1-24) appended at:
- its chart unique `id`, i.e. `bandwidth_port_1` to `bandwidth_port_24`.
- its title, i.e. `Switch Bandwidth for port 1` to `Switch Bandwidth for port 24`.
- its `oid` (for all dimensions), i.e. dimension in will be `1.3.6.1.2.1.2.2.1.10.1` to `1.3.6.1.2.1.2.2.1.10.24`.
- its `priority` will be incremented for each chart so that the charts will appear on the dashboard in this order.
config: |
jobs:
- name: switch
update_every: 10
hostname: "192.0.2.1"
community: public
options:
version: 2
charts:
- id: "bandwidth_port"
title: "Switch Bandwidth for port"
units: "kilobits/s"
type: "area"
family: "ports"
multiply_range: [1, 24]
dimensions:
- name: "in"
oid: "1.3.6.1.2.1.2.2.1.10"
algorithm: "incremental"
multiplier: 8
divisor: 1000
- name: "out"
oid: "1.3.6.1.2.1.2.2.1.16"
multiplier: -8
divisor: 1000
- name: Multiple devices with a common configuration
description: |
YAML supports [anchors](https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases).
The `&` defines and names an anchor, and the `*` uses it. `<<: *anchor` means, inject the anchor, then extend. We can use anchors to share the common configuration for multiple devices.
The following example:
- adds an `anchor` to the first job.
- injects (copies) the first job configuration to the second and updates `name` and `hostname` parameters.
- injects (copies) the first job configuration to the third and updates `name` and `hostname` parameters.
config: |
jobs:
- &anchor
name: switch
update_every: 10
hostname: "192.0.2.1"
community: public
options:
version: 2
charts:
- id: "bandwidth_port1"
title: "Switch Bandwidth for port 1"
units: "kilobits/s"
type: "area"
family: "ports"
dimensions:
- name: "in"
oid: "1.3.6.1.2.1.2.2.1.10.1"
algorithm: "incremental"
multiplier: 8
divisor: 1000
- name: "out"
oid: "1.3.6.1.2.1.2.2.1.16.1"
multiplier: -8
divisor: 1000
- <<: *anchor
name: switch2
hostname: "192.0.2.2"
- <<: *anchor
name: switch3
hostname: "192.0.2.3"
troubleshooting:
problems:
list: []
alerts: []
metrics:
folding:
title: Metrics
enabled: false
description: The metrics that will be collected are defined in the configuration file.
availability: []
scopes: []
|