Home

The sysutils/snmp_exporter port

snmp_exporter-0.25.0 – Prometheus exporter for SNMP metrics (cvsweb github mirror)

Description

Prometheus exporter for metrics gathered from SNMP.

This package contains both the exporter that does the actual scraping,
and a generator (which depends on Net-SNMP) that creates the
configuration for use by the exporter.
WWW: https://prometheus.io/

Readme

+-------------------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-------------------------------------------------------------------------------

snmp_exporter runs as a daemon and performs SNMP queries in response to
incoming requests on its HTTP port. It would normally be queried by Prometheus
which passes parameters specifying which host it should poll and which mib to
use.

snmp_exporter's own configuration provides definitions for mibs with
OID-to-name mappings, and can include SNMP authentication information.
The "runtime" configuration in ${SYSCONFDIR}/snmp_exporter/snmp.yml is intended
to be generated by a tool (name "snmp_generator" in this package) from
a higher-level configuration file ${SYSCONFDIR}/snmp_exporter/generator.yml.
The generator uses this in conjunction with MIB files (read in via Net-SNMP) 
to produce snmp.yml.

The default configuration can be used directly for some simple uses (for
example, polling interface stats with default authentication values).
For more complex cases and less-common MIBs you will need to adapt or
write your own generator.yml and generate a new snmp.yml from it.

The MIB files required for snmp_exporter's sample configuration are included
in this package (in ${TRUEPREFIX}/share/examples/snmp_exporter/mibs).

Additional MIBs may be needed if you're adding less common devices;
the LibreNMS package provides a collection of thousands of these covering
many network devices in /var/www/librenms/mibs.

Some OpenBSD-specific MIBs for use with snmpd(8) are provided in
/usr/share/snmp/mibs.

You will need to provide a suitable MIB search path allowing the generator
to find any MIB files referenced in your configuration; this can be set
in the environment variable MIBDIRS.

An example of adapting and building config:

# cd ${SYSCONFDIR}/snmp_exporter
# cp ${TRUEPREFIX}/share/examples/snmp_exporter/generator-pf.yml generator.yml
# vi ${SYSCONFDIR}/snmp_exporter/generator.yml
[...]
# export MIBDIRS=/usr/share/snmp/mibs:${LOCALBASE}/share/snmp/mibs:${TRUEPREFIX}/share/examples/snmp_exporter/mibs
# snmp_generator generate

Upgrading from before v0.23.0
-----------------------------

You will need to update configuration. New versions will not run with
old configuration.

In older versions, configuration used a single list of modules, which
incorporated authorisation settings (SNMP version, community/username,
SNMPv3 auth options) alongside the metric walking/mapping settings.

These have now been split. Authorisation settings ("version" and any
"auth" sections) should be removed from the various module sections in
generator.yml and added to a new "auths" section (see the example in
${LOCALBASE}/share/examples/snmp_exporter/generator.yml).

You will then need to regenerate snmp.yml with "snmp_generator" as
shown above.

Rather than referencing authorisation settings in module config,
you now specify the auth section name as a URL query parameter
when fetching results,, alongside the module and target, e.g.:

http://localhost:9116/snmp?auth=public_v2&module=if_mib&target=192.0.2.8

See ${TRUEPREFIX}/share/doc/snmp_exporter/auth-split-migration.md for
upstream documentation about this.

Maintainer

Stuart Henderson

Only for arches

aarch64 amd64 arm armv7 i386 mips64 riscv64

Categories

lang/go sysutils

Library dependencies

Build dependencies

Test dependencies

Reverse dependencies

Files

Search