git: acc7dc88f944 - main - sysutils/snmp_exporter: update to 0.28.0

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 16 Mar 2025 10:20:30 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=acc7dc88f94413568e8feba7e03db323a28b69dd

commit acc7dc88f94413568e8feba7e03db323a28b69dd
Author:     Lexi Winter <lexi@hemlock.eden.le-fay.org>
AuthorDate: 2024-11-14 14:15:44 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-03-16 10:19:27 +0000

    sysutils/snmp_exporter: update to 0.28.0
    
    Assign maintainership to submitter.
    
    changes since the previous port version (0.20.0) are too numerous to
    list here but can be found at the GitHub releases page:
    
      https://github.com/prometheus/snmp_exporter/releases
    
    this release introduces a breaking change in the configuration file
    format.  to address this:
    
    - add a new pkg-message that explains the situation on upgrade.
    
    - add an UPDATING entry to warn ports users about the change.
    
    - add a new port called 'sysutils/snmp_exporter20' containing the old
      0.20.0 version; users who don't want to immediately update their
      configuration can instead switch to this new port to continue using
      the old version.
    
    PR:             282759
    Approved by:    fabian.freyer@physik.tu-berlin.de (maintainer timeout)
---
 UPDATING                                           | 30 +++++++++++
 sysutils/snmp_exporter/Makefile                    | 37 ++------------
 sysutils/snmp_exporter/distinfo                    | 56 ++------------------
 sysutils/snmp_exporter/files/pkg-message.in        | 39 ++++++++++++++
 sysutils/snmp_exporter20/Makefile                  | 59 ++++++++++++++++++++++
 sysutils/snmp_exporter20/distinfo                  | 51 +++++++++++++++++++
 sysutils/snmp_exporter20/files/generator.yml       | 23 +++++++++
 .../files/patch-generator_main.go                  |  0
 sysutils/snmp_exporter20/files/pkg-message.in      | 13 +++++
 sysutils/snmp_exporter20/files/snmp_exporter.in    | 57 +++++++++++++++++++++
 sysutils/snmp_exporter20/pkg-descr                 |  3 ++
 sysutils/snmp_exporter20/pkg-plist                 |  3 ++
 12 files changed, 286 insertions(+), 85 deletions(-)

diff --git a/UPDATING b/UPDATING
index 5ff14f095c54..39c123fb5fcf 100644
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,36 @@ they are unavoidable.
 You should get into the habit of checking this file for changes each time
 you update your ports collection, before attempting any port upgrades.
 
+20250315:
+  AFFECTS: users of sysutils/snmp_exporter
+  AUTHOR: lexi@hemlock.eden.le-fay.org
+
+  BREAKING CHANGE: The new version of sysutils/snmp_exporter (0.28.0)
+  introduces several breaking changes.  If you don't want to migrate yet,
+  switch to the new port sysutils/snmp_exporter20 which contains the previous
+  version (0.20.0).
+
+  1. The exporter uses a new configuration file format for SNMP authentication,
+  and configurations from the previous version will no longer work.  This
+  applies regardless of whether you use the configuration generator or write
+  the configuration by hand.
+
+  For migration instructions, see:
+    https://github.com/prometheus/snmp_exporter/blob/main/auth-split-migration.md
+
+  2. Breaking changes were made affecting the 'synology', 'ddwrt' and
+  'kemp_loadmaster' modules.  For migration instructions, see:
+    https://github.com/prometheus/snmp_exporter/releases/tag/v0.27.0
+
+  3. The sysUpTime metric has been removed from the if_mib module.  For
+  migration instructions, see:
+    https://github.com/prometheus/snmp_exporter/releases/tag/v0.28.0
+
+  4. (FreeBSD-specific) The port no longer patches the generator to hardcode
+  ${PREFIX}/etc in the paths used by snmp_exporter_generator.  If you were
+  relying on this behaviour, you should update your scripts to specify the full
+  pathname.
+
 20250312:
   AFFECTS: users of net/samba4{19,20}
   AUTHOR: michaelo@FreeBSD.org
