I have the following QUERY for ZABBIX POSTGRES bank:
It returns the history table values to me every 1 hour.
My question is, how can I make this query filter the values according to HOST ID or HOSTNAME?
Code:
SELECT DISTINCT ON (date_trunc('hour', clock))
value, date_trunc('hour', clock)
FROM history
WHERE date_trunc('day', clock) = current_date
ORDER BY date_trunc('hour', clock), clock;
My question is, how can I make this query filter the values according to HOST ID or HOSTNAME?

Comment