Collects data from any SNMP device and uses the net-snmp module.
- 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_sizeper SNMP server, to control the size of batches).
nodejsminimum required version 4
You will need to create the file
/etc/netdata/node.d/snmp.conf with data like the following.
In this example:
- the SNMP device is
- the SNMP community is
- we will update the values every 10 seconds (
update_every: 10under the server
- we define 2 charts
snmp_switch.bandwidth_port2, each having 2 dimensions:
out. Note that the charts and dimensions must not contain any white space or special characters, other than
update_every is the update frequency for each server, in seconds.
max_request_size limits the maximum number of OIDs that will be requested in a single call. The default is 50. Lower this number of you get
TooBig errors in Netdata's
family sets the name of the submenu of the dashboard each chart will appear under.
divisor are passed by the plugin to the Netdata daemon and are applied to the metric to convert it properly to
units. For incremental counters with the exception of Counter64 type metrics,
offset is added to the metric from within the SNMP plugin. This means that the value you will see in debug mode in the
DEBUG: setting current chart to... SET line for a metric will not have been multiplied or divided, but it will have had the offset added to it.
If you need to define many charts using incremental OIDs, you can use something like this:
This is like the previous, but the option
multiply_range given, will multiply the current chart from
24 inclusive, producing 24 charts in total for the 24 ports of the switch
Each of the 24 new charts will have its id (1-24) appended at:
- its chart unique id, i.e.
Switch Bandwidth for port 1to
Switch Bandwidth for port 24
oid(for all dimensions), i.e. dimension
- its priority (which will be incremented for each chart so that the charts will appear on the dashboard in this order)
options given for each server, are:
port- UDP port to send requests too. Defaults to
retries- number of times to re-send a request. Defaults to
sourceAddress- IP address from which SNMP requests should originate, there is no default for this option, the operating system will select an appropriate source address when the SNMP request is sent.
sourcePort- UDP port from which SNMP requests should originate, defaults to an ephemeral port selected by the operation system.
timeout- number of milliseconds to wait for a response before re-trying or failing. Defaults to
transport- specify the transport to use, can be either
udp6. Defaults to
3(v3). Defaults to
32. Defaults to
32. Used to reduce the size of the generated id for compatibility with some older devices.
To use SNMPv3:
- 1 is
- 2 is
- 3 is
- "1" is
- "2" is
- "3" is
- "1" is
- "2" is
For additional details please see net-snmp module readme.
You can append a value retrieved from SNMP to the title, by adding
titleoid to the chart.
You can set a dimension name to a value retrieved from SNMP, by adding
oidname to the dimension.
Both of the above will participate in
To test it, you can run:
The above will run it on your console and you will be able to see what Netdata sees, but also errors. You can get a very detailed output by appending
debug to the command line.
If it works, restart Netdata to activate the snmp collector and refresh the dashboard (if your SNMP device responds with a delay, you may need to refresh the dashboard in a few seconds).
Keep in mind that many SNMP switches and routers are very slow. They may not be able to report values per second. If you run
debug mode, it will report the time it took for the SNMP device to respond. My switch, for example, needs 7-8 seconds to respond for the traffic on 24 ports (48 OIDs, in/out).
Also, if you use many SNMP clients on the same SNMP device at the same time, values may be skipped. This is a problem of the SNMP device, not this collector.
snmpwalk, like this:
-t 20is the timeout in seconds
-v 1is the SNMP version
-O fnwill display full OIDs in numeric format (you may want to run it also without this option to see human readable output of OIDs)
-c publicis the SNMP community
10.11.12.8is the SNMP device
Keep in mind that
snmpwalk outputs the OIDs with a dot in front them. You should remove this dot when adding OIDs to the configuration file of this collector.
This is what I use for my Linksys SRW2024P. It creates:
- A chart for power consumption (it is a PoE switch)
- Two charts for packets received (total packets received and packets received with errors)
- One chart for packets output
- 24 charts, one for each port of the switch. It also appends the port names, as defined at the switch, to the chart titles.
This switch also reports various other metrics, like snmp, packets per port, etc. Unfortunately it does not report CPU utilization or backplane utilization.
This switch has a very slow SNMP processors. To respond, it needs about 8 seconds, so I have set the refresh frequency (
update_every) to 15 seconds.