Ad Widget

Collapse

About Aggregate calculations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MSG
    Junior Member
    • Jul 2022
    • 14

    #1

    About Aggregate calculations

    Hello
    I am using ZABBIX 5.4.

    I would like to sum up data from hosts on host group.
    I set item to prototype of item as domain.recordings.size[{#DOMAIN}]

    key is domain.recordings.size.
    {#DOMAIN} is value of disvcoverd by rule.
    ZABBIX got data correctly on each host.

    I set Calculated item as below for sum up data from hosts.

    sum(last_foreach(/*/domain.recordings.size[{#DOMAIN}]?[group="group-name"]))

    But If I test for get data it will shwn an error.

    Cannot evaluate function: no data for query at "last_foreach(/*/domain.recordings.size[{#DOMAIN}]?[group="group-name"]))"

    Are there any problem for setting?
    Best regards
  • MSG
    Junior Member
    • Jul 2022
    • 14

    #2
    I created simple key for check without LLD.
    If it will use key will output with echo for numeric number.

    host1:
    $ zabbix_get -s 127.0.0.1 -k rectest
    1000

    host2:
    $ zabbix_get -s 127.0.0.1 -k rectest
    1000

    And I created calculated item as below for check.
    sum(last_foreach(/*/rectest?[group="group-name"]))

    I would like to get data as 2000.
    But error has occured as below.

    Cannot evaluate function: no items matching query at "last_foreach(/*/rectest?[group="group-name"]))".

    Does I need to add item to each hosts using key for rectest?
    Best regards

    Comment

    • MSG
      Junior Member
      • Jul 2022
      • 14

      #3
      If I added item using key rectest to each host, calculated item was working correctly.
      I got data as 2000.

      I am not sure why If data was got by LLD, calculated item does not work?
      I will keep check.

      Comment

      • MSG
        Junior Member
        • Jul 2022
        • 14

        #4
        I found about this problem on ZABBIX FEATURE REQUESTS.

        Allow aggregate checks to work with LLD items


        allow wildcards (or macros) in aggregate items

        Implemented in Zabbix 5.4 under ZBXNEXT-6451

        Support new syntax for trigger expressions


        I can not found information that about LLD macro in calculated item on 5.4.

        Comment

        • saloricardo
          Junior Member
          • Dec 2021
          • 7

          #5

          Hi,

          I have identified the same problem right after upgrading to zabbix 6.0. I've been studying and looking for a few months now, but I still haven't been able to find an alternative way to create calculated items with macros in the formula.

          Ex: sum(last_foreach(/*/{#TITEM}.status.clients?[group="Servers"]))
          Ex: sum(last_foreach(/*/{#TITEM}?[group="Servers"]))
          Last edited by saloricardo; 07-07-2022, 15:34.

          Comment

          • MSG
            Junior Member
            • Jul 2022
            • 14

            #6
            Hi,
            I found sample that using macro in calculated and aggregated items on ZABBIX official Blog.
            https://blog.zabbix.com/triggers-cal...bix-5-4/14880/
            But my problem did not resolve yet.

            Comment

            Working...