On Thursday, 26 June 2025 at 15:42:36 UTC+1 Joel Djojotaroeno wrote:

I have two prometheus.yml files:
/home/rpbgintern2/prometheus.yml
/etc/prometheus/prometheus.yml

And two snmp.yml files:
/home/rpbgintern2/snmp_exporter-0.26.0.linux-amd64/snmp.yml
/home/rpbgintern2/snmp/snmp.yml

I don't know if multiple yml files are causing this error. 


No. But you do need to work out which is being used.

This depends on how you are starting the services. Are you using systemd 
services perhaps?

If you're not sure, then use
ps auxwww | grep prometheus
ps auxwww | grep snmp_exporter
to see what flags you're running them with.

For prometheus, the config file is specified by the --config.file argument. 
If you don't specify it, it will read "prometheus.yml" in whatever the 
current working directory is when prometheus is started.

snmp_exporter also has a --config.file argument; I believe it defaults to 
"snmp.yml" in the current working directory.  It can be used with a 
wildcard, e.g. '--config.file=/etc/prometheus/snmp.d/*.yml'.  
This is very useful because you can provide multiple files: the supplied 
snmp.yml, and then a separate file (say "auth.yml") with just your 
site-specific authentication parameters. For example:

auths:
  test_v2:
    version: 2
    community: Testing123

  test_v3:
    version: 3
    security_level: authNoPriv
    username: admin
    auth_protocol: SHA
    password: Testing123

  test_v3_priv:
    version: 3
    security_level: authPriv
    username: admin
    auth_protocol: SHA
    password: Testing123
    priv_protocol: AES
    priv_password: VerySecret

If you're polling snmp_exporter with parameter public_v1, then this auth 
needs to be defined. The supplied snmp.yml does define this, so perhaps 
your snmp_exporter is not picking up *any* configuration files? That will 
be down to the --config.file parameter you may or may not be passing.
 
Either that, or there's a typo somewhere. I note that your error message 
complains about "public_v1_'' with a trailing underscore.

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/prometheus-users/17ce6f2d-99ff-4eaf-9470-00628766fc09n%40googlegroups.com.

Reply via email to