2015-02-20 00:33:49 +01:00
|
|
|
<?php
|
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
$hostname = gethostbyid($alert_entry['device_id']);
|
2015-03-03 18:48:40 +01:00
|
|
|
$alert_state = $alert_entry['state'];
|
2015-02-20 00:33:49 +01:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo '<tr>
|
|
|
|
<td>
|
|
|
|
'.$alert_entry['time_logged'].'
|
|
|
|
</td>';
|
2015-02-20 00:33:49 +01:00
|
|
|
|
|
|
|
if (!isset($alert_entry['device'])) {
|
2015-07-13 20:10:26 +02:00
|
|
|
$dev = device_by_id_cache($alert_entry['device_id']);
|
|
|
|
echo '<td>
|
|
|
|
'.generate_device_link($dev, shorthost($dev['hostname'])).'
|
|
|
|
</td>';
|
2015-02-20 00:33:49 +01:00
|
|
|
}
|
|
|
|
|
2016-02-17 13:59:58 +00:00
|
|
|
echo '<td>'.htmlspecialchars($alert_entry['name']).'</td>';
|
2015-02-20 00:33:49 +01:00
|
|
|
|
2018-12-05 22:19:25 +05:30
|
|
|
echo "<td>";
|
2015-07-13 20:10:26 +02:00
|
|
|
if ($alert_state != '') {
|
|
|
|
if ($alert_state == '0') {
|
2016-09-22 10:44:17 -04:00
|
|
|
$fa_icon = 'check';
|
|
|
|
$fa_color = 'success';
|
|
|
|
$text = 'Ok';
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif ($alert_state == '1') {
|
2016-09-22 10:44:17 -04:00
|
|
|
$fa_icon = 'remove';
|
|
|
|
$fa_color = 'danger';
|
|
|
|
$text = 'Alert';
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif ($alert_state == '2') {
|
2016-09-22 10:44:17 -04:00
|
|
|
$fa_icon = 'info-circle';
|
|
|
|
$fa_color = 'muted';
|
|
|
|
$text = 'Ack';
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif ($alert_state == '3') {
|
2016-09-22 10:44:17 -04:00
|
|
|
$fa_icon = 'arrow-down';
|
|
|
|
$fa_color = 'warning';
|
|
|
|
$text = 'Worse';
|
2016-08-18 20:28:22 -05:00
|
|
|
} elseif ($alert_state == '4') {
|
2016-09-22 10:44:17 -04:00
|
|
|
$fa_icon = 'arrow-up';
|
|
|
|
$fa_color = 'info';
|
|
|
|
$text = 'Better';
|
2015-07-13 20:10:26 +02:00
|
|
|
}//end if
|
2018-12-05 22:19:25 +05:30
|
|
|
echo "<b><i class='fa fa-fw fa-".$fa_icon." text-".$fa_color."'></i> $text</b>";
|
|
|
|
}
|
|
|
|
echo "</td>";
|
2015-03-03 18:48:40 +01:00
|
|
|
|
2015-07-13 20:10:26 +02:00
|
|
|
echo '</tr>';
|