ports/sysutils/snmp_exporter20/files/patch-generator_main.go
Lexi Winter acc7dc88f9 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)
2025-03-16 11:19:27 +01:00

20 lines
1 KiB
Go

--- generator/main.go.orig 2018-02-26 16:03:57 UTC
+++ generator/main.go
@@ -21,7 +21,7 @@ func generateConfig(nodes *Node, nameToN
log.Fatal("Unable to determine absolute path for output")
}
- content, err := ioutil.ReadFile("generator.yml")
+ content, err := ioutil.ReadFile("/usr/local/etc/snmp_exporter/generator.yml")
if err != nil {
log.Fatalf("Error reading yml config: %s", err)
}
@@ -65,7 +65,7 @@ func generateConfig(nodes *Node, nameToN
var (
generateCommand = kingpin.Command("generate", "Generate snmp.yml from generator.yml")
- outputPath = generateCommand.Flag("output-path", "Path to to write resulting config file").Default("snmp.yml").Short('o').String()
+ outputPath = generateCommand.Flag("output-path", "Path to to write resulting config file").Default("/usr/local/etc/snmp_exporter/snmp.yml").Short('o').String()
parseErrorsCommand = kingpin.Command("parse_errors", "Debug: Print the parse errors output by NetSNMP")
dumpCommand = kingpin.Command("dump", "Debug: Dump the parsed and prepared MIBs")
)