From d7808f6dc38e33c8e7299e5cb37e1f1875051711 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Wed, 2 Nov 2022 14:27:08 +0100 Subject: [PATCH] re-sort traps if history enabled --- pandora_console/operation/snmpconsole/snmp_view.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index b17613c9aa..6de673015e 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -302,8 +302,15 @@ if (empty($all_address_agents)) { switch ($config['dbtype']) { case 'mysql': $sql = 'SELECT * - FROM ttrap - ORDER BY timestamp DESC'; + FROM ttrap + WHERE ( + `source` IN ('.implode(',', $address_by_user_groups).") OR + `source`='' OR + `source` NOT IN (".implode(',', $all_address_agents).') + ) + %s + ORDER BY timestamp DESC + LIMIT %d,%d'; break; case 'postgresql':