Ad Widget

Collapse

Items not generated from calculated item prototype

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicodvb
    Junior Member
    • Apr 2018
    • 7

    #1

    Items not generated from calculated item prototype

    HI,
    I'm trying to generate a calculated item from an item prototype.
    In the discovery rule this is the definition of the prototype:

    name: byterate
    type calculated
    type of information: numeric float
    key: input_byterate
    Formula:
    {MYTPL:net.if.in[ifHCInOctets.{#SNMPINDEX}].delta(15m)}/900

    Type numeric
    units bps
    update interval 60s
    Create enabled: yes

    The ifHCInOctets entry is gathered by SNMPv3.
    All the other non-calculated items (all SNMPv3) are generated, but this one is NEVER generated.
    The formula is a stripped down version. Actually I need to calculate the percentage of bandwidth utilisation, but since even the simpler formula doesn't work I stripped it down.

    How can I know why the item is being ignored? Is there a way to debug the missed generation?

    The version that I'm using is 4.0.0-1.1beta1.

    Thanks.
  • tamas-p
    Junior Member
    • Aug 2018
    • 15

    #2
    I might be no the best person to answer, as I'm also just learning the bits of zabbix, but seems the item reference you use, is not correct. (For me the square brackets [] cause confuse, as I never seen to use them like that)
    If is a template, it should look like something like this:

    100-last(nodePerCpuIdleCore[{#SNMPINDEX}])

    This one is one of my working calculation, where I can only query cpu idle % via snmp discovery, so I have to calculate the "usage"...
    Obviously the actual item where the query happen has the key nodePerCpuIdleCore[{#SNMPINDEX}]

    Or seen other way I have seen, where {template:key} where template is literal including spaces or what ever used in the name of the template.

    I hope this helps..

    Comment

    • Onizuca
      Junior Member
      • Oct 2018
      • 18

      #3
      Hi,
      You can't use this formula.
      Formula must looks like:
      delta("ifHCInOctets.{#SNMPINDEX}]",15m)/900
      Even if this formula will work it would not calculate bandwidth utilisation.
      To calculate bandwidth utilisation you need to add one more element snmp "ifspeed".
      The formula must looks like:
      last("ifHCInOctets.{#SNMPINDEX}]")/last("ifspeed.{#SNMPINDEX}]")*100
      Answer will be in %
      Tell me if formula works.
      Good luck.

      Comment

      • tamas-p
        Junior Member
        • Aug 2018
        • 15

        #4
        Originally posted by Onizuca
        Hi,
        You can't use this formula.
        Formula must looks like:
        delta("ifHCInOctets.{#SNMPINDEX}]",15m)/900
        Even if this formula will work it would not calculate bandwidth utilisation.
        To calculate bandwidth utilisation you need to add one more element snmp "ifspeed".
        The formula must looks like:
        last("ifHCInOctets.{#SNMPINDEX}]")/last("ifspeed.{#SNMPINDEX}]")*100
        Answer will be in %
        Tell me if formula works.
        Good luck.
        Just to point out the there are closing ] but there are no openings at all.

        Comment

        • Onizuca
          Junior Member
          • Oct 2018
          • 18

          #5
          Yes, you right, tamas-p. "]" not needed.
          And i forget that better use "ifHighSpeed" if you have 1Gbps and more links.
          Also don't forget that item ifHCInOctets.{#SNMPINDEX} must have preprocessing: "change per second" and "Custom multiplier=8". Maybe only this you asking for. To show speed in Mbps on interface... And you don't even need calculated item.
          Like this:
          Click image for larger version

Name:	Graph.png
Views:	2376
Size:	23.8 KB
ID:	370249
          But calculated item that i proposed will show used bandwidth in %. For example. We have 10Gbps interface. 5Gbps is 50% of total bandwidth. Its needed if wont to use trigger that alert you if interface if overloaded.

          Comment

          • nicodvb
            Junior Member
            • Apr 2018
            • 7

            #6
            Hello,
            thanks everybody for helping.
            Unfortunately the item is still NOT being generated.
            I've tried all possible variants of

            delta("net.if.in[ifHCInOctets.{#SNMPINDEX}]",15m)/900
            delta(net.if.in[ifHCInOctets.{#SNMPINDEX}],15m)/900
            delta("ifHCInOctets.{#SNMPINDEX}",15m)/900
            delta(ifHCInOctets.{#SNMPINDEX},15m)/900

            but the item is still not there. Is there a way to run a command-line scan and see the discovery rule in action?
            I also made sure to add to the preprocessing the filters

            change_per_second and custom_multiplier: 8

            Onizuca: I know that the formulas above don;t give the percentage of bw used, but I'm just trying to understand why the item is not being generated.

            The formula that I'd use is:
            100*
            (
            delta("net.if.in[ifHCInOctets.{#SNMPINDEX}]",15m)/900
            /
            (last(net.if.speed[ifHighSpeed.{#SNMPINDEX}]) * 125000)
            )

            ifHIghSpeed is expressed in 10Mbps units, hence it has to be multiplied by 1000000 and divided by 8




            I'm afraid that your formula is incorrect:
            last("ifHCInOctets.{#SNMPINDEX}]")/last("ifspeed.{#SNMPINDEX}]")*100

            ifHCInOctets is just a counter that adds and adds over time to finally wrap around. It doesn't say how many bytes have passed between t1 and t2, unless you do a difference (that is the reason wht I used delta()).

            Comment

            • tamas-p
              Junior Member
              • Aug 2018
              • 15

              #7
              Hi,

              Ok, sorry I did miss the basic point of the question.
              One reason could be if there are multiple items you want to create, the name of an item prototype, and key too, has to have some sort of variable in it based on the discovery it belong too..
              A mistake I have made before, was similar. It complained can not create items as key and/or name already exist.. so a key would look like
              key_name[{#SNMPINDEX}]
              and name like
              Named item {#SNMPINDEX}
              As far as understand it would not work without this if there are more than 1 item needs to be created by the prototype...

              Comment

              • nicodvb
                Junior Member
                • Apr 2018
                • 7

                #8
                Oh, finally the item is being generated!
                As Tamas said I had to use the syntax
                key: input_bw_pct2[{#SNMPINDEX}]
                and the same for the name.
                So finally now I should be able to fix the formula and graph the items.

                I'll keep you updated.
                Thanks

                Comment

                Working...