+-------------------------------------------------------------------------------
| Running snmp_exporter 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 /etc/snmp_exporter/snmp.yml is intended
to be generated by a tool (name "snmp_generator" in this package) from
a higher-level configuration file /etc/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 /usr/local/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 /etc/snmp_exporter
# cp /usr/local/share/examples/snmp_exporter/generator-pf.yml generator.yml
# vi /etc/snmp_exporter/generator.yml
[...]
# export MIBDIRS=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs:/usr/local/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
/usr/local/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 /usr/local/share/doc/snmp_exporter/auth-split-migration.md for
upstream documentation about this.
