mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
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:
parent
cc704c43ed
commit
b50d8fcfd6
@ -72,6 +72,16 @@
|
|||||||
|
|
||||||
2008-06-30 Sancho Lerena <slerena@artica.es>
|
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.
|
* agent_manager.php: Agent names are now show in order.
|
||||||
|
|
||||||
* functions.php: Added a blank space in Help icon.
|
* functions.php: Added a blank space in Help icon.
|
||||||
|
@ -44,6 +44,7 @@ if ($update_settings) {
|
|||||||
$config["graph_color1"] = (string) get_parameter ('graph_color1');
|
$config["graph_color1"] = (string) get_parameter ('graph_color1');
|
||||||
$config["graph_color2"] = (string) get_parameter ('graph_color2');
|
$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);
|
$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["remote_config"]."' WHERE token = 'remote_config'");
|
||||||
@ -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_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_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["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")." > ";
|
echo "<h2>".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[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][0] = lang_string ('Graph color (max)');
|
||||||
$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
$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][0] = lang_string ('days_compact');
|
||||||
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
||||||
$table->data[6][0] = lang_string ('days_purge');
|
$table->data[6][0] = lang_string ('days_purge');
|
||||||
|
@ -34,6 +34,9 @@ $config["fontpath"] = $config["homedir"]."/reporting/FreeSans.ttf";
|
|||||||
// Style (pandora by default)
|
// Style (pandora by default)
|
||||||
$config["style"] = "pandora";
|
$config["style"] = "pandora";
|
||||||
|
|
||||||
|
// Default period (in secs) for auto SLA calculation (for monitors)
|
||||||
|
$config["sla_period"] = 604800;
|
||||||
|
|
||||||
// Read remaining config tokens from DB
|
// Read remaining config tokens from DB
|
||||||
if (! mysql_connect($config["dbhost"],$config["dbuser"],$config["dbpass"])){
|
if (! mysql_connect($config["dbhost"],$config["dbuser"],$config["dbpass"])){
|
||||||
|
|
||||||
@ -80,6 +83,8 @@ if($result2=mysql_query("SELECT * FROM tconfig")){
|
|||||||
break;
|
break;
|
||||||
case "remote_config": $config["remote_config"] = $row2["value"];
|
case "remote_config": $config["remote_config"] = $row2["value"];
|
||||||
break;
|
break;
|
||||||
|
case "sla_period": $config["sla_period"] = $row2["value"];
|
||||||
|
break;
|
||||||
case "graph_color1":
|
case "graph_color1":
|
||||||
$config["graph_color1"] = $row2["value"];
|
$config["graph_color1"] = $row2["value"];
|
||||||
break;
|
break;
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
// Load globar vars
|
// Load globar vars
|
||||||
require("include/config.php");
|
require("include/config.php");
|
||||||
if (comprueba_login() == 0) {
|
if (comprueba_login() == 0) {
|
||||||
|
|
||||||
|
|
||||||
|
require ("include/functions_reporting.php");
|
||||||
|
|
||||||
// $id_agente can be obtained as global variable or GET param.
|
// $id_agente can be obtained as global variable or GET param.
|
||||||
if (isset($_GET["id_agente"])){
|
if (isset($_GET["id_agente"])){
|
||||||
$id_agente = $_GET["id_agente"];
|
$id_agente = $_GET["id_agente"];
|
||||||
@ -32,7 +36,7 @@ if (comprueba_login() == 0) {
|
|||||||
echo "<tr><th>X</th>";
|
echo "<tr><th>X</th>";
|
||||||
echo "<th>".$lang_label["type"]."</th>
|
echo "<th>".$lang_label["type"]."</th>
|
||||||
<th>".$lang_label["module_name"]."</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["status"]."</th>
|
||||||
<th>".$lang_label["interval"]."</th>
|
<th>".$lang_label["interval"]."</th>
|
||||||
<th>".$lang_label["last_contact"]."</th>";
|
<th>".$lang_label["last_contact"]."</th>";
|
||||||
@ -82,9 +86,15 @@ if (comprueba_login() == 0) {
|
|||||||
}
|
}
|
||||||
echo "<td class='".$tdcolor."'>";
|
echo "<td class='".$tdcolor."'>";
|
||||||
echo "<img src='images/".show_icon_type($row_t["id_tipo_modulo"])."' border=0>";
|
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."' title='".$est_description."'>".$est_modulo."</td>";
|
||||||
echo "<td class='".$tdcolor."f9'>"
|
echo "<td class='$tdcolor'>";
|
||||||
.substr($est_description,0,35)."</td>";
|
|
||||||
|
$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'>";
|
echo "<td class='".$tdcolor."' align='center'>";
|
||||||
if ($est_estado == 1){
|
if ($est_estado == 1){
|
||||||
if ($est_cambio == 1)
|
if ($est_cambio == 1)
|
||||||
|
@ -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'].'",
|
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'].'"];';
|
tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];';
|
||||||
} else {
|
} else {
|
||||||
$node = $agent['id_agente'].' [ color="'.$status_color.'", fontsize=7, style="filled", fixedsize=true, width=0.20, height=0.20, label="",
|
$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'].'"];';
|
||||||
tooltip="ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'].'"];';
|
|
||||||
}
|
}
|
||||||
return $node;
|
return $node;
|
||||||
}
|
}
|
||||||
@ -156,13 +155,16 @@ function open_graph () {
|
|||||||
$size_y = 5.4;
|
$size_y = 5.4;
|
||||||
$size = '';
|
$size = '';
|
||||||
|
|
||||||
if ($layout == '' || $layout == 'radial') {
|
if ($layout == "")
|
||||||
$overlap = 'true';
|
$layout = "radial";
|
||||||
}
|
|
||||||
|
|
||||||
if ($nooverlap != '') {
|
if ($layout == 'radial')
|
||||||
|
$overlap = 'true';
|
||||||
|
|
||||||
|
if (($layout == 'flat') OR ($layout == 'spring1') OR ($layout == "spring2"))
|
||||||
|
if ($nooverlap != '')
|
||||||
$overlap = 'scalexy';
|
$overlap = 'scalexy';
|
||||||
}
|
|
||||||
|
|
||||||
if ($pure == 1 && $zoom > 1 && $zoom <= 3) {
|
if ($pure == 1 && $zoom > 1 && $zoom <= 3) {
|
||||||
$size_x *= $zoom;
|
$size_x *= $zoom;
|
||||||
@ -170,18 +172,18 @@ function open_graph () {
|
|||||||
}
|
}
|
||||||
$size = $size_x . ',' . $size_y;
|
$size = $size_x . ',' . $size_y;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// BEWARE: graphwiz DONT use single ('), you need double (")
|
// BEWARE: graphwiz DONT use single ('), you need double (")
|
||||||
$head = "graph networkmap {
|
$head = "graph networkmap { labeljust=l; margin=0; ";
|
||||||
labeljust=l;
|
if ($nooverlap != '')
|
||||||
margin=0;
|
$head .= "ranksep=\"$ranksep\";";
|
||||||
ranksep=\"$ranksep\";
|
$head .= "outputorder=edgesfirst;
|
||||||
outputorder=edgesfirst;
|
|
||||||
overlap=\"$overlap\";
|
overlap=\"$overlap\";
|
||||||
ratio=fill;
|
ratio=fill;
|
||||||
root=0;
|
root=0;
|
||||||
size=\"$size\";
|
size=\"$size\";
|
||||||
";
|
";
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,8 +285,7 @@ if ($pure == "1") {
|
|||||||
}
|
}
|
||||||
//echo ' Display groups <input type="checkbox" name="group" value="group" class="chk"/>';
|
//echo ' Display groups <input type="checkbox" name="group" value="group" class="chk"/>';
|
||||||
echo '<td>';
|
echo '<td>';
|
||||||
echo '<input name="updbutton" type="submit" class="sub upd" value="'.
|
echo '<input name="updbutton" type="submit" class="sub upd" value="'. lang_string ("update"). '">';
|
||||||
lang_string ("update").'">';
|
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
@ -60,7 +60,8 @@ INSERT INTO `tconfig` VALUES
|
|||||||
(16, 'remote_config', '/var/spool/pandora/data_in'),
|
(16, 'remote_config', '/var/spool/pandora/data_in'),
|
||||||
(17, 'graph_color1', '#38B800'),
|
(17, 'graph_color1', '#38B800'),
|
||||||
(18, 'graph_color2', '#42D100'),
|
(18, 'graph_color2', '#42D100'),
|
||||||
(19, 'graph_color3', '#89FF09')
|
(19, 'graph_color3', '#89FF09'),
|
||||||
|
(20, 'sla_period', '604800');
|
||||||
;
|
;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
/*!40000 ALTER TABLE `tconfig` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `tconfig` ENABLE KEYS */;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user