Multiple modules with multiple auths #1225
mariachini
started this conversation in
Ideas
Replies: 2 comments
-
The other way to format this is to have multiple groups within your - targets:
# ESXi servers
labels:
auth: public_v2
module: sc2
- 1.1.1.2;ServerA
- targets:
# Access swicthes
labels:
auth: public_v3
module: SNMPv3
- 2.2.2.3;SWA This would also simplify the relabel configs, as
|
Beta Was this translation helpful? Give feedback.
0 replies
-
From what I noticed, one thing you wrote incorrectly. In the devices.yml file, the labels section should be after the targets, otherwise there will be problems with labeling. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently encountered a rather unusual problem, namely how to use snmp_exporter to handle different modules that require different levels of authentication (v2+v3).
Below is the solution I used in my environment.
devices.yml - in this file I keep a list of devices in a specific form:
snmp_sc2.yml - in this file I keep generated things for servers that use public_v2 auth method
snmp_switches.yml - in this file I keep generated things for switches that use public_v3 auth method
Now it's time to use relabeling option in prometheus.yml:
In the above configuration, Prometheus refers to the devices.yml file where the entries have their own specific structure. Thanks to relabeling, each entry, depending on the module, uses either v2 or v3 authentication.
Now all you need to do is run snmp_exporter and as a parameter --config.file you should specify the path to the mask files, e.g.
--config.file=/etc/prometheus/snmp_exporter/snmp_*.yml
I hope this helps someone :)
Beta Was this translation helpful? Give feedback.
All reactions