diff --git a/sysutils/snmp_exporter/Makefile b/sysutils/snmp_exporter/Makefile
index 2026bdcbc62f..f9a6cdfdc909 100644
--- a/sysutils/snmp_exporter/Makefile
+++ b/sysutils/snmp_exporter/Makefile
@@ -1,10 +1,9 @@
 PORTNAME=	snmp_exporter
-PORTVERSION=	0.20.0
 DISTVERSIONPREFIX=v
-PORTREVISION=	24
+DISTVERSION=	0.28.0
 CATEGORIES=	sysutils
 
-MAINTAINER=	fabian.freyer@physik.tu-berlin.de
+MAINTAINER=	lexi@hemlock.eden.le-fay.org
 COMMENT=	SNMP Exporter for Prometheus
 WWW=		https://github.com/prometheus/snmp_exporter
 
@@ -13,42 +12,12 @@ LICENSE=	APACHE20
 LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
 
 USES=		go:modules
-USE_GITHUB=	yes
 USE_RC_SUBR=	snmp_exporter
 
-GH_ACCOUNT=	prometheus
-GH_TUPLE=	\
-		alecthomas:kingpin:v2.2.6:alecthomas_kingpin/vendor/gopkg.in/alecthomas/kingpin.v2 \
-		alecthomas:template:fb15b899a751:alecthomas_template/vendor/github.com/alecthomas/template \
-		alecthomas:units:f65c72e2690d:alecthomas_units/vendor/github.com/alecthomas/units \
-		beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \
-		cespare:xxhash:v2.1.1:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \
-		go-kit:kit:v0.10.0:go_kit_kit/vendor/github.com/go-kit/kit \
-		go-logfmt:logfmt:v0.5.0:go_logfmt_logfmt/vendor/github.com/go-logfmt/logfmt \
-		go-yaml:yaml:v2.4.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
-		golang:crypto:5f87f3452ae9:golang_crypto/vendor/golang.org/x/crypto \
-		golang:net:4c5254603344:golang_net/vendor/golang.org/x/net \
-		golang:protobuf:v1.4.3:golang_protobuf/vendor/github.com/golang/protobuf \
-		golang:sys:v0.6.0:golang_sys/vendor/golang.org/x/sys \
-		golang:text:v0.3.2:golang_text/vendor/golang.org/x/text \
-		gosnmp:gosnmp:v1.29.0:gosnmp_gosnmp/vendor/github.com/gosnmp/gosnmp \
-		jpillora:backoff:v1.0.0:jpillora_backoff/vendor/github.com/jpillora/backoff \
-		matttproud:golang_protobuf_extensions:v1.0.1:matttproud_golang_protobuf_extensions/vendor/github.com/matttproud/golang_protobuf_extensions \
-		mwitkow:go-conntrack:2f068394615f:mwitkow_go_conntrack/vendor/github.com/mwitkow/go-conntrack \
-		pkg:errors:v0.9.1:pkg_errors/vendor/github.com/pkg/errors \
-		prometheus:client_golang:v1.9.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \
-		prometheus:client_model:v0.2.0:prometheus_client_model/vendor/github.com/prometheus/client_model \
-		prometheus:common:v0.15.0:prometheus_common/vendor/github.com/prometheus/common \
-		prometheus:exporter-toolkit:v0.5.1:prometheus_exporter_toolkit/vendor/github.com/prometheus/exporter-toolkit \
-		prometheus:procfs:v0.2.0:prometheus_procfs/vendor/github.com/prometheus/procfs \
-		protocolbuffers:protobuf-go:v1.23.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf
-
+GO_MODULE=	github.com/prometheus/snmp_exporter
 GO_TARGET=	. \
 		./generator:snmp_exporter_generator
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${GO_WRKSRC}/generator/main.go
-
 post-install:
 	${MKDIR} ${STAGEDIR}${PREFIX}/etc/snmp_exporter/
 	${INSTALL_DATA} ${FILESDIR}/generator.yml ${STAGEDIR}${PREFIX}/etc/snmp_exporter/generator.yml.sample
