diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 7118facdb9..68324611cf 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -777,4 +777,33 @@ function clean_bootgrid($string) {
}
+function alert_details($details) {
+ if( !is_array($details) ) {
+ $details = json_decode(gzuncompress($details),true);
+ }
+ $fault_detail = '';
+ foreach( $details['rule'] as $o=>$tmp_alerts ) {
+ $fallback = true;
+ $fault_detail .= "#".($o+1).": ";
+ if( $tmp_alerts['bill_id'] ) {
+ $fault_detail .= ''.$tmp_alerts['bill_name'].'; ';
+ $fallback = false;
+ }
+ if( $tmp_alerts['port_id'] ) {
+ $fault_detail .= generate_port_link($tmp_alerts).'; ';
+ $fallback = false;
+ }
+ if( $fallback === true ) {
+ foreach( $tmp_alerts as $k=>$v ) {
+ if (!empty($v) && $k != 'device_id' && (stristr($k,'id') || stristr($k,'desc') || stristr($k,'msg')) && substr_count($k,'_') <= 1) {
+ $fault_detail .= "$k => '$v', ";
+ }
+ }
+ $fault_detail = rtrim($fault_detail,", ");
+ }
+ $fault_detail .= "
";
+ }
+ return $fault_detail;
+}
+
?>
diff --git a/html/includes/table/alertlog.inc.php b/html/includes/table/alertlog.inc.php
index 0d15037c3d..860d6066fe 100644
--- a/html/includes/table/alertlog.inc.php
+++ b/html/includes/table/alertlog.inc.php
@@ -39,10 +39,12 @@ if ($rowCount != -1) {
$sql .= " LIMIT $limit_low,$limit_high";
}
-$sql = "SELECT D.device_id,name AS alert,state,time_logged,DATE_FORMAT(time_logged, '%D %b %Y %T') as humandate $sql";
+$sql = "SELECT D.device_id,name AS alert,state,time_logged,DATE_FORMAT(time_logged, '%D %b %Y %T') as humandate,details $sql";
+$rulei = 0;
foreach (dbFetchRows($sql,$param) as $alertlog) {
$dev = device_by_id_cache($alertlog['device_id']);
+ $fault_detail = alert_details($alertlog['details']);
$alert_state = $alertlog['state'];
if ($alert_state=='0') {
$glyph_icon = 'ok';
@@ -69,8 +71,10 @@ foreach (dbFetchRows($sql,$param) as $alertlog) {
$glyph_color = 'khaki';
$text = 'Better';
}
- $response[] = array('time_logged'=>$alertlog['humandate'],
- 'hostname'=>generate_device_link($dev, shorthost($dev['hostname'])),
+ $response[] = array('id'=>$rulei++,
+ 'time_logged'=>$alertlog['humandate'],
+ 'details'=>' ',
+ 'hostname'=>'
Time logged | +Device | alert | Status | @@ -28,6 +30,7 @@ $pagetitle[] = "Alert Log";
---|