Answer the question
In order to leave comments, you need to log in
SQL query in zabbix database?
Good afternoon, I'm trying to get a table with the names of hosts and the last value of the data element for these hosts from the Zabbix database in one query, in sql the newbie turned out to be the following query:
SELECT hosts.name,hosts_groups.hostid,items.itemid,history_text.value,history_text.clock
FROM hosts
inner JOIN hosts_groups ON (hosts.hostid=hosts_groups.hostid AND hosts_groups.groupid = "77") (получаем ID хостов из группы 77)
inner JOIN items ON (hosts.hostid=items.hostid AND items.name = "CertExpDate_complex") (Получаем ID элементов данных с нужным именем
inner JOIN history_text ON history_text.itemid=items.itemid order by clock DESC limit 500; (Получаем значения искомых элементов данных
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question