Ad Widget

Collapse

Discovery item - use existing item value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Noobz
    Senior Member
    • Jun 2020
    • 105

    #1

    Discovery item - use existing item value

    Context is a Cisco ASR
    Desired outcome: ITEM NAME = "CPU NAME 1 min util", VALUE "XX" - Where XX is 1 minute average CPU utilisation.


    The issue I have with creating a rule to do this is that the CPU NAME is in a different tree than the utilization statistics for that CPU and they have different indexes

    The name is here
    iso.3.6.1.2.1.47.1.1.1.1.7.131 = STRING: "cpu R0/0"

    The stats are here, note that the first entry is a reference to the name index

    cpmCPUTotalPhysicalIndex
    iso.3.6.1.4.1.9.9.109.1.1.1.1.2.7 = INTEGER: 131

    iso.3.6.1.4.1.9.9.109.1.1.1.1.3.7 = Gauge32: 14
    cpmCPUTotal1min.7
    iso.3.6.1.4.1.9.9.109.1.1.1.1.4.7 = Gauge32: 11

    iso.3.6.1.4.1.9.9.109.1.1.1.1.5.7 = Gauge32: 11

    I have made a discovery rule and item which returns the name

    discovery[{#CPUINDEX},.1.3.6.1.4.1.9.9.109.1.1.1.1.2]
    .1.3.6.1.2.1.47.1.1.1.1.7.{#CPUINDEX}

    I can't determine how to get the desired outcome from here though.
    There are multiple templates available which query the CPU but none generate an item where the name is "CPU NAME etc etc" with the utilisation as the value

    Thanks
  • gert.derouck
    Member
    • Jan 2020
    • 69

    #2
    Hi Noobz,

    Please add the full snmpwalk, maybe we can find another way...

    Comment

    • Noobz
      Senior Member
      • Jun 2020
      • 105

      #3
      Originally posted by gert.derouck
      Hi Noobz,

      Please add the full snmpwalk, maybe we can find another way...
      The full walk is ~70k lines - I'll just add the entity mib walk and the Cisco CPU walk if that helps

      Entity MIB - Physical name tree:
      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.1 = STRING: "Chassis"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.2 = STRING: "slot R0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.3 = STRING: "subslot 0/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.4 = STRING: "subslot 0/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.5 = STRING: "Power Supply Bay 0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.6 = STRING: "Power Supply Module 0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.7 = STRING: "PEM Iout P0/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.8 = STRING: "PEM Vout P0/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.9 = STRING: "PEM Vin P0/2"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.10 = STRING: "PEM Pin P0/3"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.11 = STRING: "Temp: Temp 3 P0/4"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.12 = STRING: "Temp: Temp 2 P0/5"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.25 = STRING: "Power Supply Bay 1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.26 = STRING: "Power Supply Module 1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.27 = STRING: "PEM Iout P1/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.28 = STRING: "PEM Vout P1/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.29 = STRING: "PEM Vin P1/2"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.30 = STRING: "PEM Pin P1/3"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.31 = STRING: "Temp: Temp 3 P1/4"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.32 = STRING: "Temp: Temp 2 P1/5"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.45 = STRING: "Fan Tray Bay 0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.46 = STRING: "Fan Tray"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.47 = STRING: "Temp: FC PWM P2/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.57 = STRING: "Fan 2/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.58 = STRING: "Fan 2/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.59 = STRING: "Fan 2/2"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.60 = STRING: "Fan 2/3"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.61 = STRING: "Fan 2/4"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.100 = STRING: "module R0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.101 = STRING: "VADM1: VX1 R0/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.102 = STRING: "VADM1: VX2 R0/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.103 = STRING: "VADM1: VX3 R0/2"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.104 = STRING: "VADM1: VP1 R0/3"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.105 = STRING: "VADM1: VP2 R0/4"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.106 = STRING: "VADM1: VP3 R0/5"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.107 = STRING: "VADM1: VP4 R0/6"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.108 = STRING: "VADM1: VH R0/7"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.109 = STRING: "VADM1: AUX1 R0/8"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.110 = STRING: "VADM1: AUX2 R0/9"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.111 = STRING: "Temp: CYLON R0/10"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.112 = STRING: "Temp: BOARD R0/11"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.113 = STRING: "Temp: Outlet R0/12"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.114 = STRING: "Temp: CPU R0/13"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.115 = STRING: "VADM2: VX1 R0/14"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.116 = STRING: "VADM2: VX2 R0/15"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.117 = STRING: "VADM2: VX3 R0/16"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.118 = STRING: "VADM2: VP1 R0/17"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.119 = STRING: "VADM2: VP2 R0/18"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.120 = STRING: "VADM2: VP3 R0/19"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.121 = STRING: "VADM2: VH R0/20"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.122 = STRING: "Temp: Inlet R0/21"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.130 = STRING: "CYLON "

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.131 = STRING: "cpu R0/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.132 = STRING: "usb R0/0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.134 = STRING: "usb R0/1"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.136 = STRING: "NME R0"

      mib-2.entityMIB.entityMIBObjects.entityPhysical.entPhy sicalTable.entPhysicalEntry.entPhysicalName.300 = STRING: " FIXED IM subslot 0/0"



      Cisco process MIB - I've only copied the pertinent information as there are several hundred lines here otherwise:

      enterprises.cisco.ciscoMgmt.ciscoProcessMIB.ciscoP rocessMIBObjects.cpmCPU.cpmCPUTotalTable.cpmCPUTot alEntry.cpmCPUTotalPhysicalIndex.7 = INTEGER: 131

      enterprises.cisco.ciscoMgmt.ciscoProcessMIB.ciscoP rocessMIBObjects.cpmCPU.cpmCPUTotalTable.cpmCPUTot alEntry.cpmCPUTotal5sec.7 = Gauge32: 11

      enterprises.cisco.ciscoMgmt.ciscoProcessMIB.ciscoP rocessMIBObjects.cpmCPU.cpmCPUTotalTable.cpmCPUTot alEntry.cpmCPUTotal1min.7 = Gauge32: 11

      enterprises.cisco.ciscoMgmt.ciscoProcessMIB.ciscoP rocessMIBObjects.cpmCPU.cpmCPUTotalTable.cpmCPUTot alEntry.cpmCPUTotal5min.7 = Gauge32: 12


      I would like to make a discovery rule which results in name = cpu R0/0 5 Sec utilisation value = 11%

      I have many other LLD items which do a similar thing for other hosts, however I have always been able to make use of SNMPINDEX to reference the items as the indexes usually match.

      Comment

      • gert.derouck
        Member
        • Jan 2020
        • 69

        #4
        mmm, sorry... I can't see any way either...

        There are multiple templates available which query the CPU but none generate an item where the name is "CPU NAME etc etc" with the utilisation as the value
        I now see why...

        Comment

        • gert.derouck
          Member
          • Jan 2020
          • 69

          #5
          I maybe do have some hint/workaround for you...
          You can collect the Name in one item, and the utilization in another.
          In the trigger you use both items: eg utilization > x% and name.strlen > 0

          In this way you'll have the name and the utilization in the operational data when the trigger fires.

          Comment

          • Noobz
            Senior Member
            • Jun 2020
            • 105

            #6
            Thank you gert.derouck, but I really need the name and value to be as stated so that when I pull the data into Grafana, it is clear what is going on.
            For now, I've just hard coded the CPU name into the item prototypes. This isn't a big deal in this instance as there is only 1 CPU however I want to avoid hard coded names as much as possible.

            Maybe this just isn't possible due to the MIB structure in this instance.

            Comment

            Working...