Skip to content
SNMP Exporter for Prometheus
Go Makefile Dockerfile
Branch: master
Clone or download

Latest commit

chewrocca Updating to APC powernet432.mib (#523)
* Update for new APC mib

Signed-off-by: Matt Fine <17680862+chewrocca@users.noreply.github.com>
Latest commit 23054b7 May 26, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Bump go version to 1.14 (#513) May 1, 2020
.github ISSUE_TEMPLATE.md: (Hopefully) improve issue information Jun 6, 2017
config Reduce and fix timeout/docs for SNMP requests (#511) May 20, 2020
generator Updating to APC powernet432.mib (#523) May 26, 2020
testdata Extract numeric time series from string values (#212) Aug 14, 2017
vendor Update vendoring (#483) Feb 14, 2020
.dockerignore Add ppc64le arch to build process Mar 29, 2020
.gitignore Add MIB downloader to generator (#332) Sep 18, 2018
.golangci.yml Add .golangci.yml Apr 25, 2019
.promu.yml Bump go version to 1.14 (#513) May 1, 2020
.travis.yml Bump golang 1.13 (#449) Sep 13, 2019
CONTRIBUTING.md Replace AUTHORS.md by an updated MAINTAINERS.md (#125) Feb 16, 2017
Dockerfile Build ARM container images (#430) Jul 3, 2019
LICENSE Add in package infrastructure. Jul 30, 2015
MAINTAINERS.md Replace AUTHORS.md by an updated MAINTAINERS.md (#125) Feb 16, 2017
Makefile Add ppc64le arch to build process Mar 29, 2020
Makefile.common makefile: update Makefile.common with newer version (#445) Aug 31, 2019
NOTICE Initial Go work on parsing config and walking. Sep 10, 2016
README.md Fix codespell issues. (#360) Nov 27, 2018
VERSION Release 0.18.0 May 26, 2020
collector.go Reduce and fix timeout/docs for SNMP requests (#511) May 20, 2020
collector_test.go allow lookup chaining in a basic way (#405) (#489) Apr 29, 2020
config_test.go Fix codespell issues. (#360) Nov 27, 2018
go.mod Update vendoring (#483) Feb 14, 2020
go.sum Update vendoring (#483) Feb 14, 2020
main.go Use contexts with SNMP. (#481) Feb 14, 2020
snmp.yml Updating to APC powernet432.mib (#523) May 26, 2020

README.md

Prometheus SNMP Exporter

This is an exporter that exposes information gathered from SNMP for use by the Prometheus monitoring system.

There are two components. An exporter that does the actual scraping, and a generator (which depends on NetSNMP) that creates the configuration for use by the exporter.

Installation

Binaries can be downloaded from the Github releases page.

Usage

./snmp_exporter

Visit http://localhost:9116/snmp?target=1.2.3.4 where 1.2.3.4 is the IP of the SNMP device to get metrics from. You can also specify a module parameter, to choose which module to use from the config file.

Configuration

The snmp exporter reads from a snmp.yml config file by default. This file is not intended to be written by hand, rather use the generator to generate it for you.

The default snmp.yml covers a variety of common hardware for which MIBs are available to the public, walking them using SNMP v2 GETBULK.

You'll need to use the generator in all but the simplest of setups. It is needed to customize which objects are walked, use non-public MIBs or specify authentication parameters.

Prometheus Configuration

The snmp exporter needs to be passed the address as a parameter, this can be done with relabelling.

Example config:

scrape_configs:
  - job_name: 'snmp'
    static_configs:
      - targets:
        - 192.168.1.2  # SNMP device.
    metrics_path: /snmp
    params:
      module: [if_mib]
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: instance
      - target_label: __address__
        replacement: 127.0.0.1:9116  # The SNMP exporter's real hostname:port.

This setup allows Prometheus to provide scheduling and service discovery, as unlike all other exporters running an exporter on the machine from which we are getting the metrics from is not possible.

Large counter value handling

In order to provide accurate counters for large Counter64 values, the exporter will automatically wrap the value every 2^53 to avoid 64-bit float rounding.

To disable this feature, use the command line flag --no-snmp.wrap-large-counters.

You can’t perform that action at this time.