How to specify v3 credentials in generator? #976
-
Could someone please provide an example of generator.yml for v3 with authentication? I'm trying to follow the readme but I get this error.
This is the section I added to generator.yml auths:
adder:
version: 3
username: aim
security_level: authPriv
password: password
auth_protocol: SHA
priv_protocol: AES
priv_password: password
modules:
adder:
walk:
- 1.3.6.1.4.1.25119
- sysUpTime And this is what the generated snmp.yml looks like: auths:
adder:
community: public
security_level: authPriv
username: aim
password: password
auth_protocol: SHA
priv_protocol: AES
priv_password: password
version: 3
modules:
adder:
walk:
- 1.3.6.1.4.1.25119
get:
- 1.3.6.1.2.1.1.3.0
metrics:
- name: sysUpTime
oid: 1.3.6.1.2.1.1.3
type: gauge
help: The time (in hundredths of a second) since the network management portion
of the system was last re-initialized. - 1.3.6.1.2.1.1.3
- name: deviceIndex
oid: 1.3.6.1.4.1.25119.1.1.1.1
type: gauge
help: d_id from the 'device' tuple - 1.3.6.1.4.1.25119.1.1.1.1
indexes:
- labelname: deviceIndex
type: gauge
...<truncated>... Host operating system: output of
|
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 10 replies
-
You are trying to use the new (breaking change) config syntax for v0.23.0+ (currently unreleased), whilst running snmp_exporter v0.22.0. Either upgrade to v0.23.0-rc.1, or use the config syntax as described in https://github.com/prometheus/snmp_exporter/blob/v0.22.0/generator/README.md. |
Beta Was this translation helpful? Give feedback.
-
Thank you, that's very helpful. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, the generator depends on linking C libraries. Specifically libsnmp. This means we would have to target various distribution versions. I've played around with trying to statically compile these in, but haven't had much success. |
Beta Was this translation helpful? Give feedback.
-
@llamafilm The Ubuntu (and Debian) package prometheus-snmp-exporter includes a prometheus-snmp-generator binary. Even if you opt to use a newer snmp_exporter (up to and including v0.22.0), the config generated by a recent-ish prometheus-snmp-generator should be compatible. |
Beta Was this translation helpful? Give feedback.
-
Thanks @dswarbrick. I tried installing from the Ubuntu repo, but it fails to generate. Perhaps because it needs to run
I have copied the MIB file into /usr/share/snmp/mibs/ but the
|
Beta Was this translation helpful? Give feedback.
-
@llamafilm Follow the instructions in
I highly recommend stripping back the You may also need to adjust your |
Beta Was this translation helpful? Give feedback.
-
Thank you, that explains it! I tried |
Beta Was this translation helpful? Give feedback.
-
I'm facing same problem, I need snmp v3 for proper snmp_exporter walk through some network devices. So only way is to wait till 0.23 snmp_exporter will be released. Is there any schedule plan of this? |
Beta Was this translation helpful? Give feedback.
-
v0.23.0 has a release candidate available on the releases page. |
Beta Was this translation helpful? Give feedback.
-
How should I specify more auths in one
When I generate |
Beta Was this translation helpful? Give feedback.
-
I've tried to manage it by myself, and it looks, that more auths method is not possible. Especially v2 and v3 together.
result: not possible Two same public_v2 names TEST2:
result: snmp_exporter uses auth=public_v2 why?? |
Beta Was this translation helpful? Give feedback.
-
@tom-i SNMPv3 has been supported by snmp_exporter since v0.0.6. |
Beta Was this translation helpful? Give feedback.
-
Because you did not specify which auth to use on the request. |
Beta Was this translation helpful? Give feedback.
-
Trying to migrate to the new syntax now and I'm confused by the documentation. Here's my generator: auths:
public_v2:
version: 2
community: customsnmp
modules:
roomalert:
walk:
- 1.3.6.1.4.1.20916.1.11.1.2.1 This causes error: Is the |
Beta Was this translation helpful? Give feedback.
The auth (public_v2, or whatever you define) needs to be specified as a param in the Prometheus scrape job. See the example in the main README.md.