prometheus / snmp_exporter

SNMP Exporter for Prometheus
Apache License 2.0
1.73k stars 631 forks source link

Current sophos config makes snmp_exporter fail #1281

Open deajan opened 3 weeks ago

deajan commented 3 weeks ago

Using snmp_exporter v0.26, It seems that current make generate works, but I get the following when keeping the sophos part in generator.yml:

Nov 05 18:29:19 hyper01i.delonca.local snmp_exporter[27926]: ts=2024-11-05T17:29:19.694Z caller=main.go:220 level=error msg="Error parsing config file" err="yaml: unmarshal errors:\n  line 37403: field datetime_pattern not found in type config.Metric\n  line 37809: field datetime_pattern not found in type config.Metric\n  line 37825: field datetime_pattern not found in type config.Metric\n  line 37841: field datetime_pattern not found in type config.Metric\n  line 37857: field datetime_pattern not found in type config.Metric\n  line 37873: field datetime_pattern not found in type config.Metric\n  line 37889: field datetime_pattern not found in type config.Metric\n  line 37905: field datetime_pattern not found in type config.Metric\n  line 37921: field datetime_pattern not found in type config.Metric\n  line 37937: field datetime_pattern not found in type config.Metric"
Nov 05 18:29:19 hyper01i.delonca.local snmp_exporter[27926]: ts=2024-11-05T17:29:19.694Z caller=main.go:221 level=error msg="Possible old config file, see https://github.com/prometheus/snmp_exporter/blob/main/auth-split-migration.md"

Removing the sophos part from generator.yml makes it work again. Looks related to #1264

bastischubert commented 3 weeks ago

We have not yet released a new version with the fix. Have you tried building with the HEAD release of generator?

deajan commented 3 weeks ago

Built with yesterday's git master.

bastischubert commented 2 weeks ago

i tried the same -> git clone ...; cd snmp_exporter/generator; make generate; cp snmp.yml ..; cd ..; make; ./snmp_exporter

do you mind sharing your snmp.yml ?

deajan commented 2 weeks ago

snmp.zip

Here's the file that produces above error, generated from https://github.com/prometheus/snmp_exporter/commit/c2b6a571745da1ba0e6cd59ae96de7a7fa09ed65