mysql -uroot -p -S mysql.sock -e "use zabbix;select
FROM_UNIXTIME(zabbix.events.clock) 告警时间,
zabbix.hosts.host 告警主机,
zabbix.events.name 告警信息
from
zabbix.hosts,
zabbix.items,
zabbix.functions,
zabbix.triggers,
zabbix.events
where
zabbix.hosts.hostid=zabbix.items.hostid
AND zabbix.items.itemid = zabbix.functions.itemid
AND zabbix.functions.triggerid = zabbix.triggers.triggerid
AND zabbix.triggers.triggerid = zabbix.events.objectid
order by zabbix.events.clock desc ;"