Arista BGP4-V2 MIB, IPv4 and IPv6 addresses are in HEX

329 views
Skip to first unread message

artem.n...@gmail.com

unread,
Apr 24, 2018, 6:21:33 PM4/24/18
to Prometheus Users
Starting a separate thread to keep things in order. 

I'm using the latest generator and snmp_exporter. My config (generated via official generator):

snmp-arista-generic:
  walk:
  - 1.3.6.1.4.1.30065.4.1.1.2.1.12
  - 1.3.6.1.4.1.30065.4.1.1.2.1.13
  - 1.3.6.1.4.1.30065.4.1.1.2.1.14
  metrics:
  - name: aristaBgp4V2PeerAdminStatus
    oid: 1.3.6.1.4.1.30065.4.1.1.2.1.12
    type: gauge
    help: Whether or not the BGP FSM for this remote peer is halted or running - 1.3.6.1.4.1.30065.4.1.1.2.1.12
    indexes:
    - labelname: aristaBgp4V2PeerInstance
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddrType
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddr
      type: OctetString
  - name: aristaBgp4V2PeerState
    oid: 1.3.6.1.4.1.30065.4.1.1.2.1.13
    type: gauge
    help: The BGP peer connection state. - 1.3.6.1.4.1.30065.4.1.1.2.1.13
    indexes:
    - labelname: aristaBgp4V2PeerInstance
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddrType
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddr
      type: OctetString
  - name: aristaBgp4V2PeerDescription
    oid: 1.3.6.1.4.1.30065.4.1.1.2.1.14
    type: DisplayString
    help: A user configured description identifying this peer - 1.3.6.1.4.1.30065.4.1.1.2.1.14
    indexes:
    - labelname: aristaBgp4V2PeerInstance
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddrType
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddr
      type: OctetString

