GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - heijigaoke/snmp_exporter: SNMP Exporter for Prometheus

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

374 Commits
374 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
.github
.github
 
 
config
config
 
 
generator
generator
 
 
testdata
testdata
 
 
vendor
vendor
 
 
.dockerignore
.dockerignore
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
.promu.yml
.promu.yml
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
MAINTAINERS.md
MAINTAINERS.md
 
 
Makefile
Makefile
 
 
Makefile.common
Makefile.common
 
 
NOTICE
NOTICE
 
 
README.md
README.md
 
 
VERSION
VERSION
 
 
collector.go
collector.go
 
 
collector_test.go
collector_test.go
 
 
config_test.go
config_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
main.go
main.go
 
 
snmp.yml
snmp.yml
 
 

Repository files navigation

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.

About

SNMP Exporter for Prometheus

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.