snmp_exporter is community string indexing possible?

72 views
Skip to first unread message

Felix Gud

unread,
Nov 4, 2020, 6:44:24 AM11/4/20
to Prometheus Users

Hi, i try to get an overview of all mac-addresses connected to a cisco switch. I was able to configure snmp_exporter to get the data equivalent to this command:
'snmpwalk -v1 -c public IPADDRESS .1.3.6.1.2.1.17.4.3.1.1'
But when adding a vlan i have to call the command snmpwalk -v1 -c public@VLAN IPADDRESS .1.3.6.1.2.1.17.4.3.1.1 with VLAN as the vlan id. Is it possible to configure the snmp_exporter to represent this command?

My generator.yml:
modules:
  mac_addr:
    walk: [dot1dTpFdbPort] # 1.3.6.1.2.1.17.4.3.1.1
    lookups:
    - source_indexes: [dot1dTpFdbPort]
      lookup: dot1dTpFdAddress


Thanks in advance.

Brian Brazil

unread,
Nov 4, 2020, 6:53:25 AM11/4/20
to Felix Gud, Prometheus Users
On Wed, 4 Nov 2020 at 11:44, Felix Gud <felix.hoch...@gmail.com> wrote:

Hi, i try to get an overview of all mac-addresses connected to a cisco switch. I was able to configure snmp_exporter to get the data equivalent to this command:
'snmpwalk -v1 -c public IPADDRESS .1.3.6.1.2.1.17.4.3.1.1'
But when adding a vlan i have to call the command snmpwalk -v1 -c public@VLAN IPADDRESS .1.3.6.1.2.1.17.4.3.1.1 with VLAN as the vlan id. Is it possible to configure the snmp_exporter to represent this command?

You'll need an snmp exporter module per community string value, with matching targets on the Prometheus side.

Brian
 

My generator.yml:
modules:
  mac_addr:
    walk: [dot1dTpFdbPort] # 1.3.6.1.2.1.17.4.3.1.1
    lookups:
    - source_indexes: [dot1dTpFdbPort]
      lookup: dot1dTpFdAddress


Thanks in advance.

--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/42634068-7718-4603-a581-786d62a44633n%40googlegroups.com.


--

Felix Gud

unread,
Nov 4, 2020, 8:06:08 AM11/4/20
to Prometheus Users
thanks for the quick reply. It seems like it works if i add in the prometheus yml more community strings to a module. Do you know how the performance of prometheus changes if i add all possible vlans into the prometheus yml? Cisco switches support more than 4k vlans, so I'm not sure if the application will lose to much performance.

Brian Brazil

unread,
Nov 4, 2020, 8:18:23 AM11/4/20
to Felix Gud, Prometheus Users
On Wed, 4 Nov 2020 at 13:06, Felix Gud <felix.hoch...@gmail.com> wrote:
thanks for the quick reply. It seems like it works if i add in the prometheus yml more community strings to a module. Do you know how the performance of prometheus changes if i add all possible vlans into the prometheus yml? Cisco switches support more than 4k vlans, so I'm not sure if the application will lose to much performance.

It'll make no real difference to Prometheus or the snmp exporter, a time series is a time series. The question is more if your device can handle all that load.

Prometheus is probably not the best tool to be tracking mac addresses connected to a switch, that's a bit more profiling than metrics.

Brian
 

Brian Candler

unread,
Nov 4, 2020, 8:46:37 AM11/4/20
to Prometheus Users
There is also a YAML frig you can do, directly on the YAML output from generator, by referencing and overriding specific bits of the YAML:

if_mib: &if_mib
  walk:
  - 1.3.6.1.2.1.2
  - 1.3.6.1.2.1.31.1.1
  ... etc

if_mib_vlan123:
  <<: *if_mib
  version: 1
  auth:
    community: public@vlan123

if_mib_vlan456:
  <<: *if_mib
  version: 1
  auth:
    community: public@vlan456

Reply all
Reply to author
Forward
0 new messages