mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Small fix to get all triggered alerts and ui update
This commit is contained in:
@@ -66,9 +66,11 @@ foreach( dbFetchRows($full_query, $param) as $alert ) {
|
|||||||
$rule = dbFetchRow("SELECT * FROM alert_rules WHERE id = ? LIMIT 1", array($alert['rule_id']));
|
$rule = dbFetchRow("SELECT * FROM alert_rules WHERE id = ? LIMIT 1", array($alert['rule_id']));
|
||||||
$log = dbFetchCell("SELECT details FROM alert_log WHERE rule_id = ? AND device_id = ? ORDER BY id DESC LIMIT 1", array($alert['rule_id'],$alert['device_id']));
|
$log = dbFetchCell("SELECT details FROM alert_log WHERE rule_id = ? AND device_id = ? ORDER BY id DESC LIMIT 1", array($alert['rule_id'],$alert['device_id']));
|
||||||
$log_detail = json_decode(gzuncompress($log),true);
|
$log_detail = json_decode(gzuncompress($log),true);
|
||||||
foreach( $log_detail['rule'][0] as $k=>$v ) {
|
foreach( $log_detail['rule'] as $tmp_alerts ) {
|
||||||
|
foreach ($tmp_alerts as $k=>$v) {
|
||||||
if( !empty($v) && $k != 'device_id' && (stristr($k,'id') || stristr($k,'desc')) && substr_count($k,'_') <= 1 ) {
|
if( !empty($v) && $k != 'device_id' && (stristr($k,'id') || stristr($k,'desc')) && substr_count($k,'_') <= 1 ) {
|
||||||
$fault_detail .= $k.' => '.$v."; ";
|
$fault_detail .= $k.' => '.$v."\n ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user