2007-07-28 Sancho Lerena <slerena@artica.es>

* include/functions_db.php: Added return_status_layout() function to fix
        problem in Visual Console, now recursive status of linked layouts works (Xavi)

        * install.php: Add more warnings about Database destroy (Dagget)

        * operation/visual_console/render_view.php: Fixed code to get recursive
        status of linked layouts (Xavi).

        * operation/agentes/estado_alertas.php: Fixed layout of lights. Much
        more visible for operators using large screens (Javier Carranza).

        * operation/agentes/status_monitor.php: Fixed layout of lights. Much
        more visible for operators using large screens (Javier Carranza).

        * operation/agentes/estado_monitores.php: Fixed layout of lights. Much
        more visible for operators using large screens (Javier Carranza).

        * operation/agentes/estado_agente.php: Fixed layout of lights. Much
        more visible for operators using large screens (Javier Carranza).

        * images/pixel_*.png: Added for use in previous fixes.

        * reporting/fgraph.php: Fixed problem with generic_pie without data.

        * godmode/reporting/map_builder.php: Fixed problem (annoy feature) reported
        in lists (I cannot remember the name, sorry guy). Now modules expands by default



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@575 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-07-28 18:11:48 +00:00
parent 6a64b81dda
commit c292246b61
17 changed files with 152 additions and 63 deletions

View File

@ -1,3 +1,32 @@
2007-07-28 Sancho Lerena <slerena@artica.es>
* include/functions_db.php: Added return_status_layout() function to fix
problem in Visual Console, now recursive status of linked layouts works (Xavi)
* install.php: Add more warnings about Database destroy (Dagget)
* operation/visual_console/render_view.php: Fixed code to get recursive
status of linked layouts (Xavi).
* operation/agentes/estado_alertas.php: Fixed layout of lights. Much
more visible for operators using large screens (Javier Carranza).
* operation/agentes/status_monitor.php: Fixed layout of lights. Much
more visible for operators using large screens (Javier Carranza).
* operation/agentes/estado_monitores.php: Fixed layout of lights. Much
more visible for operators using large screens (Javier Carranza).
* operation/agentes/estado_agente.php: Fixed layout of lights. Much
more visible for operators using large screens (Javier Carranza).
* images/pixel_*.png: Added for use in previous fixes.
* reporting/fgraph.php: Fixed problem with generic_pie without data.
* godmode/reporting/map_builder.php: Fixed problem (annoy feature) reported
in lists (i cannot remember the name, sorry guy). Now modules expands by default
2007-07-23 Sancho Lerena <slerena@artica.es>
* reporting/fgraph.php: Fixed problem in db information graphs due a

View File

@ -277,7 +277,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
<?PHP
echo "<img src='images/wand.png'>";
echo "</a></h2>";
echo "<div id='map_control' style='display:none'>";
echo "<div id='map_control' style='display:all'>";
// Show combo with agents
// ----------------------
@ -425,8 +425,8 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<b>".$lang_label["label_color"]."</b>";
echo "<td class='datos'>";
echo "<select name='label_color' size=1>";
echo "<option value='ffffff'>".$lang_label["white"]."</option>";
echo "<option value='000000'>".$lang_label["black"]."</option>";
echo "<option value='ffffff'>".$lang_label["white"]."</option>";
echo "</select>";
echo "<td class='datos'>";

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

View File

