Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4906

CDP neighbour discovery identifies wrong remote device

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Discovery
    • None

    Description

      1. If the device doesn't report the neighbour mac address in 
      cdpCacheDeviceId observium tries to identify the remote device by using cdpCacheAddress. But in situations where you have interfaces with anycast IPs (such in a EVPN-VXLAN network) get_entity_ids_ip_by_network could return multiple matches for a specific cdpCacheAddress, so there is a very high chance that get_autodiscovery_device_id selects the wrong neighbour device. cdpCachePrimaryMgmtAddr is probably more unique in the network, but there is no guarantee.
      2. The first issue can be mitigated by configuring "cdp format device-id mac-address". But at least on NXOS 10.3(4a) the mac address returned in cdpCacheDeviceId is lower case, but the regex only checks for upper case, causing observium to identify the neighbours based on IP and trigger the behaviour above.
       
      Fix for both:
      Index: includes/discovery/neighbours/cisco-cdp-mib.inc.php
      ===================================================================
      --- includes/discovery/neighbours/cisco-cdp-mib.inc.php (revision 13659)
      +++ includes/discovery/neighbours/cisco-cdp-mib.inc.php (working copy)
      @@ -69,7 +69,7 @@

               // Remote hostname
               // NOTE. cdpCacheDeviceId have undocumented limit by 40 chars!
      -        if (preg_match('/^([A-F\d]{2}\s?){6}$/', $cdp_entry['cdpCacheDeviceId'])) {
      +        if (preg_match('/^([A-Fa-z\d]{2}\s?){6}$/', $cdp_entry['cdpCacheDeviceId'])) {
                   // HEX mac address
                   // cdpCacheDeviceId.3.1 = "98 90 96 D1 59 5A "
                   $remote_hostname = $cdp_entry['cdpCacheDeviceId'];
      @@ -113,7 +113,7 @@
               }

               // Remote address
      -        $remote_address = hex2ip($cdp_entry['cdpCacheAddress']);
      +        $remote_address = hex2ip($cdp_entry['cdpCachePrimaryMgmtAddr']);

               // Last change
               /* Derp. Do not use Last change from neighbour, it's not correct for us

      Attachments

        Activity

          [OBS-4906] CDP neighbour discovery identifies wrong remote device

          Improved in r13660.

          landy Mike Stupalov added a comment - Improved in r13660.

          you need attach discovery device debug (or snmpdump) as Bot written, for look into your case.

          landy Mike Stupalov added a comment - you need attach discovery device debug (or snmpdump) as Bot written, for look into your case.

          General questions and device support can be discussed in our Discord channel, click here to join.


          Please make and attach additional information about the device:

          • full snmp dump from device:

            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1 > myagent.snmpwalk
            snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk

            If device not support SNMP version 2c, replace -v2c with -v1.

          • If you have problems with discovery or poller processes, please do and attach these debugs:

            ./discovery.php -d -h <device>
            ./poller.php -d -h <device>

          • additionally attach device and/or vendor specific MIB files

          This comment is added automatically.

          bot Observium Bot added a comment - General questions and device support can be discussed in our Discord channel, click here to join . Please make and attach additional information about the device: full snmp dump from device: snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1 > myagent.snmpwalk snmpwalk -v2c -c <community> -t 3 -Cc --hexOutputLength=0 -Ih -ObentxU <hostname> .1.3.6.1.4.1 >> myagent.snmpwalk If device not support SNMP version 2c, replace -v2c with -v1. If you have problems with discovery or poller processes, please do and attach these debugs: ./discovery.php -d -h <device> ./poller.php -d -h <device> additionally attach device and/or vendor specific MIB files This comment is added automatically.

          People

            landy Mike Stupalov
            ole.myhre Ole Myhre
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: