Added support to retrieve agents from the new table of the metaconsole

This commit is contained in:
Alejandro Gallardo Escobar 2015-04-23 21:14:24 +02:00
parent a4431d63a7
commit 1ae9ee0810
1 changed files with 6 additions and 28 deletions

View File

@ -36,34 +36,12 @@ if ($get_agents_group) {
$return = array();
if ($id_group != -1) {
if (defined('METACONSOLE')) {
if ($id_server == 0) {
$servers = $servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup
WHERE disabled = 0");
}
else {
$servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup
WHERE id = " . $id_server . "
AND disabled = 0");
}
foreach ($servers as $server) {
if (metaconsole_load_external_db ($server) != NOERR) {
continue;
}
$return = agents_get_group_agents($id_group);
//Restore db connection
metaconsole_restore_db();
}
}
else {
$return = agents_get_group_agents($id_group);
}
$filter = array();
if (defined('METACONSOLE'))
$filter['id_server'] = $id_server;
$return = agents_get_group_agents($id_group, $filter, "none");
}
switch ($mode) {