Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-22234

truncated values for {#SNMPINDEX} macro - 8 leading chars are missing

XMLWordPrintable

    • Team A
    • Sprint 98 (Mar 2023), Sprint 99 (Apr 2023), Sprint 100 (May 2023)
    • 1

      Try to use OID .1.3.6.1.2.1.2.2.1 (IF-MIB::ifEntry) for LLD rule. The OID for rule:

      discovery[{#SNMPVALUE},.1.3.6.1.2.1.2.2.1]
      

      Resulted JSON would be this:

      [
         {
            "{#SNMPINDEX}":"1",
            "{#SNMPVALUE}":"10000000"
         },
         {
            "{#SNMPINDEX}":"2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"3",
            "{#SNMPVALUE}":"1000000000"
         },
         {
            "{#SNMPINDEX}":"4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"7",
            "{#SNMPVALUE}":"10000000"
         },
         {
            "{#SNMPINDEX}":"",
            "{#SNMPVALUE}":"1500"
         },
         {
            "{#SNMPINDEX}":"dress.1",
            "{#SNMPVALUE}":""
         },
         {
            "{#SNMPINDEX}":"dress.2",
            "{#SNMPVALUE}":"8c:16:45:1d:8b:5a"
         },
         {
            "{#SNMPINDEX}":"dress.3",
            "{#SNMPVALUE}":"34:d0:b8:c0:66:85"
         },
         {
            "{#SNMPINDEX}":"dress.4",
            "{#SNMPVALUE}":"0:21:6b:e8:4f:59"
         },
         {
            "{#SNMPINDEX}":"dress.5",
            "{#SNMPVALUE}":"2:42:24:7f:84:ca"
         },
         {
            "{#SNMPINDEX}":"dress.7",
            "{#SNMPVALUE}":"a:0:27:0:0:0"
         },
         {
            "{#SNMPINDEX}":"tatus.1",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"tatus.2",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"tatus.3",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"tatus.4",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"tatus.5",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"tatus.7",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"atus.1",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"atus.2",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"atus.3",
            "{#SNMPVALUE}":"1"
         },
         {
            "{#SNMPINDEX}":"atus.4",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"atus.5",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"atus.7",
            "{#SNMPVALUE}":"2"
         },
         {
            "{#SNMPINDEX}":"ange.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ange.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ange.3",
            "{#SNMPVALUE}":"18569275"
         },
         {
            "{#SNMPINDEX}":"ange.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ange.5",
            "{#SNMPVALUE}":"1015"
         },
         {
            "{#SNMPINDEX}":"ange.7",
            "{#SNMPVALUE}":"2179418"
         },
         {
            "{#SNMPINDEX}":"ts.1",
            "{#SNMPVALUE}":"252739627"
         },
         {
            "{#SNMPINDEX}":"ts.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ts.3",
            "{#SNMPVALUE}":"1145954936"
         },
         {
            "{#SNMPINDEX}":"ts.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ts.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ts.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"tPkts.1",
            "{#SNMPVALUE}":"1189749"
         },
         {
            "{#SNMPINDEX}":"tPkts.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"tPkts.3",
            "{#SNMPVALUE}":"8249910"
         },
         {
            "{#SNMPINDEX}":"tPkts.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"tPkts.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"tPkts.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"stPkts.1",
            "{#SNMPVALUE}":"1189749"
         },
         {
            "{#SNMPINDEX}":"stPkts.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"stPkts.3",
            "{#SNMPVALUE}":"1731206"
         },
         {
            "{#SNMPINDEX}":"stPkts.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"stPkts.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"stPkts.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ards.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ards.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ards.3",
            "{#SNMPVALUE}":"20"
         },
         {
            "{#SNMPINDEX}":"ards.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ards.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ards.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"rs.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ownProtos.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ets.1",
            "{#SNMPVALUE}":"252739627"
         },
         {
            "{#SNMPINDEX}":"ets.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ets.3",
            "{#SNMPVALUE}":"350865263"
         },
         {
            "{#SNMPINDEX}":"ets.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ets.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ets.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"astPkts.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"cards.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ors.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.1",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.2",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.3",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.4",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.5",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"n.7",
            "{#SNMPVALUE}":"0"
         },
         {
            "{#SNMPINDEX}":"ic.1",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         },
         {
            "{#SNMPINDEX}":"ic.2",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         },
         {
            "{#SNMPINDEX}":"ic.3",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         },
         {
            "{#SNMPINDEX}":"ic.4",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         },
         {
            "{#SNMPINDEX}":"ic.5",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         },
         {
            "{#SNMPINDEX}":"ic.7",
            "{#SNMPVALUE}":"SNMPv2-SMI::zeroDotZero"
         }
      ]
      

      Note that exactly first 8 characters on left side get truncated in values for {#SNMPINDEX} macro.

      while actually those index names are more long:

      # snmpwalk -v2c -c public localhost .1.3.6.1.2.1.2.2.1
      IF-MIB::ifIndex.1 = INTEGER: 1
      IF-MIB::ifIndex.2 = INTEGER: 2
      IF-MIB::ifIndex.3 = INTEGER: 3
      IF-MIB::ifIndex.4 = INTEGER: 4
      IF-MIB::ifIndex.5 = INTEGER: 5
      IF-MIB::ifIndex.7 = INTEGER: 7
      IF-MIB::ifDescr.1 = STRING: lo
      IF-MIB::ifDescr.2 = STRING: enp0s31f6
      IF-MIB::ifDescr.3 = STRING: eth1
      IF-MIB::ifDescr.4 = STRING: wlan0
      IF-MIB::ifDescr.5 = STRING: docker0
      IF-MIB::ifDescr.7 = STRING: vboxnet0
      IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
      IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
      IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
      IF-MIB::ifType.4 = INTEGER: ethernetCsmacd(6)
      IF-MIB::ifType.5 = INTEGER: ethernetCsmacd(6)
      IF-MIB::ifType.7 = INTEGER: ethernetCsmacd(6)
      IF-MIB::ifMtu.1 = INTEGER: 65536
      IF-MIB::ifMtu.2 = INTEGER: 1500
      IF-MIB::ifMtu.3 = INTEGER: 1500
      IF-MIB::ifMtu.4 = INTEGER: 1500
      IF-MIB::ifMtu.5 = INTEGER: 1500
      IF-MIB::ifMtu.7 = INTEGER: 1500
      IF-MIB::ifSpeed.1 = Gauge32: 10000000
      IF-MIB::ifSpeed.2 = Gauge32: 0
      IF-MIB::ifSpeed.3 = Gauge32: 1000000000
      IF-MIB::ifSpeed.4 = Gauge32: 0
      IF-MIB::ifSpeed.5 = Gauge32: 0
      IF-MIB::ifSpeed.7 = Gauge32: 10000000
      IF-MIB::ifPhysAddress.1 = STRING: 
      IF-MIB::ifPhysAddress.2 = STRING: 8c:16:45:1d:8b:5a
      IF-MIB::ifPhysAddress.3 = STRING: 34:d0:b8:c0:66:85
      IF-MIB::ifPhysAddress.4 = STRING: 0:21:6b:e8:4f:59
      IF-MIB::ifPhysAddress.5 = STRING: 2:42:24:7f:84:ca
      IF-MIB::ifPhysAddress.7 = STRING: a:0:27:0:0:0
      IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
      IF-MIB::ifAdminStatus.2 = INTEGER: up(1)
      IF-MIB::ifAdminStatus.3 = INTEGER: up(1)
      IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
      IF-MIB::ifAdminStatus.5 = INTEGER: up(1)
      IF-MIB::ifAdminStatus.7 = INTEGER: down(2)
      IF-MIB::ifOperStatus.1 = INTEGER: up(1)
      IF-MIB::ifOperStatus.2 = INTEGER: down(2)
      IF-MIB::ifOperStatus.3 = INTEGER: up(1)
      IF-MIB::ifOperStatus.4 = INTEGER: down(2)
      IF-MIB::ifOperStatus.5 = INTEGER: down(2)
      IF-MIB::ifOperStatus.7 = INTEGER: down(2)
      IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
      IF-MIB::ifLastChange.2 = Timeticks: (0) 0:00:00.00
      IF-MIB::ifLastChange.3 = Timeticks: (18569275) 2 days, 3:34:52.75
      IF-MIB::ifLastChange.4 = Timeticks: (0) 0:00:00.00
      IF-MIB::ifLastChange.5 = Timeticks: (1015) 0:00:10.15
      IF-MIB::ifLastChange.7 = Timeticks: (2179418) 6:03:14.18
      IF-MIB::ifInOctets.1 = Counter32: 251587631
      IF-MIB::ifInOctets.2 = Counter32: 0
      IF-MIB::ifInOctets.3 = Counter32: 1145353401
      IF-MIB::ifInOctets.4 = Counter32: 0
      IF-MIB::ifInOctets.5 = Counter32: 0
      IF-MIB::ifInOctets.7 = Counter32: 0
      IF-MIB::ifInUcastPkts.1 = Counter32: 1183031
      IF-MIB::ifInUcastPkts.2 = Counter32: 0
      IF-MIB::ifInUcastPkts.3 = Counter32: 8248210
      IF-MIB::ifInUcastPkts.4 = Counter32: 0
      IF-MIB::ifInUcastPkts.5 = Counter32: 0
      IF-MIB::ifInUcastPkts.7 = Counter32: 0
      IF-MIB::ifInNUcastPkts.1 = Counter32: 0
      IF-MIB::ifInNUcastPkts.2 = Counter32: 0
      IF-MIB::ifInNUcastPkts.3 = Counter32: 0
      IF-MIB::ifInNUcastPkts.4 = Counter32: 0
      IF-MIB::ifInNUcastPkts.5 = Counter32: 0
      IF-MIB::ifInNUcastPkts.7 = Counter32: 0
      IF-MIB::ifInDiscards.1 = Counter32: 0
      IF-MIB::ifInDiscards.2 = Counter32: 0
      IF-MIB::ifInDiscards.3 = Counter32: 20
      IF-MIB::ifInDiscards.4 = Counter32: 0
      IF-MIB::ifInDiscards.5 = Counter32: 0
      IF-MIB::ifInDiscards.7 = Counter32: 0
      IF-MIB::ifInErrors.1 = Counter32: 0
      IF-MIB::ifInErrors.2 = Counter32: 0
      IF-MIB::ifInErrors.3 = Counter32: 0
      IF-MIB::ifInErrors.4 = Counter32: 0
      IF-MIB::ifInErrors.5 = Counter32: 0
      IF-MIB::ifInErrors.7 = Counter32: 0
      IF-MIB::ifInUnknownProtos.1 = Counter32: 0
      IF-MIB::ifInUnknownProtos.2 = Counter32: 0
      IF-MIB::ifInUnknownProtos.3 = Counter32: 0
      IF-MIB::ifInUnknownProtos.4 = Counter32: 0
      IF-MIB::ifInUnknownProtos.5 = Counter32: 0
      IF-MIB::ifInUnknownProtos.7 = Counter32: 0
      IF-MIB::ifOutOctets.1 = Counter32: 251587631
      IF-MIB::ifOutOctets.2 = Counter32: 0
      IF-MIB::ifOutOctets.3 = Counter32: 350603637
      IF-MIB::ifOutOctets.4 = Counter32: 0
      IF-MIB::ifOutOctets.5 = Counter32: 0
      IF-MIB::ifOutOctets.7 = Counter32: 0
      IF-MIB::ifOutUcastPkts.1 = Counter32: 1183031
      IF-MIB::ifOutUcastPkts.2 = Counter32: 0
      IF-MIB::ifOutUcastPkts.3 = Counter32: 1729985
      IF-MIB::ifOutUcastPkts.4 = Counter32: 0
      IF-MIB::ifOutUcastPkts.5 = Counter32: 0
      IF-MIB::ifOutUcastPkts.7 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.1 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.2 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.3 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.4 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.5 = Counter32: 0
      IF-MIB::ifOutNUcastPkts.7 = Counter32: 0
      IF-MIB::ifOutDiscards.1 = Counter32: 0
      IF-MIB::ifOutDiscards.2 = Counter32: 0
      IF-MIB::ifOutDiscards.3 = Counter32: 0
      IF-MIB::ifOutDiscards.4 = Counter32: 0
      IF-MIB::ifOutDiscards.5 = Counter32: 0
      IF-MIB::ifOutDiscards.7 = Counter32: 0
      IF-MIB::ifOutErrors.1 = Counter32: 0
      IF-MIB::ifOutErrors.2 = Counter32: 0
      IF-MIB::ifOutErrors.3 = Counter32: 0
      IF-MIB::ifOutErrors.4 = Counter32: 0
      IF-MIB::ifOutErrors.5 = Counter32: 0
      IF-MIB::ifOutErrors.7 = Counter32: 0
      IF-MIB::ifOutQLen.1 = Gauge32: 0
      IF-MIB::ifOutQLen.2 = Gauge32: 0
      IF-MIB::ifOutQLen.3 = Gauge32: 0
      IF-MIB::ifOutQLen.4 = Gauge32: 0
      IF-MIB::ifOutQLen.5 = Gauge32: 0
      IF-MIB::ifOutQLen.7 = Gauge32: 0
      IF-MIB::ifSpecific.1 = OID: SNMPv2-SMI::zeroDotZero
      IF-MIB::ifSpecific.2 = OID: SNMPv2-SMI::zeroDotZero
      IF-MIB::ifSpecific.3 = OID: SNMPv2-SMI::zeroDotZero
      IF-MIB::ifSpecific.4 = OID: SNMPv2-SMI::zeroDotZero
      IF-MIB::ifSpecific.5 = OID: SNMPv2-SMI::zeroDotZero
      IF-MIB::ifSpecific.7 = OID: SNMPv2-SMI::zeroDotZero
      

       

      So, i'm getting wrong index. Example of wrong and correct ones, aligned on Right:

              ic.7
              astPkts.1
      
      ifSpecific.7
      ifOutNUcastPkts.1
      

      This particular OID was used here just as example to simplify scenario to reproduce the issue, while somewhere in real production installation another OID is actually used.

            dgoloscapov Dmitrijs Goloscapovs
            zalex_ua Oleksii Zagorskyi
            Team A
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: