diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bc3cb0baf2..f90b9b785b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -72,6 +72,16 @@ 2008-06-30 Sancho Lerena + * config_process.php, pandoradb_data.sql, setup.php: Added global + "sla_period" for default Monitor SLA calculation (in sec). + + * estado_monitores.php: By default now shows a SLA based on "sla_period" + period. + + * networkmap.php: Fixed layout to use overlap in all modes using different + techniques, depending on graph type. Tested with different map layouts in + size, topology and dimension. + * agent_manager.php: Agent names are now show in order. * functions.php: Added a blank space in Help icon. diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 80afc8d090..5c27a05b4d 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -43,8 +43,9 @@ if ($update_settings) { $config["remote_config"] = (string) get_parameter ('remote_config'); $config["graph_color1"] = (string) get_parameter ('graph_color1'); $config["graph_color2"] = (string) get_parameter ('graph_color2'); - $config["graph_color3"] = (string) get_parameter ('graph_color3'); - + $config["graph_color3"] = (string) get_parameter ('graph_color3'); + $config["sla_period"] = (int) get_parameter ("sla_period"); + $config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4); mysql_query ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'"); mysql_query ("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE token = 'block_size'"); @@ -59,6 +60,7 @@ if ($update_settings) { mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token = 'graph_color1'"); mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'"); mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'"); + mysql_query ("UPDATE tconfig SET VALUE='".$config["sla_period"]."' WHERE token = 'sla_period'"); } echo "

".lang_string ("setup_screen")." > "; @@ -78,6 +80,8 @@ $table->data[3][0] = lang_string ('Graph color (avg)'); $table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true); $table->data[4][0] = lang_string ('Graph color (max)'); $table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true); +$table->data[5][0] = lang_string ('sla_period'); +$table->data[5][1] = print_input_text ('sla_period', $config["sla_period"], '', 5, 5, true); $table->data[5][0] = lang_string ('days_compact'); $table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true); $table->data[6][0] = lang_string ('days_purge'); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 68335e65aa..9bd37ca066 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -34,6 +34,9 @@ $config["fontpath"] = $config["homedir"]."/reporting/FreeSans.ttf"; // Style (pandora by default) $config["style"] = "pandora"; +// Default period (in secs) for auto SLA calculation (for monitors) +$config["sla_period"] = 604800; + // Read remaining config tokens from DB if (! mysql_connect($config["dbhost"],$config["dbuser"],$config["dbpass"])){ @@ -80,6 +83,8 @@ if($result2=mysql_query("SELECT * FROM tconfig")){ break; case "remote_config": $config["remote_config"] = $row2["value"]; break; + case "sla_period": $config["sla_period"] = $row2["value"]; + break; case "graph_color1": $config["graph_color1"] = $row2["value"]; break; diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 5d3e76bd4d..f37375205c 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -19,6 +19,10 @@ // Load globar vars require("include/config.php"); if (comprueba_login() == 0) { + + + require ("include/functions_reporting.php"); + // $id_agente can be obtained as global variable or GET param. if (isset($_GET["id_agente"])){ $id_agente = $_GET["id_agente"]; @@ -32,7 +36,7 @@ if (comprueba_login() == 0) { echo "X"; echo "".$lang_label["type"]." ".$lang_label["module_name"]." - ".$lang_label["description"]." + ".$lang_label["SLA"]." ".$lang_label["status"]." ".$lang_label["interval"]." ".$lang_label["last_contact"].""; @@ -82,9 +86,15 @@ if (comprueba_login() == 0) { } echo ""; echo ""; - echo "".$est_modulo.""; - echo "" - .substr($est_description,0,35).""; + echo "".$est_modulo.""; + echo ""; + + $temp = return_module_SLA ($row_t["id_agente_modulo"], $config["sla_period"], 1, 2147483647); + if ($temp === false) + echo lang_string("N/A"); + else + echo "$temp %";; + echo ""; if ($est_estado == 1){ if ($est_cambio == 1) diff --git a/pandora_console/operation/agentes/networkmap.php b/pandora_console/operation/agentes/networkmap.php index f22f07adf2..9d8e07fc44 100644 --- a/pandora_console/operation/agentes/networkmap.php +++ b/pandora_console/operation/agentes/networkmap.php @@ -112,8 +112,7 @@ function create_node ($agent, $simple = 0) { shape="ellipse", URL="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; } else { - $node = $agent['id_agente'].' [ color="'.$status_color.'", fontsize=7, style="filled", fixedsize=true, width=0.20, height=0.20, label="", - tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; + $node = $agent['id_agente'] . ' [ color="' . $status_color . '", fontsize=7, style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];'; } return $node; } @@ -156,32 +155,35 @@ function open_graph () { $size_y = 5.4; $size = ''; - if ($layout == '' || $layout == 'radial') { + if ($layout == "") + $layout = "radial"; + + if ($layout == 'radial') $overlap = 'true'; - } - - if ($nooverlap != '') { - $overlap = 'scalexy'; - } + + if (($layout == 'flat') OR ($layout == 'spring1') OR ($layout == "spring2")) + if ($nooverlap != '') + $overlap = 'scalexy'; + if ($pure == 1 && $zoom > 1 && $zoom <= 3) { $size_x *= $zoom; $size_y *= $zoom; } $size = $size_x . ',' . $size_y; + + // BEWARE: graphwiz DONT use single ('), you need double (") - $head = "graph networkmap { - labeljust=l; - margin=0; - ranksep=\"$ranksep\"; - outputorder=edgesfirst; + $head = "graph networkmap { labeljust=l; margin=0; "; + if ($nooverlap != '') + $head .= "ranksep=\"$ranksep\";"; + $head .= "outputorder=edgesfirst; overlap=\"$overlap\"; ratio=fill; root=0; size=\"$size\"; "; - return $head; } @@ -283,8 +285,7 @@ if ($pure == "1") { } //echo ' Display groups '; echo ''; -echo ''; +echo ''; echo ''; echo ''; echo ''; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 423dae32a5..6b5850d361 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -60,7 +60,8 @@ INSERT INTO `tconfig` VALUES (16, 'remote_config', '/var/spool/pandora/data_in'), (17, 'graph_color1', '#38B800'), (18, 'graph_color2', '#42D100'), -(19, 'graph_color3', '#89FF09') +(19, 'graph_color3', '#89FF09'), +(20, 'sla_period', '604800'); ; UNLOCK TABLES; /*!40000 ALTER TABLE `tconfig` ENABLE KEYS */;