Ad Widget

Collapse

Multiple macros in discovery SNMP item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicolasfo
    Member
    • Jul 2015
    • 56

    #1

    Multiple macros in discovery SNMP item

    Hello everyone,
    I'm trying to monitor a cluster of firewalls (fw 0 and fw 1)
    In each fw, there's 2 CPUs (cpu 0 and cpu 1). I want to monitor temperature of each CPU.
    So I created a discovery rule, wich have to create 4 items :
    - FW 0 CPU 0
    - FW 0 CPU 1
    - FW 1 CPU 0
    - FW 1 CPU 1

    In my discovery rule, I have set this SNMP OID :
    Code:
    discovery[{#FWINDEX},1.3.6.1.4.1.11256.1.16.2.1.1,{#CPUINDEX},1.3.6.1.4.1.11256.1.11.12.1.1]
    And in my discovery item, I have set those settings :
    - Name : Firewall {#FWINDEX} CPU {#CPUINDEX} Temp
    - Key : fw.cpu.temp.[{#FWINDEX},{#CPUINDEX}]
    - OID : 1.3.6.1.4.1.11256.1.11.12.1.2.{#FWINDEX}.{#CPUINDE X}

    And I get those results in "Lastest data" :
    Click image for larger version  Name:	Capture.PNG Views:	0 Size:	31.4 KB ID:	410574
    With the following errors :
    - snmp_parse_oid(): cannot parse OID "1.3.6.1.4.1.11256.1.11.12.1.0.{#CPUINDEX}". For the line 1,
    - snmp_parse_oid(): cannot parse OID "1.3.6.1.4.1.11256.1.11.12.1.1.{#CPUINDEX}". For the line 2,
    - snmp_parse_oid(): cannot parse OID "1.3.6.1.4.1.11256.1.11.12.1.{#FWINDEX}.0". For the line 3,
    - snmp_parse_oid(): cannot parse OID "1.3.6.1.4.1.11256.1.11.12.1.{#FWINDEX}.1". For the line 4.

    It seems it's not possible to have 2 (or maybe more) macros in a SNMP OID. Is it right ?

    If so, how can I do to monitor CPU temps ?

    Thanks

    Nicolas
    Last edited by nicolasfo; 10-10-2020, 15:54.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Look at the structure of the OIDs used in LLD.
    I think this is the problem: “The discovered entities are grouped by {#SNMPINDEX} macro value.”
    https://www.zabbix.com/documentation...very/snmp_oids
    You can override this macro.
    Last edited by Hamardaban; 10-10-2020, 12:18.

    Comment

    • nicolasfo
      Member
      • Jul 2015
      • 56

      #3
      Hello Hamardaban,

      Thanks for the reply.
      I saw this page before, but I don't undestand this :
      A built-in macro {#SNMPINDEX} containing index of the discovered OID is applied to discovered entities. The discovered entities are grouped by {#SNMPINDEX} macro value.
      - discovered entities are, in my case, #FWINDEX or #CPUINDEX ?
      - What means "You can override this macro." ?

      The thing, is I don't get why on the 2 first lines, the #FWINDEX is OK but the #CPUINDEX is not OK, and on the 2 last lines, it's the reverse ?

      Thanks

      Nicolas
      Last edited by nicolasfo; 10-10-2020, 15:21.

      Comment

      • nicolasfo
        Member
        • Jul 2015
        • 56

        #4
        OK, I almost get it.

        I replaced OID discovery item :

        1.3.6.1.4.1.11256.1.11.12.1.2.{#FWINDEX}.{#CPUINDE X}
        by
        1.3.6.1.4.1.11256.1.11.12.1.2.{#SNMPINDEX}

        The items created are OK (4 items) :
        FW0, CPU0 : 1.3.6.1.4.1.11256.1.11.12.1.2.0.0
        FW0,CPU1 : 1.3.6.1.4.1.11256.1.11.12.1.2.0.1
        FW1,CPU0 : 1.3.6.1.4.1.11256.1.11.12.1.2.1.0
        FW1,CPU1 : 1.3.6.1.4.1.11256.1.11.12.1.2.1.1

        But the system creates 2 more items :
        1.3.6.1.4.1.11256.1.11.12.1.2.0
        1.3.6.1.4.1.11256.1.11.12.1.2.1

        Those 2 items are going nowhere, they don't exists in the FW MIB.
        Why are those 2 items are also created ?

        Thanks

        Nicolas
        Last edited by nicolasfo; 10-10-2020, 20:33.

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          It is because you do not understand the documentation that you can not do what you planned.
          Find out what the {#SNMPINDEX} is , how it is formed and what it is used for in the case of snmp LLD.
          It was about {#SNMPINDEX} that I wrote that it can be redefined.

          Comment

          • nicolasfo
            Member
            • Jul 2015
            • 56

            #6
            OK, so, if I understood, SNMPINDEX (wich is a generic value, always generated by Zabbix when a LLD is performed) and my FWINDEX are the same ? So, I dont' have to create FWINDEX ?
            By the way, SNMPINDEX seems to start at 1, and my FW indexes start at 0 (see this doc)

            But with this explanation, the creation of the items 0.0, 0.1, 1.0 and 1.1 are nosense :
            Click image for larger version  Name:	Capture.PNG Views:	0 Size:	36.0 KB ID:	410598

            Still using this explanation, what am I supposed to set in the SNMP OID discovery rule field ?

            After re-reading my firt post, I don't understand why I must use SNMPINDEX in place of the FWINDEX and CPUINDEX I created..?

            Sorry, but maybe it's a little thing I don't undestand, but it seems I missed THE detail

            Thanks

            Nicolas

            PS : I join a SNMPb screenshot to be sure we speak about the same thing :
            Click image for larger version

Name:	Capture.PNG
Views:	1611
Size:	49.6 KB
ID:	410599
            Last edited by nicolasfo; 10-10-2020, 21:16.

            Comment

            Working...