From b237e4261581de10268271ea95d016629e532479 Mon Sep 17 00:00:00 2001 From: Ryan Medlyn Date: Tue, 19 Mar 2019 04:07:05 -0600 Subject: [PATCH] Add location to alert hostname tooltip (#9991) --- html/includes/table/alerts.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/html/includes/table/alerts.inc.php b/html/includes/table/alerts.inc.php index a63382dad9..cb82c3759a 100644 --- a/html/includes/table/alerts.inc.php +++ b/html/includes/table/alerts.inc.php @@ -92,6 +92,8 @@ if (!LegacyAuth::user()->hasGlobalRead()) { $param[] = LegacyAuth::id(); } +$sql .= " LEFT JOIN `locations` ON `devices`.`location_id` = `locations`.`id`"; + $sql .= " RIGHT JOIN `alert_rules` ON `alerts`.`rule_id`=`alert_rules`.`id` WHERE $where"; $count_sql = "SELECT COUNT(`alerts`.`id`) $sql"; @@ -117,7 +119,7 @@ if ($rowCount != -1) { $sql .= " LIMIT $limit_low,$limit_high"; } -$sql = "SELECT `alerts`.*, `devices`.`hostname`, `devices`.`sysName`, `devices`.`hardware`, `alert_rules`.`rule`, `alert_rules`.`name`, `alert_rules`.`severity` $sql"; +$sql = "SELECT `alerts`.*, `devices`.`hostname`, `devices`.`sysName`, `devices`.`hardware`, `locations`.`location`, `alert_rules`.`rule`, `alert_rules`.`name`, `alert_rules`.`severity` $sql"; $rulei = 0; $format = $vars['format'];