2015-02-20 00:33:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$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
|
|
|
|
|
|
|
echo('<tr>
|
|
|
|
<td>
|
|
|
|
' . $alert_entry['time_logged'] . '
|
|
|
|
</td>');
|
|
|
|
|
|
|
|
if (!isset($alert_entry['device'])) {
|
|
|
|
$dev = device_by_id_cache($alert_entry['device_id']);
|
|
|
|
echo("<td>
|
|
|
|
" . generate_device_link($dev, shorthost($dev['hostname'])) . "
|
|
|
|
</td>");
|
|
|
|
}
|
|
|
|
|
2015-03-03 18:48:40 +01:00
|
|
|
echo("<td>".htmlspecialchars($alert_entry['name']) . "</td>");
|
2015-02-20 00:33:49 +01:00
|
|
|
|
2015-03-03 18:48:40 +01:00
|
|
|
if ($alert_state!='') {
|
|
|
|
if ($alert_state=='0') {
|
2015-03-03 19:25:20 +01:00
|
|
|
$glyph_icon = 'ok';
|
|
|
|
$glyph_color = 'green';
|
|
|
|
$text = 'Ok';
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
|
|
|
elseif ($alert_state=='1') {
|
2015-03-03 19:25:20 +01:00
|
|
|
$glyph_icon = 'remove';
|
|
|
|
$glyph_color = 'red';
|
|
|
|
$text = 'Alert';
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
|
|
|
elseif ($alert_state=='2') {
|
2015-03-03 19:25:20 +01:00
|
|
|
$glyph_icon = 'info-sign';
|
|
|
|
$glyph_color = 'lightgrey';
|
|
|
|
$text = 'Ack';
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
|
|
|
elseif ($alert_state=='3') {
|
2015-03-03 19:25:20 +01:00
|
|
|
$glyph_icon = 'arrow-down';
|
|
|
|
$glyph_color = 'orange';
|
|
|
|
$text = 'Worse';
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
|
|
|
elseif ($alert_state=='4') {
|
2015-03-03 19:25:20 +01:00
|
|
|
$glyph_icon = 'arrow-up';
|
|
|
|
$glyph_color = 'khaki';
|
|
|
|
$text = 'Better';
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
2015-03-03 19:25:20 +01:00
|
|
|
echo("<td><b><span class='glyphicon glyphicon-".$glyph_icon."' style='color:".$glyph_color."'></span> $text</b></td>");
|
2015-03-03 18:48:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
echo("</tr>");
|
2015-02-20 00:33:49 +01:00
|
|
|
|
|
|
|
?>
|