Merge branch 'ent-6822-Error-SQL-en-SNMP-console' into 'develop'

Ent 6822 error sql en snmp console

See merge request artica/pandorafms!3708
This commit is contained in:
Daniel Rodriguez 2021-01-04 11:16:35 +01:00
commit 2e07d6215f
1 changed files with 6 additions and 3 deletions

View File

@ -252,9 +252,11 @@ switch ($config['dbtype']) {
$id_agents[] = $row['id_agente'];
}
$address_by_user_groups = agents_get_addresses($id_agents);
foreach ($address_by_user_groups as $i => $a) {
$address_by_user_groups[$i] = '"'.$a.'"';
if (!empty($id_agents)) {
$address_by_user_groups = agents_get_addresses($id_agents);
foreach ($address_by_user_groups as $i => $a) {
$address_by_user_groups[$i] = '"'.$a.'"';
}
}
} else {
$rows = db_get_all_rows_filter(
@ -289,6 +291,7 @@ if (empty($all_address_agents)) {
array_unshift($all_address_agents, '""');
}
// Make query to extract traps of DB.
switch ($config['dbtype']) {
case 'mysql':