tom.i
August 10, 2023, 7:56am
1
How should I specify more auths in one generator.yml
file?
Actually on 0.23.0-rc.1 I have generator.yml
like:
auths:
auth_cisco:
version: 2
community: BLABLA
auth_checkpoint:
version: 2
community: BLABLA2
auth_viptela:
version: 3
username: BLABLA3
security_level: authPriv
password: BLABLA4
auth_protocol: SHA
priv_protocol: AES
priv_password: BLABLA5
context_name: context
modules:
...
When I generate snmp.yml
and copy it to snmp_exporter and run it, when I execute snmp_exporter in web page, it shows me message:
Unknown auth ‘public_v2’
So it means, that I have to use just specific names for auths
block? Like public_v1
, public_v2
and public_v3
?
I’ve tried to manage it by myself, and it looks, that more auths method is not possible. Especially v2 and v3 together.
TEST1:
auths:
public_v2:
version: 2
community: BLABLA1
public_v2:
version: 2
community: BLABLA2
result: not possible Two same public_v2 names
TEST2:
v2 + v3
auths:
public_v2:
version: 2
community: BLABLA2
public_v3:
version: 3
username: BLABLA3
security_level: authPriv
password: BLABLA4
auth_protocol: SHA
priv_protocol: AES
priv_password: BLABLA5
context_name: context
result: snmp_exporter uses auth=public_v2 why??
caller=collector.go:218 level=debug auth=public_v2 module=viptela_mib target=10.128.XX.XXX msg="Walking subtree" oid=1.3.6.1.4.1.41916.3
SuperQ
August 11, 2023, 12:42pm
2
Unknown auth ‘public_v2’
This means you did not specify any auth method. You forgot to include one of the auths you specified like auth_checkpoint
.
tom.i
August 15, 2023, 7:26am
4
@SuperQ - ok I’ve tried in generetaro from 0.23.rc-1 this:
auths:
auth_cisco:
version: 2
community: BLA
auth_checkpoint:
version: 2
community: BLA
auth_brocade:
version: 2
community: Bla
auth_viptela:
version: 3
username: BLE
security_level: authPriv
password: BLA
auth_protocol: SHA
priv_protocol: AES
priv_password: BLA
# context_name: contenxt
modules:
cisco_mib:
auth:
name: auth_cisco
walk:
....
but error appears of course…
ts=2023-08-15T07:19:56.001Z caller=main.go:122 level=warn msg="NetSNMP reported parse error(s)" errors=9
ts=2023-08-15T07:19:56.202Z caller=main.go:132 level=error msg="Error generating config netsnmp" err="error parsing yml config: yaml: unmarshal errors:\n line 24: field auth not found in type main.plain"
How can I specify which auth method is used for each module please.
tom.i
August 16, 2023, 8:41am
5
OMG… how stupid am I
I was focused to fill up auths
in generator.yml
and snmp.yml
somehow… that I missed that it should be added to prometheus.yml
file
It has to be filled in this section as it is written in manual (https://github.com/prometheus/snmp_exporter/blob/main/README.md#prometheus-configuration )
- job_name: 'snmp'
static_configs:
- targets:
- 192.168.1.2 # SNMP device.
- switch.local # SNMP device.
- tcp://192.168.1.3:1161 # SNMP device using TCP transport and custom port.
metrics_path: /snmp
params:
auth: [public_v2]
module: [if_mib]
SuperQ
August 16, 2023, 9:53am
6
Yes, that’s it. If you wanted to use another auth entry like auth_brocade
you would just change the group like this:
1 Like
Nani
September 12, 2023, 3:29am
7
so that mean prometheus can’t pull snmp-exporter with multi-communities in 1 time right ?
I also have this issue!
I have multiple vendors and multiple authenticates!
auths:
dell_snmpv3
Lenovo_snmpv3
APC_snmpv3
modules:
dell
lenovo
APC
tom.i
October 18, 2023, 1:11pm
9
Yes, you can add as many communities / authenticates as you want
Hi tom.i
I’m trying to set this up myself, having gone from monitoring one type of device with a community string configured through the snmp.yml to needing to monitor multiple types of device with different community strigns, and am struggling.
Can you share a screen shot of how you’ve added this to and gotten it working from your prometheus.yml file?
Cheers
Paul
Got there this morning, think I needed to look at it with fresh eyes!