Merge branch 'ent-9233-Historico-de-traps-2' into 'develop'

show historical traps in snmp console

See merge request artica/pandorafms!5235
This commit is contained in:
Daniel Rodriguez 2022-11-03 14:14:26 +00:00
commit 8097001b19
1 changed files with 12 additions and 3 deletions

View File

@ -671,8 +671,17 @@ $filter_resume['group_by'] = $group_by;
$filter_resume['hours_ago'] = $hours_ago;
$filter_resume['trap_type'] = $trap_types[$trap_type];
$traps = db_get_all_rows_sql($sql);
$trapcount = (int) db_get_value_sql($sql_count);
$traps = db_get_all_rows_sql($sql, true);
$trapcount = (int) db_get_value_sql($sql_count, false, true);
// Re-sort traps by timestamp if history db is enabled.
if ($config['history_db_enabled'] == 1) {
usort($traps, function($a, $b)
{
return strtotime($a['timestamp']) < strtotime($b['timestamp']);
}
);
}
// No traps.
if (empty($traps)) {