prometheus/snmp_exporter
DevOps & Self-hostingExpose SNMP device metrics to Prometheus with configurable auth modules and multi-device scraping.
What it does
Prometheus SNMP Exporter is the recommended way to turn SNMP data from switches, routers, access points, and other network devices into metrics Prometheus can ingest. It runs as a central exporter and maps SNMP OID trees into Prometheus labels, so an interface walk becomes a metric such as ifHCOutOctets{ifAlias="",ifDescr="eth0",ifIndex="2",ifName="eth0"} 1000 rather than a manual hand-translation of OIDs mapping example.
The exporter reads module and auth definitions from snmp.yml, fetches data from the target device over SNMP, and returns Prometheus-format metrics. A single instance can serve thousands of devices, much like a Prometheus proxy for SNMP scaling, run model. It is aimed at operators who already run Prometheus and need to monitor network equipment.
Quick start
- Download the appropriate binary from the GitHub releases; no special installation is required. A sample systemd unit file and practical config samples are available.
- Start the exporter from the CLI:
./snmp_exporter
- Query a device using the default auth module
public_v2and default moduleif_mib:
http://localhost:9116/snmp?target=192.0.0.8
Use auth and module URL parameters to choose other definitions from snmp.yml. For example:
http://localhost:9116/snmp?auth=my_secure_v3&module=ddwrt&target=192.0.0.8
A non-default transport and port use the form [transport://]host[:port]; the URL-encoded equivalent for TCP port 1161 is target=tcp%3A%2F%2F192.0.0.8%3A1161 running and target format.
- Point Prometheus at the exporter with
/snmpasmetrics_path, passingtarget,auth, andmodulethrough relabeling. The README includes a complete scrape configuration example Prometheus configuration.
Exporter-level metrics are exposed at http://localhost:9116/metrics exporter metrics.
Configuration and custom MIBs
snmp.yml is generated configuration and should not be edited by hand. The default file covers common hardware with SNMP v2 GETBULK. If you need to walk other objects or use non-public MIBs, use the generator; community MIBs and generator configs live in prometheus-community/snmp. Multiple modules can be requested in one scrape, separated by commas or repeated module parameters; the exporter does not de-duplicate walks between modules multi-module handling.
Constraints
- SNMP v1/v2c community strings are sent unencrypted and are not considered secrets; use SNMP v3 for secure access SNMP security note.
username,password, andpriv_passwordcan be pulled from environment variables only when--config.expand-environment-variablesis enabled; missing variables cause a config load error environment variables.- TLS and HTTP basic authentication for all endpoints require
--web.config.file; the format is defined in exporter-toolkit. - By default, large Counter64 values are wrapped every 2^53 to avoid 64-bit float rounding; use
--no-snmp.wrap-large-countersto disable this for non-Prometheus consumers large counters. - A central exporter can scrape many devices, but it still needs network reachability to each target and valid
snmp.ymlauth and module entries.
HotRepo's take
There are no HotRepo ranking or discussion records for this repository, so the useful observation is technical: this is a long-running Prometheus ecosystem exporter with an Apache-2.0 license and 2,194 stars, and its interface is deliberately query-driven rather than a static target list. The strongest operational detail is the scaling model: one exporter process is intended to serve thousands of devices, with auth and module selection passed per scrape through Prometheus relabeling. The README also warns that snmp.yml is generated, so teams expecting to hand-edit device mappings should plan around the generator and MIB workflow instead.
Written by AI from the project's README, updated . The project's own docs are the source of truth.