Ad Widget

Collapse

Calculated item on template to sum up LLD Item prototype values of the same host.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • verde
    Member
    • Jul 2021
    • 39

    #1

    Calculated item on template to sum up LLD Item prototype values of the same host.

    Hi, how to tweak a calculated item formula to achieve the following? I have a template that includes LLD item prototypes currently working on Zabbix 6.2.6.
    On the hosts using the template I would like to sum values from their own LLD item prototypes, so I created a new calculated item as part of the template (not prototype), but it's not working yet.

    I've changed the formula with small variations but none worked. Thanks
    ​
    Template calculated item. Formulas tried:

    sum(last_foreach(//prefixKey[*]))

    sum(last_foreach(/{HOST.HOST}/prefixKey[*]))
    Click image for larger version  Name:	2022-12-29_12-12.png Views:	0 Size:	20.2 KB ID:	456780


    Item prototype:
    Discovery rule macros: {#ITEMVAR} {#ITEMNUM}
    Click image for larger version  Name:	2022-12-29_12-11.png Views:	0 Size:	35.8 KB ID:	456781​

    ​
    ​
  • verde
    Member
    • Jul 2021
    • 39

    #2
    Nobody gave insights, but I figured it out.
    It's not documented but the calculated formula should follow the same "format" as the key being looked for. On my case, the LLD Key is "prefixKey[{#ITEMVAR},{#ITEMNUM}]", so the calculated formula that worked was: " sum( last_foreach(//prefixKey[*,*]) ) "

    Regards

    Comment

    • dennistm
      Junior Member
      • Jul 2023
      • 7

      #3
      Thanks for posting this. Helped me with something similar without having to go through the zabbix documentation

      Cheers!

      Comment

      • DanielG
        Junior Member
        • Nov 2024
        • 1

        #4
        For Zabbix 7

        item prototype: (Numeric): net.if.criticality.error.[{#SNMPINDEX}]


        Item: sum(last_foreach(//net.if.criticality.error.[*]))


        Regards

        Comment

        Working...