What is the best way to export a list of all performance triggers that happened in the last 3 months?
Ad Widget
Collapse
Export list of all performance triggers for the last X months
Collapse
X
-
I wrote this query which supposedly does what I expect. Maybe it will be useful to someone else:
Code:SELECT FROM_UNIXTIME(e.clock) AS timestamp, t.description, CASE WHEN t.priority = 2 THEN 'Warning' WHEN t.priority = 3 THEN 'Average' WHEN t.priority = 4 THEN 'High' WHEN t.priority = 5 THEN 'Disaster' ELSE t.priority END AS priority, h.host, IFNULL(q.name, "none") AS app_name FROM events e INNER JOIN triggers t ON e.objectid = t.triggerid LEFT JOIN functions f ON f.triggerid = t.triggerid LEFT JOIN items i ON i.itemid = f.itemid LEFT JOIN ( SELECT ia.itemid, a.name FROM items_applications ia LEFT JOIN applications a ON a.applicationid = ia.applicationid GROUP BY ia.itemid ) q ON q.itemid = f.itemid LEFT JOIN hosts h ON h.hostid = i.hostid WHERE t.priority > 1 AND q.name IN ("CPU", "ICMP", "Memory", "Processes") ORDER BY e.eventidComment
Comment