2012-06-08 Dario Rodriguez <dario.rodriguez@artica.es>

* operation/tree.php: Improved performance of tree
	view for policies.

	MERGED FROM 4.0.2



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6462 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2012-06-08 14:14:40 +00:00
parent 5d83e0e461
commit f7cf115f07
2 changed files with 11 additions and 28 deletions

View File

@ -1,3 +1,10 @@
2012-06-08 Dario Rodriguez <dario.rodriguez@artica.es>
* operation/tree.php: Improved performance of tree
view for policies.
MERGED FROM 4.0.2
2012-06-08 Ramon Novoa <rnovoa@artica.es>
* include/db/postgresql.php,

View File

@ -824,34 +824,10 @@ function printTree_($type) {
case 'policies':
$id = $item['id'];
$name = $item['name'];
$agentes = db_get_all_rows_sql("SELECT id_agente FROM tagente
WHERE id_agente IN (SELECT id_agent FROM tpolicy_agents
WHERE id_policy=$id)");
if ($agentes === false) {
$agentes = array();
}
$num_ok = 0;
$num_critical = 0;
$num_warning = 0;
$num_unknown = 0;
foreach ($agentes as $agente) {
$stat = reporting_get_agent_module_info ($agente["id_agente"]);
switch ($stat['status']) {
case 'agent_ok.png':
$num_ok++;
break;
case 'agent_critical.png':
$num_critical++;
break;
case 'agent_warning.png':
$num_warning++;
break;
case 'agent_down.png':
$num_unknown++;
break;
}
}
$num_ok = policies_agents_ok($id);
$num_critical = policies_agents_critical($id);
$num_warning = policies_agents_warning($id);
$num_unknown = policies_agents_unknown($id);
break;
case 'module':
$id = str_replace(array(' ','#'), array('_articapandora_'.ord(' ').'_pandoraartica_', '_articapandora_'.ord('#').'_pandoraartica_'),io_safe_output($item['nombre']));