2009-09-07 11:07:59 +00:00
|
|
|
<?php
|
2017-12-29 05:36:49 +00:00
|
|
|
/*
|
|
|
|
* LibreNMS
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version. Please see LICENSE.txt at the top level of
|
|
|
|
* the source code distribution for details.
|
|
|
|
*
|
|
|
|
* @package LibreNMS
|
|
|
|
* @subpackage webui
|
2021-02-08 23:29:04 +00:00
|
|
|
* @link https://www.librenms.org
|
2017-12-29 05:36:49 +00:00
|
|
|
* @copyright 2017 LibreNMS
|
|
|
|
* @author LibreNMS Contributors
|
|
|
|
*/
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2019-01-10 06:52:00 +00:00
|
|
|
$hostname = gethostbyid($entry['device_id']);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
unset($icon);
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2017-12-29 05:36:49 +00:00
|
|
|
$severity_colour = eventlog_severity($entry['severity']);
|
|
|
|
$icon = '<span class="alert-status ' . $severity_colour . '"></span>';
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2017-12-29 05:36:49 +00:00
|
|
|
echo '<tr>';
|
|
|
|
echo '<td>' . $icon . '</td>';
|
|
|
|
echo '<td style="vertical-align: middle;">' . $entry['datetime'] . '</td>';
|
2010-06-20 21:37:05 +00:00
|
|
|
|
2011-11-07 19:39:15 +00:00
|
|
|
if (! isset($vars['device'])) {
|
2019-01-10 06:52:00 +00:00
|
|
|
$dev = device_by_id_cache($entry['device_id']);
|
2017-12-29 05:36:49 +00:00
|
|
|
echo '<td style="vertical-align: middle;">' . generate_device_link($dev, shorthost($dev['hostname'])) . '</td>';
|
2011-03-17 11:46:02 +00:00
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2011-03-17 11:46:02 +00:00
|
|
|
if ($entry['type'] == 'interface') {
|
2017-04-04 07:08:23 +00:00
|
|
|
$this_if = cleanPort(getifbyid($entry['reference']));
|
2011-11-07 19:39:15 +00:00
|
|
|
$entry['link'] = '<b>' . generate_port_link($this_if, makeshortif(strtolower($this_if['label']))) . '</b>';
|
2016-08-19 01:28:22 +00:00
|
|
|
} else {
|
2011-03-17 11:46:02 +00:00
|
|
|
$entry['link'] = 'System';
|
|
|
|
}
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2017-12-29 05:36:49 +00:00
|
|
|
echo '<td style="vertical-align: middle;">' . $entry['link'] . '</td>';
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2017-12-29 05:36:49 +00:00
|
|
|
echo '<td style="vertical-align: middle;">' . htmlspecialchars($entry['message']) . '</td>';
|
|
|
|
echo '</tr>';
|