2008-06-30 Sancho Lerena <slerena@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@910 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2008-06-30 16:38:26 +00:00
parent cc704c43ed
commit b50d8fcfd6
6 changed files with 54 additions and 23 deletions

View File

@ -72,6 +72,16 @@
2008-06-30 Sancho Lerena <slerena@artica.es>
* 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.

View File

@ -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 "<h2>".lang_string ("setup_screen")." &gt; ";
@ -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');

View File

@ -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;

View File

@ -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 "<tr><th>X</th>";
echo "<th>".$lang_label["type"]."</th>
<th>".$lang_label["module_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["SLA"]."</th>
<th>".$lang_label["status"]."</th>
<th>".$lang_label["interval"]."</th>
<th>".$lang_label["last_contact"]."</th>";
@ -82,9 +86,15 @@ if (comprueba_login() == 0) {
}
echo "<td class='".$tdcolor."'>";
echo "<img src='images/".show_icon_type($row_t["id_tipo_modulo"])."' border=0>";
echo "<td class='".$tdcolor."'>".$est_modulo."</td>";
echo "<td class='".$tdcolor."f9'>"
.substr($est_description,0,35)."</td>";
echo "<td class='".$tdcolor."' title='".$est_description."'>".$est_modulo."</td>";
echo "<td class='$tdcolor'>";
$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 %</td>";;
echo "<td class='".$tdcolor."' align='center'>";
if ($est_estado == 1){
if ($est_cambio == 1)

View File

@ -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 <input type="checkbox" name="group" value="group" class="chk"/>';
echo '<td>';
echo '<input name="updbutton" type="submit" class="sub upd" value="'.
lang_string ("update").'">';
echo '<input name="updbutton" type="submit" class="sub upd" value="'. lang_string ("update"). '">';
echo '</td>';
echo '</table>';
echo '</form>';

View File

@ -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 */;