Is there a way to find the lastcheck of an item? Otherwise we have a problem here.
If I try
then sometimes it returns no row if the item hasn't polled for the within last 60 seconds. If I increase it to 120 seconds and LIMIT 1 we still have the same problem if the item hasn't polled for last 120 seconds due to any server delay etc.,
I think back then there was a column lastcheck in older versions, I can't find any such column in zabbix 4.0.
If we had such column then we could use WHERE clock >= lastcheck_column_value in the query.
How is latest data showing us last check date of a item? Is it showing the date from the history_uint table clock column? How can I fetch the same so I can use it in the above query?
I want to SUM the value of 3 items last value and store it in another item. This is needed because I can't use calculated item on LLD discovered item since calculated item doesn't allow wildcard key names to SUM the discovered items.
If I try
Code:
SELECT value FROM history_uint WHERE itemid = '12345' AND clock >= UNIX_TIMESTAMP(NOW() - INTERVAL 60 SECOND) ORDER BY itemid DESC LIMIT 1;
I think back then there was a column lastcheck in older versions, I can't find any such column in zabbix 4.0.
If we had such column then we could use WHERE clock >= lastcheck_column_value in the query.
How is latest data showing us last check date of a item? Is it showing the date from the history_uint table clock column? How can I fetch the same so I can use it in the above query?
I want to SUM the value of 3 items last value and store it in another item. This is needed because I can't use calculated item on LLD discovered item since calculated item doesn't allow wildcard key names to SUM the discovered items.

Comment