> Why is SNMP v3 so difficult to implement?

It's not. It's dead easy. Do you have a working snmpwalk command line which 
talks to your device? Then you just transfer the settings to your 
snmp_exporter configuration.

This has been made easier since snmp_exporter v0.23.0 
<https://github.com/prometheus/snmp_exporter/releases/tag/v0.23.0>, because 
the "modules" which define the OID walking and the "auths" which provide 
the credentials have been made orthogonal. You can add new auths, without 
touching modules. You can also put them in separate files.

So you end up with e.g.

auths:
  prod_v3:
    version: 3
    security_level: authPriv
    username: admin
    auth_protocol: SHA
    password: XXXXXXX
    priv_protocol: AES
    priv_password: YYYYYYY

then you call /snmp?target=x.x.x.x&module=if_mib&auth=prod_v3

The default is indeed still public_v2. The only other option would be to 
have no default, i.e. snmp_exporter would fail unless you provide an 
explicit set of credentials.

Hence I'd definitely recommend moving to snmp_exporter 0.25.0. If you can't 
do that, then there is a YAML trick you can do to make adding new auths 
easier:

modules:
  if_mib: *&if_mib*
  .... etc

# Append to end of file

*if_mib_prod_v3:  <<: *if_mib*
  version: 3
  timeout: 3s
  retries: 3
  auth:
    security_level: authPriv
    username: admin
    auth_protocol: SHA
    password: XXXXXXXX
    ... etc

This effectively "clones" the if_mib module under a new module 
"if_mib_prod_v3", and then overrides parts of it.

On Tuesday 9 January 2024 at 10:04:57 UTC Awemnhd wrote:

> see 
> https://github.com/prometheus/snmp_exporter/tree/main/generator#file-format
>
> Tried various ways to achieve some parameter passing
> username:
> security_level:
> password: SHA
> auth_protocol: AES
> priv_protocol:
> priv_password:
>
> As a result, when the service is started, the default access method is 
> community: public_v2!
>
> Why is SNMP v3 so difficult to implement? Why are they all in SNMP V2 
> mode? Why?
>

-- 
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 on the web visit 
https://groups.google.com/d/msgid/prometheus-users/6d79c3ac-98c3-448a-a123-07f46a5cbe7en%40googlegroups.com.

Reply via email to