diff --git a/sysutils/snmp_exporter/distinfo b/sysutils/snmp_exporter/distinfo
index fb3791d791f2..d59cad8b7a78 100644
--- a/sysutils/snmp_exporter/distinfo
+++ b/sysutils/snmp_exporter/distinfo
@@ -1,51 +1,5 @@
-TIMESTAMP = 1678922304
-SHA256 (prometheus-snmp_exporter-v0.20.0_GH0.tar.gz) = 4326749fb36b829ca43e9d60fc09f43b62788f353c491aa3367705d52b96fae9
-SIZE (prometheus-snmp_exporter-v0.20.0_GH0.tar.gz) = 290899
-SHA256 (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 4624eae43489de8a71ea60efaf6744c581b6bd62909f7514c484c1ea0efaba5a
-SIZE (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 44383
-SHA256 (alecthomas-template-fb15b899a751_GH0.tar.gz) = 2e2a44375eca48ce941182504b5d13aa98182b9a3f64ace33bfda52208bd0f5e
-SIZE (alecthomas-template-fb15b899a751_GH0.tar.gz) = 55339
-SHA256 (alecthomas-units-f65c72e2690d_GH0.tar.gz) = ece06024b01821e013bd7158dfe8ec8cc697f586ce8d3cfaa22edde8c2f022c3
-SIZE (alecthomas-units-f65c72e2690d_GH0.tar.gz) = 4925
-SHA256 (beorn7-perks-v1.0.1_GH0.tar.gz) = 98db84bb0224a26094e6adba91b7ee7a1a7ace28cb648d818f8e779e6a19f825
-SIZE (beorn7-perks-v1.0.1_GH0.tar.gz) = 10867
-SHA256 (cespare-xxhash-v2.1.1_GH0.tar.gz) = 0ee31178d2c5a1249be4e26294a2f428008dc4e1ecbbfbe47f74e41026df1148
-SIZE (cespare-xxhash-v2.1.1_GH0.tar.gz) = 9292
-SHA256 (go-kit-kit-v0.10.0_GH0.tar.gz) = c0fac2e37b981e4c18e4f210b92e1393bd59dadd7c7fc043ec46d1c9834eba85
-SIZE (go-kit-kit-v0.10.0_GH0.tar.gz) = 274801
-SHA256 (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 76727000951c187d058289d8e83d3e2ad480a5d44c7c83b025b78b7eb6bf0258
-SIZE (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 11745
-SHA256 (go-yaml-yaml-v2.4.0_GH0.tar.gz) = d8e94679e5fff6bd1a35e10241543929a5f3da44f701755babf99b3daf0faac0
-SIZE (go-yaml-yaml-v2.4.0_GH0.tar.gz) = 73209
-SHA256 (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 8e905a4ce396416a8c8afd8075b93da404f77a9ec1475ad2814d289a1e21a0ee
-SIZE (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 1721681
-SHA256 (golang-net-4c5254603344_GH0.tar.gz) = 5957e628f2676d9e6c9517890bdcec334e8cac53d0f000b42ed6364a0550e152
-SIZE (golang-net-4c5254603344_GH0.tar.gz) = 1177478
-SHA256 (golang-protobuf-v1.4.3_GH0.tar.gz) = 5736f943f8647362f5559689df6154f3c85d261fb088867c8a68494e2a767610
-SIZE (golang-protobuf-v1.4.3_GH0.tar.gz) = 171969
-SHA256 (golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
-SIZE (golang-sys-v0.6.0_GH0.tar.gz) = 1434234
-SHA256 (golang-text-v0.3.2_GH0.tar.gz) = 0b9309698f5708531c5377ab1e29b423a6d9e20c55a8d386c3b8283428212f22
-SIZE (golang-text-v0.3.2_GH0.tar.gz) = 7168069
-SHA256 (gosnmp-gosnmp-v1.29.0_GH0.tar.gz) = 72cce697871395c3ba14775c13f30a58862fab102234a82274079f29ef7f7671
-SIZE (gosnmp-gosnmp-v1.29.0_GH0.tar.gz) = 76271
-SHA256 (jpillora-backoff-v1.0.0_GH0.tar.gz) = 611b29ce95acfa2997e3449762a3df68fcaa773db045535f26eb5c686106351f
-SIZE (jpillora-backoff-v1.0.0_GH0.tar.gz) = 3507
-SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b
-SIZE (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184
-SHA256 (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 5bb72eaf9a4ffd7d0353fa6944951d244df89d879ac36d4b9860fd159162dd81
-SIZE (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 17140
-SHA256 (pkg-errors-v0.9.1_GH0.tar.gz) = 56bfd893023daa498508bfe161de1be83299fcf15376035e7df79cbd7d6fa608
-SIZE (pkg-errors-v0.9.1_GH0.tar.gz) = 13415
-SHA256 (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 92ccfb35268ce2de6beeb45d4b5639e4bce78111b8629bcde5727165f7e1afb1
-SIZE (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 177330
-SHA256 (prometheus-client_model-v0.2.0_GH0.tar.gz) = 4ab1be9cdfa702d7f49beeb09a256bcc6a2aad55e8a0a37e7732a46934264e12
-SIZE (prometheus-client_model-v0.2.0_GH0.tar.gz) = 10986
-SHA256 (prometheus-common-v0.15.0_GH0.tar.gz) = f0957de56c09431076239d27bb85e07841bb832d0c99210087bc6da63a0b2cb6
-SIZE (prometheus-common-v0.15.0_GH0.tar.gz) = 124369
-SHA256 (prometheus-exporter-toolkit-v0.5.1_GH0.tar.gz) = 721740ad90ac0d32e51c94d05b67a276cbed2c138e9af16587f98e8664750220
-SIZE (prometheus-exporter-toolkit-v0.5.1_GH0.tar.gz) = 50475
-SHA256 (prometheus-procfs-v0.2.0_GH0.tar.gz) = b6c013031ac8b9f8f9e1595103c48feb80dfe59c37aac73efe724fddbc0b3f50
-SIZE (prometheus-procfs-v0.2.0_GH0.tar.gz) = 157368
-SHA256 (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = e7266bedaa4f110216fce52ae533dc5eba475d3829bb0592e8876684e202ae1f
-SIZE (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = 1214648
+TIMESTAMP = 1740730343
+SHA256 (go/sysutils_snmp_exporter/snmp_exporter-v0.28.0/v0.28.0.mod) = 88725de1e4de046efc5bb502de4ed456c8549f721b48789ad8825e8a08f5ca22
+SIZE (go/sysutils_snmp_exporter/snmp_exporter-v0.28.0/v0.28.0.mod) = 1371
+SHA256 (go/sysutils_snmp_exporter/snmp_exporter-v0.28.0/v0.28.0.zip) = 8824f38bfea50975ac30602d3c00ceb547c64515905fddddddace1c2c4bedc91
+SIZE (go/sysutils_snmp_exporter/snmp_exporter-v0.28.0/v0.28.0.zip) = 266644
diff --git a/sysutils/snmp_exporter/files/pkg-message.in b/sysutils/snmp_exporter/files/pkg-message.in
index 8ad5d858310c..d03707eb6b6e 100644
--- a/sysutils/snmp_exporter/files/pkg-message.in
+++ b/sysutils/snmp_exporter/files/pkg-message.in
@@ -8,6 +8,45 @@ edit %%ETCDIR%%/generator.yml and add relevant MIBs, then run
 
 To run snmp_exporter, set the snmp_exporter_enable="YES" rcvar
 and point your prometheus instance at port 9116.
+EOM
+}
+{ type: upgrade
+  maximum_version: "0.28.0"
+  message: <<EOM
+BREAKING CHANGES:
+
+In snmp_exporter 0.28.0 (actually, since 0.23.0 upstream), the configuration
+format for authentication has changed.  The previous configuration will not
+work and must be updated.  Please refer to the upstream documentation on how to
+migrate:
+
+    https://github.com/prometheus/snmp_exporter/blob/main/auth-split-migration.md
+
+Alternatively, if you want to continue using your existing configuration,
+install the 'sysutils/snmp_exporter20' port instead, which contains the older
+0.20.0 version.
+
+---
+
+In snmp_exporter 0.27.0, breaking changes were made affecting the 'synology',
+'ddwrt' and 'kemp_loadmaster' modules.  For migration instructions, see:
+
+    https://github.com/prometheus/snmp_exporter/releases/tag/v0.27.0
+
+---
+
+In snmp_exporter 0.28.0, the sysUpTime metric has been removed from the if_mib
+module.  For migration instructions, see:
+
+    https://github.com/prometheus/snmp_exporter/releases/tag/v0.28.0
+
+---
+
+(FreeBSD-specific) Since 0.28.0, the port no longer patches the generator to
+hardcode ${PREFIX}/etc in the paths used by snmp_exporter_generator.  If you
+were relying on this behaviour, you should update your scripts to specify the
+full pathname.
+
 EOM
 }
 ]
diff --git a/sysutils/snmp_exporter20/Makefile b/sysutils/snmp_exporter20/Makefile
new file mode 100644
index 000000000000..982b47c1ea66
--- /dev/null
+++ b/sysutils/snmp_exporter20/Makefile
@@ -0,0 +1,59 @@
+PORTNAME=	snmp_exporter
+PORTVERSION=	0.20.0
+DISTVERSIONPREFIX=v
+CATEGORIES=	sysutils
+PKGNAMESUFFIX=	20
+
+MAINTAINER=	fabian.freyer@physik.tu-berlin.de
+COMMENT=	SNMP Exporter for Prometheus (version 0.20.0)
+WWW=		https://github.com/prometheus/snmp_exporter
+
+LICENSE=	APACHE20
+
+LIB_DEPENDS=	libnetsnmp.so:net-mgmt/net-snmp
+
+USES=		go:modules
+USE_GITHUB=	yes
+
+GH_ACCOUNT=	prometheus
+GH_TUPLE=	\
+		alecthomas:kingpin:v2.2.6:alecthomas_kingpin/vendor/gopkg.in/alecthomas/kingpin.v2 \
+		alecthomas:template:fb15b899a751:alecthomas_template/vendor/github.com/alecthomas/template \
+		alecthomas:units:f65c72e2690d:alecthomas_units/vendor/github.com/alecthomas/units \
+		beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \
+		cespare:xxhash:v2.1.1:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \
+		go-kit:kit:v0.10.0:go_kit_kit/vendor/github.com/go-kit/kit \
+		go-logfmt:logfmt:v0.5.0:go_logfmt_logfmt/vendor/github.com/go-logfmt/logfmt \
+		go-yaml:yaml:v2.4.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
+		golang:crypto:5f87f3452ae9:golang_crypto/vendor/golang.org/x/crypto \
+		golang:net:4c5254603344:golang_net/vendor/golang.org/x/net \
+		golang:protobuf:v1.4.3:golang_protobuf/vendor/github.com/golang/protobuf \
+		golang:sys:v0.6.0:golang_sys/vendor/golang.org/x/sys \
+		golang:text:v0.3.2:golang_text/vendor/golang.org/x/text \
+		gosnmp:gosnmp:v1.29.0:gosnmp_gosnmp/vendor/github.com/gosnmp/gosnmp \
+		jpillora:backoff:v1.0.0:jpillora_backoff/vendor/github.com/jpillora/backoff \
+		matttproud:golang_protobuf_extensions:v1.0.1:matttproud_golang_protobuf_extensions/vendor/github.com/matttproud/golang_protobuf_extensions \
+		mwitkow:go-conntrack:2f068394615f:mwitkow_go_conntrack/vendor/github.com/mwitkow/go-conntrack \
+		pkg:errors:v0.9.1:pkg_errors/vendor/github.com/pkg/errors \
+		prometheus:client_golang:v1.9.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \
+		prometheus:client_model:v0.2.0:prometheus_client_model/vendor/github.com/prometheus/client_model \
+		prometheus:common:v0.15.0:prometheus_common/vendor/github.com/prometheus/common \
+		prometheus:exporter-toolkit:v0.5.1:prometheus_exporter_toolkit/vendor/github.com/prometheus/exporter-toolkit \
+		prometheus:procfs:v0.2.0:prometheus_procfs/vendor/github.com/prometheus/procfs \
+		protocolbuffers:protobuf-go:v1.23.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf
+
+USE_RC_SUBR=	snmp_exporter
+
+GO_TARGET=	. \
+		./generator:snmp_exporter_generator
+
+CONFLICTS_INSTALL=	snmp_exporter
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' ${GO_WRKSRC}/generator/main.go
+
+post-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/snmp_exporter/
+	${INSTALL_DATA} ${FILESDIR}/generator.yml ${STAGEDIR}${PREFIX}/etc/snmp_exporter/generator.yml.sample
+
+.include <bsd.port.mk>
diff --git a/sysutils/snmp_exporter20/distinfo b/sysutils/snmp_exporter20/distinfo
new file mode 100644
index 000000000000..fb3791d791f2
--- /dev/null
+++ b/sysutils/snmp_exporter20/distinfo
@@ -0,0 +1,51 @@
+TIMESTAMP = 1678922304
+SHA256 (prometheus-snmp_exporter-v0.20.0_GH0.tar.gz) = 4326749fb36b829ca43e9d60fc09f43b62788f353c491aa3367705d52b96fae9
+SIZE (prometheus-snmp_exporter-v0.20.0_GH0.tar.gz) = 290899
+SHA256 (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 4624eae43489de8a71ea60efaf6744c581b6bd62909f7514c484c1ea0efaba5a
+SIZE (alecthomas-kingpin-v2.2.6_GH0.tar.gz) = 44383
+SHA256 (alecthomas-template-fb15b899a751_GH0.tar.gz) = 2e2a44375eca48ce941182504b5d13aa98182b9a3f64ace33bfda52208bd0f5e
+SIZE (alecthomas-template-fb15b899a751_GH0.tar.gz) = 55339
+SHA256 (alecthomas-units-f65c72e2690d_GH0.tar.gz) = ece06024b01821e013bd7158dfe8ec8cc697f586ce8d3cfaa22edde8c2f022c3
+SIZE (alecthomas-units-f65c72e2690d_GH0.tar.gz) = 4925
+SHA256 (beorn7-perks-v1.0.1_GH0.tar.gz) = 98db84bb0224a26094e6adba91b7ee7a1a7ace28cb648d818f8e779e6a19f825
+SIZE (beorn7-perks-v1.0.1_GH0.tar.gz) = 10867
+SHA256 (cespare-xxhash-v2.1.1_GH0.tar.gz) = 0ee31178d2c5a1249be4e26294a2f428008dc4e1ecbbfbe47f74e41026df1148
+SIZE (cespare-xxhash-v2.1.1_GH0.tar.gz) = 9292
+SHA256 (go-kit-kit-v0.10.0_GH0.tar.gz) = c0fac2e37b981e4c18e4f210b92e1393bd59dadd7c7fc043ec46d1c9834eba85
+SIZE (go-kit-kit-v0.10.0_GH0.tar.gz) = 274801
+SHA256 (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 76727000951c187d058289d8e83d3e2ad480a5d44c7c83b025b78b7eb6bf0258
+SIZE (go-logfmt-logfmt-v0.5.0_GH0.tar.gz) = 11745
+SHA256 (go-yaml-yaml-v2.4.0_GH0.tar.gz) = d8e94679e5fff6bd1a35e10241543929a5f3da44f701755babf99b3daf0faac0
+SIZE (go-yaml-yaml-v2.4.0_GH0.tar.gz) = 73209
+SHA256 (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 8e905a4ce396416a8c8afd8075b93da404f77a9ec1475ad2814d289a1e21a0ee
+SIZE (golang-crypto-5f87f3452ae9_GH0.tar.gz) = 1721681
+SHA256 (golang-net-4c5254603344_GH0.tar.gz) = 5957e628f2676d9e6c9517890bdcec334e8cac53d0f000b42ed6364a0550e152
+SIZE (golang-net-4c5254603344_GH0.tar.gz) = 1177478
+SHA256 (golang-protobuf-v1.4.3_GH0.tar.gz) = 5736f943f8647362f5559689df6154f3c85d261fb088867c8a68494e2a767610
+SIZE (golang-protobuf-v1.4.3_GH0.tar.gz) = 171969
+SHA256 (golang-sys-v0.6.0_GH0.tar.gz) = b4f6d17c7a128f76169964b437cb66b3f2dbf9a33361928ec19dfecf7b03fc54
+SIZE (golang-sys-v0.6.0_GH0.tar.gz) = 1434234
+SHA256 (golang-text-v0.3.2_GH0.tar.gz) = 0b9309698f5708531c5377ab1e29b423a6d9e20c55a8d386c3b8283428212f22
+SIZE (golang-text-v0.3.2_GH0.tar.gz) = 7168069
+SHA256 (gosnmp-gosnmp-v1.29.0_GH0.tar.gz) = 72cce697871395c3ba14775c13f30a58862fab102234a82274079f29ef7f7671
+SIZE (gosnmp-gosnmp-v1.29.0_GH0.tar.gz) = 76271
+SHA256 (jpillora-backoff-v1.0.0_GH0.tar.gz) = 611b29ce95acfa2997e3449762a3df68fcaa773db045535f26eb5c686106351f
+SIZE (jpillora-backoff-v1.0.0_GH0.tar.gz) = 3507
+SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b
+SIZE (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184
+SHA256 (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 5bb72eaf9a4ffd7d0353fa6944951d244df89d879ac36d4b9860fd159162dd81
+SIZE (mwitkow-go-conntrack-2f068394615f_GH0.tar.gz) = 17140
+SHA256 (pkg-errors-v0.9.1_GH0.tar.gz) = 56bfd893023daa498508bfe161de1be83299fcf15376035e7df79cbd7d6fa608
+SIZE (pkg-errors-v0.9.1_GH0.tar.gz) = 13415
+SHA256 (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 92ccfb35268ce2de6beeb45d4b5639e4bce78111b8629bcde5727165f7e1afb1
+SIZE (prometheus-client_golang-v1.9.0_GH0.tar.gz) = 177330
+SHA256 (prometheus-client_model-v0.2.0_GH0.tar.gz) = 4ab1be9cdfa702d7f49beeb09a256bcc6a2aad55e8a0a37e7732a46934264e12
+SIZE (prometheus-client_model-v0.2.0_GH0.tar.gz) = 10986
+SHA256 (prometheus-common-v0.15.0_GH0.tar.gz) = f0957de56c09431076239d27bb85e07841bb832d0c99210087bc6da63a0b2cb6
+SIZE (prometheus-common-v0.15.0_GH0.tar.gz) = 124369
+SHA256 (prometheus-exporter-toolkit-v0.5.1_GH0.tar.gz) = 721740ad90ac0d32e51c94d05b67a276cbed2c138e9af16587f98e8664750220
+SIZE (prometheus-exporter-toolkit-v0.5.1_GH0.tar.gz) = 50475
+SHA256 (prometheus-procfs-v0.2.0_GH0.tar.gz) = b6c013031ac8b9f8f9e1595103c48feb80dfe59c37aac73efe724fddbc0b3f50
+SIZE (prometheus-procfs-v0.2.0_GH0.tar.gz) = 157368
+SHA256 (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = e7266bedaa4f110216fce52ae533dc5eba475d3829bb0592e8876684e202ae1f
+SIZE (protocolbuffers-protobuf-go-v1.23.0_GH0.tar.gz) = 1214648
diff --git a/sysutils/snmp_exporter20/files/generator.yml b/sysutils/snmp_exporter20/files/generator.yml
new file mode 100644
index 000000000000..16c1d71b020a
--- /dev/null
+++ b/sysutils/snmp_exporter20/files/generator.yml
@@ -0,0 +1,23 @@
+modules:
+  # Default IF-MIB interfaces table with ifIndex.
+  if_mib:
+    walk: [sysUpTime, interfaces, ifXTable]
+  # Interfaces if ifAlias is unique.
+  if_mib_ifalias:
+    walk: [sysUpTime, interfaces, ifXTable]
+    lookups:
+      - old_index: ifIndex
+        new_index: ifAlias
+  # Interfaces if ifDescr is unique.
+  if_mib_ifdescr:
+    walk: [sysUpTime, interfaces, ifXTable]
+    lookups:
+      - old_index: ifIndex
+        new_index: ifDescr
+  # Interfaces if ifName is unique.
+  if_mib_ifname:
+    walk: [sysUpTime, interfaces, ifXTable]
+    lookups:
+      - old_index: ifIndex
+        # Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
+        new_index: 1.3.6.1.2.1.31.1.1.1.1 # ifName
diff --git a/sysutils/snmp_exporter/files/patch-generator_main.go b/sysutils/snmp_exporter20/files/patch-generator_main.go
similarity index 100%
rename from sysutils/snmp_exporter/files/patch-generator_main.go
rename to sysutils/snmp_exporter20/files/patch-generator_main.go
diff --git a/sysutils/snmp_exporter20/files/pkg-message.in b/sysutils/snmp_exporter20/files/pkg-message.in
new file mode 100644
index 000000000000..8ad5d858310c
--- /dev/null
+++ b/sysutils/snmp_exporter20/files/pkg-message.in
@@ -0,0 +1,13 @@
+[
+{ type: install
+  message: <<EOM
+To generate the snmp.yml configuration file for snmp_exporter,
+edit %%ETCDIR%%/generator.yml and add relevant MIBs, then run
+
+    snmp_exporter_generator generate
+
+To run snmp_exporter, set the snmp_exporter_enable="YES" rcvar
+and point your prometheus instance at port 9116.
+EOM
+}
+]
diff --git a/sysutils/snmp_exporter20/files/snmp_exporter.in b/sysutils/snmp_exporter20/files/snmp_exporter.in
new file mode 100644
index 000000000000..9afd88d6e3d5
--- /dev/null
+++ b/sysutils/snmp_exporter20/files/snmp_exporter.in
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# PROVIDE: snmp_exporter
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# snmp_exporter_enable (bool):          Set to NO by default.
+#               Set it to YES to enable snmp_exporter.
+# snmp_exporter_user (string):          Set user that snmp_exporter will run under
+#               Default is "nobody".
+# snmp_exporter_group (string):         Set group that snmp_exporter will run under
+#               Default is "nobody".
+# snmp_exporter_args (string):          Set extra arguments to pass to snmp_exporter
+#               Default is "".
+# snmp_exporter_listen_address (string):Set ip:port that snmp_exporter will listen on
+#               Default is ":9116".
+# snmp_exporter_config_file (string)    Set the location of the snmp_exporter config
+#                                       configuration file.
+#               Default is "%%PREFIX%%/etc/snmp_exporter/snmp.yml"
+
+. /etc/rc.subr
+
+name=snmp_exporter
+rcvar=snmp_exporter_enable
+
+load_rc_config $name
+
+: ${snmp_exporter_enable:="NO"}
+: ${snmp_exporter_user:="nobody"}
+: ${snmp_exporter_group:="nobody"}
+: ${snmp_exporter_args:=""}
+: ${snmp_exporter_listen_address:=":9116"}
+: ${snmp_exporter_config_file:="%%PREFIX%%/etc/snmp_exporter/snmp.yml"}
+
+pidfile=/var/run/snmp_exporter.pid
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/bin/snmp_exporter"
+command_args="-p ${pidfile} -T ${name} \
+    /usr/bin/env ${procname} \
+    --web.listen-address=${snmp_exporter_listen_address} \
+    --config.file=${snmp_exporter_config_file} \
+    ${snmp_exporter_args}"
+
+start_precmd=snmp_exporter_startprecmd
+
+snmp_exporter_startprecmd()
+{
+    if [ ! -e ${pidfile} ]; then
+        install -o ${snmp_exporter_user} -g ${snmp_exporter_group} /dev/null ${pidfile};
+    fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/sysutils/snmp_exporter20/pkg-descr b/sysutils/snmp_exporter20/pkg-descr
new file mode 100644
index 000000000000..f84661ff64f7
--- /dev/null
+++ b/sysutils/snmp_exporter20/pkg-descr
@@ -0,0 +1,3 @@
+snmp_exporter is a prometheus exporter for information
+gathered from SNMP for use by the Prometheus monitoring
+system.
diff --git a/sysutils/snmp_exporter20/pkg-plist b/sysutils/snmp_exporter20/pkg-plist
new file mode 100644
index 000000000000..d2d24fcfb01e
--- /dev/null
+++ b/sysutils/snmp_exporter20/pkg-plist
@@ -0,0 +1,3 @@
+bin/snmp_exporter
+bin/snmp_exporter_generator
+@sample %%ETCDIR%%/generator.yml.sample