Ad Widget

Collapse

Adding CDP(Cisco Discovery Protocol) to interface discovery

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benhanson
    Junior Member
    • Feb 2012
    • 17

    #1

    Adding CDP(Cisco Discovery Protocol) to interface discovery

    I am trying to add Cisco Discovery Protocol details to the Cisco switch template. In the network discovery LLD rule, the SNMP index returned is valid both for the interface info(which works just fine) AND the CDP info. The base OID for the CDP value I'm returning is 1.3.6.1.4.1.9.9.23.1.2.1.1.6. Unfortunately, the CDP element appears to have a dynamic trailing value after the index.

    Sample Valid interface OID, SNMPINDEX 2 and 27:

    Index 2
    snmpwalk -v1 -cpxxxx -On x.x.x.x .1.3.6.1.2.1.2.2.1.7.2

    .1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)

    snmpwalk -v1 -cpxxxx -On x.x.x.x 1.3.6.1.4.1.9.9.23.1.2.1.1.6.2

    .1.3.6.1.4.1.9.9.23.1.2.1.1.6.2.64 = STRING: "MySwitchName1"

    Index 25

    snmpwalk -v1 -cpxxxx -On x.x.x.x .1.3.6.1.2.1.2.2.1.7.25

    .1.3.6.1.2.1.2.2.1.7.1 = INTEGER: up(1)

    snmpwalk -v1 -cpxxxx -On x.x.x.x 1.3.6.1.4.1.9.9.23.1.2.1.1.6.25

    .1.3.6.1.4.1.9.9.23.1.2.1.1.6.2.50 = STRING: "MySwitchName2"

    Notice the trailing '64' and '50' that are appended in the return value. I'm assuming this is breaking the item, unless zabbix just doesn't allow the snmpindex variable to be used in a different OID branch on the same discovery rule.

    Anyone have any ideas? Is there a way to truncate the "return" OID, or have a mask included in the item OID?
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    It would be way easier to understand what you are doing if instead numeric OIDs you will be using MIB names.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • benhanson
      Junior Member
      • Feb 2012
      • 17

      #3
      I usually use the numeric as I don't have all MIBS installed on all machines. Case in point, I don't have the CDP MIB installed at the moment. This is the closest I can come:

      Index 2
      snmpwalk -v1 -cxxxxxxx -On x.x.x.x IF-MIB::ifAdminStatus.2

      IF-MIB::ifAdminStatus.2 = INTEGER: up(1)

      snmpwalk -v1 -cxxxxxxx -On x.x.x.x SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.2

      SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.2.64 = STRING: "MySwitchName1"

      Index 25

      snmpwalk -v1 -cxxxxxxx -On x.x.x.x IF-MIB::ifAdminStatus..25

      IF-MIB::ifAdminStatus.25 = INTEGER: up(1)

      snmpwalk -v1 -cxxxxxxx -On x.x.x.x SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.25

      SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.6.25.50 = STRING: "MySwitchName2"

      Comment

      Working...