From fd42ea6e83f7e2b28c88cb61585b13d812b5509f Mon Sep 17 00:00:00 2001 From: djamp42 Date: Fri, 19 Jul 2019 00:24:24 -0400 Subject: [PATCH] Add more detail to webgui alerts (#10388) * alert sysname * use existing config option * add location to alert table * made location a link * fix formating * Update alerts.inc.php --- includes/html/common/alerts.inc.php | 1 + includes/html/table/alerts.inc.php | 4 +++- resources/views/widgets/alerts.blade.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/html/common/alerts.inc.php b/includes/html/common/alerts.inc.php index 1bb45c6662..5022cc4858 100644 --- a/includes/html/common/alerts.inc.php +++ b/includes/html/common/alerts.inc.php @@ -230,6 +230,7 @@ if (defined('SHOW_SETTINGS')) { Rule Hostname + Location ACK Notes'; diff --git a/includes/html/table/alerts.inc.php b/includes/html/table/alerts.inc.php index 8bf00e1e25..5fbc273084 100644 --- a/includes/html/table/alerts.inc.php +++ b/includes/html/table/alerts.inc.php @@ -14,6 +14,7 @@ */ use LibreNMS\Authentication\LegacyAuth; +use LibreNMS\Config; $where = ' `devices`.`disabled` = 0'; @@ -155,7 +156,7 @@ foreach (dbFetchRows($sql, $param) as $alert) { $severity .= ' -'; } - $hostname = '
' . generate_device_link($alert, shorthost($alert['hostname'])) . '
' . $fault_detail . '
'; + $hostname = '
' . generate_device_link($alert, format_hostname($alert, shorthost($alert['hostname']))) . '
' . $fault_detail . '
'; switch ($severity) { case 'critical': @@ -198,6 +199,7 @@ foreach (dbFetchRows($sql, $param) as $alert) { 'rule' => '' . htmlentities($alert['name']) . '', 'details' => '', 'hostname' => $hostname, + 'location' => generate_link($alert['location'], array('page' => 'devices', 'location' => $alert['location'])), 'timestamp' => ($alert['timestamp'] ? $alert['timestamp'] : 'N/A'), 'severity' => $severity_ico, 'state' => $alert['state'], diff --git a/resources/views/widgets/alerts.blade.php b/resources/views/widgets/alerts.blade.php index e9255de431..e19f10c03e 100644 --- a/resources/views/widgets/alerts.blade.php +++ b/resources/views/widgets/alerts.blade.php @@ -12,6 +12,7 @@ Rule Hostname + Location ACK Notes URL