The snmp_exporter daemon reads its configuration from "snmp.yml". Because of the size and complexity of "snmp.yml", there is a generator called "snmp_exporter_generator" that takes "generator.yml" as its input. So, you always edit "generator.yml", call the generator and then (re)start the daemon. Unfortunately, the file "generator.yml" is unconditionally written by the port, so you loose your configuration on every port update.
Created attachment 233872 [details] Patch for sysutils/snmp_exporter Thanks for reporting this. Would you give this patch a try? It adds generator.yaml.sample and warns about manually removing generator.yaml on deinstall.
Committed, Thanks!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=1491693fd88faef9f95e9f20f80b4740e8365a57 commit 1491693fd88faef9f95e9f20f80b4740e8365a57 Author: Fernando Apesteguía <fernape@FreeBSD.org> AuthorDate: 2022-05-11 11:47:04 +0000 Commit: Fernando Apesteguía <fernape@FreeBSD.org> CommitDate: 2022-05-15 17:46:51 +0000 updatesysutils/snmp_exporter: do not overwrite generator.yml Mark it as sample file. generator.yml is used by snmp_exporter_generator to generate the final configuration (snmp.yml) which should not be edited by hand. PR: 263878 Reported by: topical@gmx.net Approved by: fabian.freyer@physik.tu-berlin.de (1 week) sysutils/snmp_exporter/Makefile | 2 +- sysutils/snmp_exporter/pkg-plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Thank you very much for the fix!