@ -416,8 +416,11 @@ function give_parameter_post ( $name, $default = "" ){
function human_time_comparation ( $timestamp ){
global $lang_label;
if ($timestamp != ""){
$ahora=date("Y/m/d H:i:s");
$seconds = strtotime($ahora) - strtotime($timestamp);
} else
$seconds = 0;
if ($seconds < 3600)
$render = format_numeric($seconds/60,1)." ".$lang_label["minutes"];

View File

@ -1099,6 +1099,40 @@ function return_status_agent_module ($id_agentmodule = 0){
return 0;
}
// ---------------------------------------------------------------
// Return current status from a given layout
// ---------------------------------------------------------------
// This get's all data from it contained elements (including recursive calls to another nested
// layouts, and makes and AND to be sure that ALL items are OK. If any of them is down, then
// result is down (0)
function return_status_layout ($id_layout = 0){
$temp_status = 0;
$temp_total = 0;
require("config.php");
$sql="SELECT * FROM tlayout_data WHERE id_layout = $id_layout";
$res=mysql_query($sql);
while ($row = mysql_fetch_array($res)){
$id_agentmodule = $row["id_agente_modulo"];
$type = $row["type"];
$parent_item = $row["parent_item"];
$link_layout = $row["id_layout_linked"];
if (($link_layout != 0) && ($id_agentmodule == 0)) {
$temp_status += return_status_layout ($link_layout);
$temp_total++;
} else {
$temp_status += return_status_agent_module ($id_agentmodule);
$temp_total++;
}
}
if ($temp_status == $temp_total)
return 1;
else
return 0;
}
// ---------------------------------------------------------------
// Return current value from a given agent module
// ---------------------------------------------------------------

View File

@ -151,17 +151,18 @@ function install_step1() {
echo "
<div id='install_container'>
<h1>Pandora FMS installation wizard. Step #1 of 4</h1>
<div id='wizard' style='height: 300px;'>
<div id='wizard' style='height: 330px;'>
<div id='install_box'>
<h1>Welcome to Pandora FMS installation Wizard</h1>
<h1>Welcome to Pandora FMS 1.3 installation Wizard</h1>
<p>This wizard helps you to quick install Pandora FMS console in your system.</p>
<p>In three steps checks all dependencies and make your configuration for a quick installation.</p>
<p>In four steps checks all dependencies and make your configuration for a quick installation.</p>
<p>For more information, please refer to documentation.</p>
<i>Pandora FMS Development Team</i>
";
if (file_exists("include/config.php")){
echo "<div class='warn'><b>Warning:</b> You already have a config.php file. Configuration and database would be overwritten if you continued.</div>";
}
echo "<div class='warn'><b>Warning:</b> This installer will <b>overwrite and destroy</b> your existing Pandora FMS configuration and <b>Database</b>. Before contine, please <b>be sure that you have no valuable Pandora FMS data in your Database.</b><br></div>";
echo "
</div>
<div id='logo_img'>
@ -173,8 +174,7 @@ function install_step1() {
</div>
</div>
<div id='foot_install'>
<i>Pandora FMS is a Free Software project registered at
<a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i>
<i>Pandora FMS is a Free Software project registered at <a target='_new' href='http://pandora.sourceforge.net'>SourceForge</a></i>
</div>
</div>";
}
@ -241,9 +241,7 @@ function install_step3() {
<p>
Now, please, complete all details to configure your database and enviroment setup.
</p>
<p>
<b>NOTICE</b> that database will be destroyed if it already exists!
</p>
<div class='warn'><b>Warning:</b> This installer will <b>overwrite and destroy</b> your existing Pandora FMS configuration and <b>Database</b>. Before contine, please <b>be sure that you have no valuable Pandora FMS data in your Database.</b><br></div>
<form method='post' action='install.php?step=4'>
<div>DB User with privileges on MySQL</div>
<input class='login' type='text' name='user' value='root'>

View File

@ -237,36 +237,64 @@ if (comprueba_login() == 0) {
if ($monitor_down <> 0){
echo " <b>/</b> <span class='grey'>".$monitor_down."</span>";
}
echo "</td>
<td class='$tdcolor' align='center'>";
echo "</td>";
/*
if ($numero_monitor <> 0){
if ($estado_general <> 0){
if ($estado_cambio == 0){
echo "<img src='images/b_red.png'>";
// RED
echo "<td class='$tdcolor' align='center' style='background: #ff1d21'>";
} else {
echo "<img src='images/b_yellow.png'>";
// Yellow
echo "<td class='$tdcolor' align='center' style='background: #ffe100'>";
}
} elseif ($monitor_ok > 0) {
echo "<img src='images/b_green.png'>";
// Green
echo "<td class='$tdcolor' align='center' style='background: #5fff1b'>";
}
elseif ($numero_datamodules > 0) {
echo "<img src='images/b_white.png'>";
// Grey #1
echo "<td class='$tdcolor' align='center' style='background: #d5d5d5'>";
}
elseif ($monitor_down > 0) {
echo "<img src='images/b_down.png'>";
// Grey - Red
echo "<td class='$tdcolor' align='center' style='background: #d5b3b3'>";
}
} else {
// Blue
echo "<td class='$tdcolor' align='center' style='background: #4485d5'>";
}
*/
echo "<td class='$tdcolor' align='center'>";
if ($numero_monitor <> 0){
if ($estado_general <> 0){
if ($estado_cambio == 0){
echo "<img src='images/pixel_red.png' width=40 height=18>";
} else {
echo "<img src='images/pixel_yellow.png' width=40 height=18>";
}
} elseif ($monitor_ok > 0) {
echo "<img src='images/pixel_green.png' width=40 height=18>";
}
elseif ($numero_datamodules > 0) {
echo "<img src='images/pixel_gray.png' width=40 height=18>";
}
elseif ($monitor_down > 0) {
echo "<img src='images/pixel_fucsia.png' width=40 height=18>";
}
} else
echo "<img src='images/b_blue.png'>";
echo "<img src='images/pixel_blue.png' width=40 height=18>";
// checks if an alert was fired recently
echo "<td class='$tdcolor' align='center'>";
if (give_disabled_group($id_grupo) == 1)
echo "&nbsp;<img src='images/flag_red.png' alt='".$lang_label["disabled"]."'>";
echo "<img src='images/pixel_gray.png' width=20 height=9>";
else {
if (check_alert_fired($id_agente) == 1)
echo "<img src='images/dot_red.png'>";
echo "<img src='images/pixel_red.png' width=20 height=9>";
else
echo "<img src='images/dot_green.png'>";
echo "<img src='images/pixel_green.png' width=20 height=9>";
}
echo "</td>";
echo "<td class='$tdcolor'>";
@ -283,7 +311,7 @@ if (comprueba_login() == 0) {
}
echo "<a href='#' class='info2'>
<img src='reporting/fgraph.php?tipo=progress&amp;percent=".
$percentil."&amp;height=15&amp;width=80' border='0'>
$percentil."&amp;height=18&amp;width=80' border='0'>
&nbsp;<span>$ultimo_contacto</span></a>";
}

View File

@ -199,14 +199,11 @@ if (isset($_GET["id_agente"])){
sec2=operation/agentes/ver_agente&
id_agente=".$id_agente."'>
<b>".$nombre_agente."</b>";
$string .= "<td class='$tdcolor' align='center'>";
if ($data["times_fired"] <> 0)
$string=$string."<td class='".$tdcolor."'
align='center'>
<img src='images/dot_red.png'></td>";
$string .= "<img src='images/pixel_red.png' width=40 height=18>";
else
$string=$string."<td class='".$tdcolor."'
align='center'>
<img src='images/dot_green.png'></td>";
$string .= "<img src='images/pixel_green.png' width=40 height=18>";
$string = $string."<td class='".$tdcolor."'>"
.dame_nombre_alerta($data["id_alerta"])."</td>";
@ -233,9 +230,9 @@ if (isset($_GET["id_agente"])){
} //end while
if (isset($string)) {
echo "<td class='f9' style='padding-left: 30px;'>";
echo "<img src='images/dot_red.png'> - ".$lang_label["fired"]."</td>";
echo "<img src='images/pixel_red.png' width=18 height=18> ".$lang_label["fired"]."</td>";
echo "<td class='f9' style='padding-left: 30px;'>";
echo "<img src='images/dot_green.png'> - ".$lang_label["not_fired"];
echo "<img src='images/pixel_green.png' width=18 height=18> ".$lang_label["not_fired"];
echo "</td></tr></table>";
echo "<br>";
echo "<table cellpadding='4' cellspacing='4' width='700' class='databox'>";

View File

@ -73,21 +73,15 @@ if (comprueba_login() == 0) {
echo "<td class='".$tdcolor."'>".$est_modulo."</td>";
echo "<td class='".$tdcolor."f9'>"
.substr($est_description,0,35)."</td>";
// echo "<td class='datos'>".$row3["datos"];
if ($agent_down == 1)
echo "<td class='".$tdcolor."' align='center'>
<img src='images/b_down.png'></td>";
echo "<td class='".$tdcolor."' align='center'>";
if ($est_estado == 1){
if ($est_cambio == 1)
echo "<img src='images/pixel_yellow.png' width=40 height=18>";
else
if ($est_estado == 1)
if ($est_cambio ==1)
echo "<td class='".$tdcolor."' align='center'>
<img src='images/b_yellow.png'></td>";
else
echo "<td class='".$tdcolor."' align='center'>
<img src='images/b_red.png'></td>";
else
echo "<td class='".$tdcolor."' align='center'>
<img src='images/b_green.png'></td>";
echo "<img src='images/pixel_red.png' width=40 height=18>";
} else
echo "<img src='images/pixel_green.png' width=40 height=18>";
echo "<td align='center' class='".$tdcolor."'>";
if ($temp_interval != $intervalo)
echo $temp_interval."</td>";

View File

@ -67,9 +67,9 @@ if (comprueba_login() == 0) {
}
echo "<td class='f9' style='padding-left: 10px;'>";
echo "<img src='images/b_green.png'> - ".$lang_label["green_light"]."</td>";
echo "<img src='images/pixel_green.png' width=40 height=18><br>".$lang_label["green_light"]."</td>";
echo "<td class='f9' style='padding-left: 10px;'>";
echo "<img src='images/b_red.png'> - ".$lang_label["red_light"]."</td>";
echo "<img src='images/pixel_red.png' width=40 height=18><br>".$lang_label["red_light"]."</td>";
echo "</td>";
echo "</tr>";
echo "<tr>";
@ -179,9 +179,9 @@ if (comprueba_login() == 0) {
$data2=mysql_fetch_array($result_gen2);
$string=$string."<td class='$tdcolor' align='center' width=20>";
if ($data2["datos"] > 0){
$string=$string."<img src='images/b_green.png'>";
$string=$string."<img src='images/pixel_green.png' width=40 height=18>";
} else {
$string=$string."<img src='images/b_red.png'>";
$string=$string."<img src='images/pixel_red.png' width=40 height=18>";
}
$string=$string."<td class='".$tdcolor."f9'>";

View File

@ -76,6 +76,10 @@ while ($row = mysql_fetch_array($res)){
$link_layout = $row["id_layout_linked"];
$no_link_color = $row["no_link_color"];
// Linked to other layout ?? - Only if not module defined
if (($link_layout != 0) && ($id_agentmodule == 0)) {
$status = return_status_layout ($link_layout);
} else {
$id_agent = give_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $id_agentmodule);
$id_agent_module_parent = give_db_value ("id_agente_modulo", "tlayout_data", "id", $parent_item);
// Item value
@ -84,6 +88,7 @@ while ($row = mysql_fetch_array($res)){
$status_parent = -1;
else
$status_parent = return_status_agent_module ($id_agent_module_parent);
}
// STATIC IMAGE (type = 0)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -707,7 +707,8 @@ function graphic_agentmodules($id_agent, $width, $height) {
}
}
}
$data2 = "";
$data_label2 = "";
$mayor = 0;
$mayor_data =0;
for ($a=0;$a < sizeof($data); $a++)