diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index efc40b8998..2af9b144bb 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,5 +1,20 @@ 2008-07-08 Sancho Lerena + * operation/reporting/graph_viewer.php: Added controls to view in the + new combined graphic mode (lines), and to change size to three pre- + defined sizes. + + * reporting/fgraph.php: Stacked mode support was missing by unknown + reason. Reactivated. Added a mode to view combined graphs in "wired" + mode (lines only). + + * godmode/agentes/modificar_agente.php: Disabled agents was not shown, + so was unable to activate again. Fixed. + + * godmode/reporting/graph_builder.php: Added support for line mode. + Disabled agents don't shown in combo. Some other minor fixes. Changed + to show the name of the module, instead of description. + * include/config.php: Deleted. This file should not be included in SVN * images/so_aix.png: New icon for AIX systems. diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index f604242a35..c202ba4596 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -160,24 +160,24 @@ echo ""; if ($search != ""){ $search_sql = " AND nombre LIKE '%$search%' "; } else { - $search_sql = ""; + $search_sql = " 1 = 1"; } // Show only selected groups if ($ag_group > 1){ - $sql1="SELECT * FROM tagente WHERE id_grupo=$ag_group - AND disabled = 0 $search_sql ORDER BY nombre LIMIT $offset, ".$config["block_size"]; + $sql1="SELECT * FROM tagente WHERE id_grupo = $ag_group + AND $search_sql ORDER BY nombre LIMIT $offset, ".$config["block_size"]; $sql2="SELECT COUNT(id_agente) FROM tagente WHERE id_grupo = $ag_group - AND disabled = 0 $search_sql ORDER BY nombre"; + AND $search_sql ORDER BY nombre"; } else { // Is admin user ?? if (get_db_sql ("SELECT * FROM tusuario WHERE id_usuario ='$id_user'", "nivel") == 1){ - $sql1 = "SELECT * FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"]; - $sql2="SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql ORDER BY nombre, id_grupo"; + $sql1 = "SELECT * FROM tagente WHERE $search_sql ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"]; + $sql2="SELECT COUNT(id_agente) FROM tagente WHERE $search_sql ORDER BY nombre, id_grupo"; } else { - $sql1="SELECT * FROM tagente WHERE disabled = 0 $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') + $sql1="SELECT * FROM tagente WHERE $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') ORDER BY nombre, id_grupo LIMIT $offset, ".$config["block_size"]; - $sql2="SELECT COUNT(id_agente) FROM tagente WHERE disabled = 0 $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') ORDER BY nombre, id_grupo"; + $sql2="SELECT COUNT(id_agente) FROM tagente WHERE $search_sql AND id_grupo IN (SELECT id_grupo FROM tusuario_perfil WHERE id_usuario='$id_user') ORDER BY nombre, id_grupo"; } } @@ -211,10 +211,17 @@ if (mysql_num_rows($result)){ } if (give_acl($id_user, $id_grupo, "AW")==1){ // Agent name - echo " - "; + if ($row["disabled"] == 1){ + echo ""; + } + echo "".substr(strtoupper($row["nombre"]),0,20).""; + id_agente=".$row["id_agente"]."'>".substr(strtoupper($row["nombre"]),0,20).""; + if ($row["disabled"] == 1){ + echo ""; + } + echo ""; echo ""; // Has remote configuration ? diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index 378be3aaad..7efaa0a2ad 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -282,7 +282,7 @@ echo ""; // Show combo with agents echo ""; -print_select_from_sql ('SELECT id_agente, nombre FROM tagente ORDER BY nombre', 'id_agent', $id_agent, '', '--', 0); +print_select_from_sql ('SELECT id_agente, nombre FROM tagente WHERE disabled = 0 ORDER BY nombre', 'id_agent', $id_agent, '', '--', 0); if (isset($chunkdata)) echo ""; @@ -427,15 +427,13 @@ echo ""; echo ""; echo "".lang_string ("Stacked").""; echo ""; -echo ""; + + +$stackeds[0] = lang_string ('Area'); +$stackeds[1] = lang_string ('Stacked area'); +$stackeds[2] = lang_string ('Line'); +print_select ($stackeds, 'stacked', $stacked, '', '', 0); +echo ""; /* @@ -452,6 +450,8 @@ if ($alerts == 1){ } echo ""; */ + + echo ""; echo ""; echo "
"; @@ -535,11 +535,7 @@ function agent_changed () { success: function (data) { $('#id_module').append ($('').attr ('value', 0).text ("--")); jQuery.each (data, function (i, val) { - if (val['descripcion'] == "") { - s = html_entity_decode (val['nombre']); - } else { - s = html_entity_decode (val['descripcion']); - } + s = html_entity_decode (val['nombre']); $('#id_module').append ($('').attr ('value', val['id_agente_modulo']).text (s)); }); $('#id_module').fadeIn ('normal'); diff --git a/pandora_console/operation/reporting/graph_viewer.php b/pandora_console/operation/reporting/graph_viewer.php index 2815af6b4a..f9d4ab542f 100644 --- a/pandora_console/operation/reporting/graph_viewer.php +++ b/pandora_console/operation/reporting/graph_viewer.php @@ -58,7 +58,24 @@ if (isset($_GET["view_graph"])){ $id_user = $row["id_user"]; $private = $row["private"]; $width = $row["width"]; - $height = $row["height"]; + $height = $row["height"]; + $zoom = (int) get_parameter ('zoom', 0); + if ($zoom > 0){ + switch ($zoom){ + case 1: + $width = 500; + $height = 210; + break; + case 2: + $width = 650; + $height = 310; + break; + case 3: + $width = 770; + $height = 400; + break; + } + } $period = (int) get_parameter ('period'); if (! $period) $period = $row["period"]; @@ -66,6 +83,10 @@ if (isset($_GET["view_graph"])){ $period = 3600 * $period; $events = $row["events"]; $description = $row["description"]; + $stacked = (int) get_parameter ('stacked'); + if (! $stacked) + $stacked = $row["stacked"]; + $name = $row["name"]; if (($row["private"]==1) && ($row["id_user"] != $id_user)){ audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access to a custom graph not allowed"); @@ -91,13 +112,15 @@ if (isset($_GET["view_graph"])){ } echo "

