mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Fixed problems with oracle in snmp console. Tiquet: #2943
(cherry picked from commit b4ebdb1c8e6d0ce193d5c5d7501141560271d618)
This commit is contained in:
parent
601ff4e4c8
commit
ca67569afa
@ -175,6 +175,9 @@ foreach ($all_traps as $trap) {
|
||||
|
||||
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$rows = db_get_all_rows_filter('tagente',
|
||||
array('id_grupo' => array_keys($user_groups)),
|
||||
array('id_agente'));
|
||||
@ -195,6 +198,8 @@ $all_address_agents = agents_get_addresses($id_agents);
|
||||
foreach ($all_address_agents as $i => $a)
|
||||
$all_address_agents[$i] = '"' . $a . '"';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//Make query to extract traps of DB.
|
||||
@ -233,6 +238,10 @@ switch ($config["dbtype"]) {
|
||||
ORDER BY timestamp DESC";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$sql_all = "SELECT *
|
||||
FROM ttrap
|
||||
WHERE (
|
||||
@ -250,6 +259,26 @@ $sql_count = "SELECT COUNT(id_trap)
|
||||
source NOT IN (" . implode(",", $all_address_agents) . ")
|
||||
)
|
||||
%s";
|
||||
break;
|
||||
case "oracle":
|
||||
$sql_all = "SELECT *
|
||||
FROM ttrap
|
||||
WHERE (source IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
) OR source='' OR source NOT IN (SELECT direccion FROM tagente))
|
||||
%s
|
||||
ORDER BY timestamp DESC";
|
||||
$sql_count = "SELECT COUNT(id_trap)
|
||||
FROM ttrap
|
||||
WHERE (
|
||||
source IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
) OR source='' OR source NOT IN (SELECT direccion FROM tagente))
|
||||
%s";
|
||||
break;
|
||||
}
|
||||
//$whereSubquery = 'WHERE 1=1';
|
||||
$whereSubquery = '';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user