diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d341525d0d..eef67dcb3c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2009-01-14 Ramon Novoa + + * operation/agentes/networkmap.php: .dot files are written to disk to + avoid problems with huge graphs. + + * godmode/agentes/agent_template.php: Fixed, column + tagente_estado.cambio does not exist anymore. + 2009-01-12 Esteban Sanchez * godmode/alerts/configure_alert_template.php: Fixed a bug when going diff --git a/pandora_console/godmode/agentes/agent_template.php b/pandora_console/godmode/agentes/agent_template.php index 1441e6b58c..c60bc226b1 100644 --- a/pandora_console/godmode/agentes/agent_template.php +++ b/pandora_console/godmode/agentes/agent_template.php @@ -68,12 +68,12 @@ if (isset ($_POST["template_id"])) { // Create with different estado if proc type or data type if ($id_agente_modulo !== false && ($row2["type"] == 2) || ($row2["type"] == 6) || ($row2["type"] == 9) || ($row2["type"] == 12) || ($row2["type"] == 18)) { - $sql = sprintf ("INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) - VALUES (%d, 0,'0000-00-00 00:00:00',0,0, %d, 0)", $id_agente_modulo, $id_agente); + $sql = sprintf ("INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,estado,id_agente, utimestamp) + VALUES (%d, 0,'0000-00-00 00:00:00',0, %d, 0)", $id_agente_modulo, $id_agente); process_sql ($sql); } elseif ($id_agente_modulo !== false) { - $sql = sprintf ("INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp) - VALUES (%d, 0,'0000-00-00 00:00:00',0,100, %d, 0)", $id_agente_modulo, $id_agente); + $sql = sprintf ("INSERT INTO tagente_estado (id_agente_modulo,datos,timestamp,estado,id_agente, utimestamp) + VALUES (%d, 0,'0000-00-00 00:00:00',100, %d, 0)", $id_agente_modulo, $id_agente); process_sql ($sql); } else { echo '

'.__('Error adding module').'

'; diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index a155f2e632..42b6acda0c 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -327,22 +327,35 @@ $graph = generate_dot ($simple, $font_size); // If image was generated just a few minutes ago, then don't regenerate (it takes long) unless regen checkbox is set $filename_map = $config["attachment_store"]."/networkmap_".$layout; $filename_img = "attachment/networkmap_".$layout."_".$font_size; +$filename_dot = $config["attachment_store"]."/networkmap_".$layout; if($simple) { $filename_map .= "_simple"; $filename_img .= "_simple"; + $filename_dot .= "_simple"; } if($nooverlap) { $filename_map .= "_nooverlap"; $filename_img .= "_nooverlap"; + $filename_dot .= "_nooverlap"; } $filename_map .= ".map"; $filename_img .= ".png"; +$filename_dot .= ".dot"; if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - 300) { $result = true; } else { - $cmd = "echo " . escapeshellarg($graph) . " | $filter -Tcmapx -o".$filename_map." -Tpng -o".$filename_img; + $fh = fopen($filename_dot, 'w'); + if ($fh === false) { + $result = false; + break; + } + + fwrite ($fh, $graph); + $cmd = "$filter -Tcmapx -o".$filename_map." -Tpng -o".$filename_img." ".$filename_dot; $result = system ($cmd); + fclose ($fh); + unlink ($filename_dot); } if ($result !== false) {