Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lookup based on IpAddress Index delivers empty results #1373

Open
nicolai-hornung-bl opened this issue Feb 17, 2025 · 0 comments
Open

Lookup based on IpAddress Index delivers empty results #1373

nicolai-hornung-bl opened this issue Feb 17, 2025 · 0 comments

Comments

@nicolai-hornung-bl
Copy link

nicolai-hornung-bl commented Feb 17, 2025

Hi!

I'm trying to lookup a table entry for CheckPoint VPN Tunnels (CHECKPOINT-MIB). These are apparently indexed by the peer IP address as can be seen in the MIB:

	  tunnelTable OBJECT-TYPE
	          SYNTAX  SEQUENCE OF  TunnelEntry
			  MAX-ACCESS  not-accessible
			  STATUS  current  
              DESCRIPTION
                      "A table containing VPN tunnel information."
			   ::= { tables 9002 }        
			   
			   
	  tunnelEntry OBJECT-TYPE
	          SYNTAX  TunnelEntry
	          MAX-ACCESS  not-accessible
	          STATUS  current
	          DESCRIPTION "No description available"
	          INDEX   { tunnelPeerIpAddr }
	          ::= { tunnelTable 1 } 	
		
      TunnelEntry ::=
              SEQUENCE {
                 tunnelPeerIpAddr
                      IpAddress,
                 tunnelPeerObjName
                      DisplayString,
                 tunnelState
                      INTEGER,
                 tunnelCommunity 
                      DisplayString,
                 tunnelNextHop
                      IpAddress,
                 tunnelInterface
                      DisplayString,
                 tunnelSourceIpAddr
                      IpAddress,
                 tunnelLinkPriority
                      INTEGER,
                 tunnelProbState
                      INTEGER,
                 tunnelPeerType
                      INTEGER,
                 tunnelType
                      INTEGER
              }
              
      tunnelPeerIpAddr OBJECT-TYPE
            SYNTAX  IpAddress
            MAX-ACCESS read-only
            STATUS  current
            DESCRIPTION "No description available"
            ::= { tunnelEntry 1 }   

This is the module in my generator.yml:

modules:
  CP_VPN_Tunnel:
    allow_nonincreasing_oids: true
    walk:
      - 1.3.6.1.4.1.2620.500.9002.1.3 # tunnelState
      - 1.3.6.1.4.1.2620.500.9003.1.3 # permanentTunnelState
    lookups:
      - source_indexes: [tunnelPeerIpAddr]
        lookup: tunnelPeerObjName
        drop_source_indexes: false
      - source_indexes: [permanentTunnelPeerIpAddr]
        lookup: permanentTunnelPeerObjName
        drop_source_indexes: false
    overrides:
      tunnelState:
        type: EnumAsStateSet
      permanentTunnelState:
        type: EnumAsStateSet

The tunnelPeerObjName field in the resulting metric however remains empty:

# HELP permanentTunnelState No description available - 1.3.6.1.4.1.2620.500.9003.1.3 (EnumAsStateSet)
# TYPE permanentTunnelState gauge
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="active"} 1
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="destroy"} 0
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="down"} 0
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="idle"} 0
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="init"} 0
permanentTunnelState{permanentTunnelPeerIpAddr="127.0.0.1",permanentTunnelPeerObjName="",permanentTunnelState="phase1"} 0

An snmpwalk however returns data for this OID:

snmpwalk -v 2c -Cc -c COMMUNITY_STRING -l noAuthNoPriv 127.0.0.1 1.3.6.1.4.1.2620.500.9002.1.2
iso.3.6.1.4.1.2620.500.9002.1.2.127.0.0.1.0 = STRING: "s_127.0.0.1"

Is this an issue with the CHECKPOINT-MIB or is snmp_exporter mishandling the IpAddress indexed table lookups?

NOTE: All IPs have been changed to 127.0.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant