From Perl Lion, 2 Years ago, written in Plain Text.
Embed
  1. SELECT `alerts`.*, `devices`.`hostname` AS `hostname`, `devices`.`sysName` AS `sysName`,`alert_rules`.`rule` AS `rule`, `alert_rules`.`name` AS `name`, `alert_rules`.`severity` AS `severity`  FROM `alerts` LEFT JOIN `devices` ON `alerts`.`device_id`=`devices`.`device_id`  RIGHT JOIN `alert_rules` ON `alerts`.`rule_id`=`alert_rules`.`id` WHERE 1 AND `alerts`.`state`!=0 ORDER BY timestamp DESC LIMIT 0,10