On Tuesday, 1 March 2022 at 16:14:16 UTC [email protected] wrote:
> also, if I edit generator.yml please which part exactly on generator.yml
> need to be duplicated?
>
Every module that you want to apply a different community string to. e.g.
>
> *generator.yml*
>
> modules:
> # Default IF-MIB interfaces table with ifIndex.
> if_mib:
> walk: [sysUpTime, interfaces, ifXTable]
> version: 2 # SNMP version to use. Defaults to 2.
> auth:
> # Community string is used with SNMP v1 and v2. Defaults to "public".
> community: aspire-lan
> lookups:
> - source_indexes: [ifIndex]
> lookup: ifAlias
> - source_indexes: [ifIndex]
> # Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
> lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
> - source_indexes: [ifIndex]
> # Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
> lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
> overrides:
> ifAlias:
> ignore: true # Lookup metric
> ifDescr:
> ignore: true # Lookup metric
> ifName:
> ignore: true # Lookup metric
> ifType:
> type: EnumAsInfo
>
>
There you've put already changed the community to "aspire-lan". If you
want to run with another community as well, then either duplicate the
*whole* section as if_mib_foo, with everything identical except the auth
section; or use the YAML trick I showed before, like this.
modules:
# Default IF-MIB interfaces table with ifIndex.
if_mib: *&if_mib*
walk: [sysUpTime, interfaces, ifXTable]
version: 2 # SNMP version to use. Defaults to 2.
auth:
# Community string is used with SNMP v1 and v2. Defaults to "public".
community: aspire-lan
lookups:
- source_indexes: [ifIndex]
lookup: ifAlias
- source_indexes: [ifIndex]
# Uis OID to avoid conflict with PaloAlto PAN-COMMON-MIB.
lookup: 1.3.6.1.2.1.2.2.1.2 # ifDescr
- source_indexes: [ifIndex]
# Use OID to avoid conflict with Netscaler NS-ROOT-MIB.
lookup: 1.3.6.1.2.1.31.1.1.1.1 # ifName
overrides:
ifAlias:
ignore: true # Lookup metric
ifDescr:
ignore: true # Lookup metric
ifName:
ignore: true # Lookup metric
ifType:
type: EnumAsInfo
...
*if_mib_foo: <<: *if_mib version: 2 auth: community: BlahBlah123*
You'll have to repeat this as many times as you have different community
strings. And if you want multiple auths for for cisco_wlc, then you'll
need to do the same for that as well.
Re-run the generator, of course, with this new input.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/4a795a1c-6172-4532-99ad-458f62d88458n%40googlegroups.com.