Results from prometheus:
aristaBgp4V2PeerState{alias="bla-bla",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x0AFCA140",aristaBgp4V2PeerRemoteAddrType="1",instance="1.1.1.1",job="snmp-arista-generic"} 6
aristaBgp4V2PeerState{alias="bla-bla",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x0AFCA144",aristaBgp4V2PeerRemoteAddrType="1",instance="1.1.1.1",job="snmp-arista-generic"} 6
aristaBgp4V2PeerState{alias="bla-bla",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x2A04F547003201000000000000000002",aristaBgp4V2PeerRemoteAddrType="2",instance="1.1.1.1",job="snmp-arista-generic"} 6
aristaBgp4V2PeerState{alias="bla-bla",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x2A04F547003201010000000000000002",aristaBgp4V2PeerRemoteAddrType="2",instance="1.1.1.1",job="snmp-arista-generic"} 6

Results from SNMPwalk:

snmpwalk -v2c  device  -c bla 1.3.6.1.4.1.30065.4.1.1.2.1.12
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.1.4.4.14.33.201 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.1.4.10.39.61.11 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.1.4.10.39.61.15 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.1.4.100.0.252.5 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.1.4.100.0.254.5 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.2.16.32.1.11.0.33.0.0.0.0.0.0.0.0.0.7.121 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.2.16.38.32.1.11.80.128.0.0.0.0.0.0.0.0.0.17 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.2.16.38.32.1.25.11.128.0.0.0.0.0.0.0.0.0.21 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.2.16.42.4.245.71.255.11.0.1.0.0.0.0.0.0.0.1 = INTEGER: 2
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.12.1.2.16.42.4.245.71.255.11.0.1.0.0.0.0.0.0.0.1 = INTEGER: 2

snmpwalk -v2c device  -c bla 1.3.6.1.4.1.30065.4.1.1.2.1.13
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.1.4.4.14.33.201 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.1.4.100.39.61.11 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.1.4.100.39.61.15 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.1.4.100.0.252.5 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.1.4.100.0.254.5 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.2.16.32.1.25.0.11.0.0.0.0.0.0.0.0.0.7.121 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.2.16.38.32.1.25.80.11.0.0.0.0.0.0.0.0.0.17 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.2.16.38.32.1.25.80.11.0.0.0.0.0.0.0.0.0.21 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.2.16.42.4.245.71.255.11.0.1.0.0.0.0.0.0.0.1 = INTEGER: 6
SNMPv2-SMI::enterprises.30065.4.1.1.2.1.13.1.2.16.42.4.245.71.255.11.0.1.0.0.0.0.0.0.0.1 = INTEGER: 6




Ben Kochie

unread,
Apr 24, 2018, 11:19:07 PM4/24/18
to artem.n...@gmail.com, Prometheus Users
I think I understand what's going on.  The snmp_exporter generator knows how to convert InetAddress type for metric values, but not for indexes.

If you manually adjust the config like this it should work:

    - labelname: aristaBgp4V2PeerRemoteAddr
      type: InetAddress

But, this is a bug, we should be able to handle this MIB properly.


--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/bba51e39-bffc-4beb-9c6f-75d90fd58c65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Artem Nedoshepa

unread,
Apr 24, 2018, 11:48:56 PM4/24/18
to Ben Kochie, Prometheus Users
Thank you for looking into this Ben, 

After changing to InetAddress still HEX in the output:

   oid: 1.3.6.1.4.1.30065.4.1.1.2.1.12
    type: gauge
    help: Whether or not the BGP FSM for this remote peer is halted or running - 1.3.6.1.4.1.30065.4.1.1.2.1.12
    indexes:
    - labelname: aristaBgp4V2PeerInstance
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddrType
      type: gauge
    - labelname: aristaBgp4V2PeerRemoteAddr
      type: InetAddress

aristaBgp4V2PeerAdminStatus{alias="device",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0xFCA14000000000000000",aristaBgp4V2PeerRemoteAddrType="1",instance="1.1.1.1",job="snmp-arista-generic"} 2
aristaBgp4V2PeerAdminStatus{alias="device",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0xFCA14400000000000000",aristaBgp4V2PeerRemoteAddrType="1",instance="1.1.1.1",job="snmp-arista-generic"} 2
aristaBgp4V2PeerAdminStatus{alias="device",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x04F547003201080000000000000002000000000000000000000000000000000000000000000000000000",aristaBgp4V2PeerRemoteAddrType="2",instance="1.1.1.1",job="snmp-arista-generic"} 2
aristaBgp4V2PeerAdminStatus{alias="device",aristaBgp4V2PeerInstance="1",aristaBgp4V2PeerRemoteAddr="0x04F547003201090000000000000002000000000000000000000000000000000000000000000000000000",aristaBgp4V2PeerRemoteAddrType="2",instance="1.1.1.1",job="snmp-arista-generic"}

Ben Kochie

unread,
Apr 25, 2018, 12:03:49 AM4/25/18
to Artem Nedoshepa, Prometheus Users
Hrm, it's possible the exporter currently doesn't support indexes as InetAddress either.  I guess we need to file an issue for this.

Brian Brazil

unread,
Apr 25, 2018, 12:41:20 PM4/25/18
to Ben Kochie, Artem Nedoshepa, Prometheus Users
On 25 April 2018 at 05:03, Ben Kochie <sup...@gmail.com> wrote:
Hrm, it's possible the exporter currently doesn't support indexes as InetAddress either.  I guess we need to file an issue for this.

Yeah, that sounds like at least one bug. This is meant to work.

Brian
 

For more options, visit https://groups.google.com/d/optout.



--

Brian Brazil

unread,
Apr 26, 2018, 11:17:32 AM4/26/18
to Ben Kochie, Artem Nedoshepa, Prometheus Users
On 25 April 2018 at 17:41, Brian Brazil <brian....@robustperception.io> wrote:
On 25 April 2018 at 05:03, Ben Kochie <sup...@gmail.com> wrote:
Hrm, it's possible the exporter currently doesn't support indexes as InetAddress either.  I guess we need to file an issue for this.

Yeah, that sounds like at least one bug. This is meant to work.

I've looked into this, and while we do have code for this it is incorrect. The bad news is that dealing with InetAddress correctly is not trivial, and that MIBs do not provide sufficient information to do so (nor does this particular MIB even provide the required information in the English descriptions). Before even considering if we're going to be able to do anything about this, we'll need to see a lot more examples of MIBs with InetAddress objects in practice to see if there's a common convention we might be able to work off.

Brian



--
Reply all
Reply to author
Forward
0 new messages