".$lang_label["reporting"]." > "; echo $lang_label["combined_image"]."

"; - echo ""; + echo "
"; echo "
"; - echo ""; + echo ""; echo "
"; $period_label = human_time_description ($period); echo "
"; - echo ""; + echo "
"; echo "
"; echo "".lang_string ('period').""; echo ""; @@ -114,13 +137,30 @@ if (isset($_GET["view_graph"])){ $periods[4320] = lang_string ('six_months'); print_select ($periods, 'period', intval ($period / 3600), '', '', 0); echo ""; + $stackeds = array (); + $stackeds[0] = lang_string ('Area'); + $stackeds[1] = lang_string ('Stacked area'); + $stackeds[2] = lang_string ('Line'); + + print_select ($stackeds, 'stacked', $stacked , '', '', 0); + echo ""; + + $zooms = array(); + $zooms[0] = lang_string ('Graph defined'); + $zooms[1] = lang_string ('Zoom x1'); + $zooms[2] = lang_string ('Zoom x2'); + $zooms[3] = lang_string ('Zoom x3'); + + print_select ($zooms, 'zoom', $zoom , '', '', 0); + echo ""; + echo ""; echo "
"; echo "
"; } } -echo "

".$lang_label["reporting"]." > "; -echo $lang_label["custom_graph_viewer"]."

"; +echo "

" . lang_string ("reporting") . " > "; +echo lang_string ("custom_graph_viewer") . "

"; $color=1; $sql="SELECT * FROM tgraph"; diff --git a/pandora_console/reporting/fgraph.php b/pandora_console/reporting/fgraph.php index a98461b045..fffbf96fb1 100644 --- a/pandora_console/reporting/fgraph.php +++ b/pandora_console/reporting/fgraph.php @@ -253,7 +253,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width, if ($pure == 0){ $Font =& $Graph->addNew('font', $config['fontpath']); - $Font->setSize(6); + $Font->setSize(7); $Graph->setFont($Font); $Graph->add( Image_Graph::vertical( @@ -274,7 +274,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width, $Subtitle->setAlignment(IMAGE_GRAPH_ALIGN_LEFT); } else { $Font =& $Graph->addNew('font', $config['fontpath']); - $Font->setSize(6); + $Font->setSize(7); $Graph->setFont($Font); $Graph->add( Image_Graph::vertical( @@ -333,16 +333,42 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width, $Plot->setUpperBound( $alert_high ); } - + // create the 1st plot as smoothed area chart using the 1st dataset - if ($stacked == 0) { - // Non-stacked - $Plot =& $Plotarea->addNew('area', array(&$dataset)); - } else { - // Stacked (> 2.0) - $Plot =& $Plotarea->addNew('Image_Graph_Plot_Area', array(&$dataset, 'stacked')); + if ($stacked == 0) { + + // Non-stacked + $Plot =& $Plotarea->addNew('area', array(&$dataset)); + + } elseif ($stacked == 1) { + + // Stacked (> 2.0) + $Plot =& $Plotarea->addNew('Image_Graph_Plot_Area', array(&$dataset, 'stacked')); + + } else { + + $color_array[0] = "red"; + $color_array[1] = "blue"; + $color_array[2] = "green"; + $color_array[3] = 'yellow'; // yellow + $color_array[4] = '#FF5FDF'; // pink + $color_array[5] = 'orange'; // orange + $color_array[6] = '#FE00DA'; // magenta + $color_array[7] = '#00E2FF'; // cyan + $color_array[8] = '#000000'; // Black + + // Single lines, new in 2.0 (Jul08) + for ($i = 0; $i < $module_number; $i++){ + $Plot =& $Plotarea->addNew('line', array(&$dataset[$i])); + $Plot->setLineColor($color_array[$i]); + } + } + + // Color management + if ($stacked != 2){ + $Plot->setLineColor('gray@0.4'); } - $Plot->setLineColor('gray@0.4'); + $AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X); // $AxisX->Hide(); $AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);