Go Makefile
Clone or download
brian-brazil Anchor display string TC regex so we only pick up pure strings (#312)
Signed-off-by: Brian Brazil <brian.brazil@robustperception.io>
Latest commit 38ed086 Jun 29, 2018
Permalink
Failed to load latest commit information.
.circleci Fixup CircleCI config. May 22, 2018
.github ISSUE_TEMPLATE.md: (Hopefully) improve issue information Jun 6, 2017
config Add missing license text. May 17, 2018
generator Anchor display string TC regex so we only pick up pure strings (#312) Jun 29, 2018
testdata Extract numeric time series from string values (#212) Aug 14, 2017
vendor Upate vendoring (#304) May 29, 2018
.dockerignore Add build files Sep 23, 2016
.gitignore Ignore the generator binary from the git repo. May 19, 2017
.promu.yml Exclude platforms we can't build on Aug 2, 2017
.travis.yml Update build Jun 5, 2017
CONTRIBUTING.md Replace AUTHORS.md by an updated MAINTAINERS.md (#125) Feb 16, 2017
Dockerfile Switch to kingpin for flags (#207) Aug 1, 2017
LICENSE Add in package infrastructure. Jul 30, 2015
MAINTAINERS.md Replace AUTHORS.md by an updated MAINTAINERS.md (#125) Feb 16, 2017
Makefile Use Prometheus Makefile.common. May 17, 2018
Makefile.common Use Prometheus Makefile.common. May 17, 2018
NOTICE Initial Go work on parsing config and walking. Sep 10, 2016
README.md README.md: Add tiny bit more syntax highlighting (#308) Jun 15, 2018
VERSION Release 0.11.0 May 30, 2018
collector.go Fix panic on invalid ascii/utf-8 data. (#303) May 28, 2018
collector_test.go Fix panic on invalid ascii/utf-8 data. (#303) May 28, 2018
config_test.go Add missing license text. May 17, 2018
main.go Add missing license text. May 17, 2018
snmp.yml Add support for igoring metrics in the generator (#297) May 17, 2018

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 customise 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.