Hello,
i have a calculated item in template based on last value from polled hosts which sums value of specific item in a whole group of hosts.
The item polls the data from hosts.
Let's say there are 5 hosts and each of them been polling every 10 seconds.
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5
Total sum of these items is 20.
But when host suddenly goes offline last check value still exists and been added while calculating:

According to my example:
When all 5 hosts are online:
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5
SUM = 20
When one of 5 hosts are offline:
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5 (off)
SUM = 20 ( i would like to have 15)
Summarizing all the informations, it shows wrong sum. I know that after some time Last check and last value do not show anything. Its blanked but dont know how long it takes (less than 7 days for sure). Only then its been calculating properly once againg because last value doesn't exist.
My environement:
ITEM: polled data last value
Calculated item: sum(last_foreach(/*/ITEM?[group="GROUPHOSTS"]))
Any idea how to change Last Value to be cleared here or not being taken to calculations when host is off?

Zabbix 6.2
MYSQL
Apache
i have a calculated item in template based on last value from polled hosts which sums value of specific item in a whole group of hosts.
The item polls the data from hosts.
Let's say there are 5 hosts and each of them been polling every 10 seconds.
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5
Total sum of these items is 20.
But when host suddenly goes offline last check value still exists and been added while calculating:
According to my example:
When all 5 hosts are online:
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5
SUM = 20
When one of 5 hosts are offline:
Host | Last Value
1st = 5
2nd = 3
3rd = 2
4th = 5
5th = 5 (off)
SUM = 20 ( i would like to have 15)
Summarizing all the informations, it shows wrong sum. I know that after some time Last check and last value do not show anything. Its blanked but dont know how long it takes (less than 7 days for sure). Only then its been calculating properly once againg because last value doesn't exist.
My environement:
ITEM: polled data last value
Calculated item: sum(last_foreach(/*/ITEM?[group="GROUPHOSTS"]))
Any idea how to change Last Value to be cleared here or not being taken to calculations when host is off?
Zabbix 6.2
MYSQL
Apache