2007-05-30 Sancho Lerena <slerena@artica.es>

* pandoradb_data.sql: Added "style" token for default config.

        * include/config.inc.php: Version primary information is now on
        index.php. Here is only a "copy" used in aditional pages that do
        not load index.php

        * index.php: Version information is now here.

        * operation/reporting/graph_builder.php: Solved other little bug.

        * reporting/Image/Canvas/GD.php: Now using Antialias !!!. This is
        a BIG improve for graphs (and a bit slower on old systems).

        * reporting/fgraph.php: Changed colours in main graphs.

        * general/login_page.php: Small change in login screen.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@481 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-05-30 17:32:35 +00:00
parent 9251fcb038
commit 99a2832dd0
8 changed files with 75 additions and 23 deletions

View File

@ -1,3 +1,23 @@
2007-05-30 Sancho Lerena <slerena@artica.es>
* pandoradb_data.sql: Added "style" token for default config.
* include/config.inc.php: Version primary information is now on
index.php. Here is only a "copy" used in aditional pages that do
not load index.php
* index.php: Version information is now here.
* operation/reporting/graph_builder.php: Solved other little bug.
* reporting/Image/Canvas/GD.php: Now using Antialias !!!. This is
a BIG improve for graphs (and a bit slower on old systems).
* reporting/fgraph.php: Changed colours in main graphs.
* general/login_page.php: Small change in login screen.
2007-05-28 Raul Mateos <raulofpandora@gmail.com> 2007-05-28 Raul Mateos <raulofpandora@gmail.com>
* include/styles/pandora.css, pandora_red.css: New style with icon * include/styles/pandora.css, pandora_red.css: New style with icon

View File

@ -27,13 +27,14 @@
<a href="index.php"> <a href="index.php">
<img src="images/pandora_logo.png" border="0" alt="logo"></a><br> <img src="images/pandora_logo.png" border="0" alt="logo"></a><br>
<?php echo $pandora_version; ?> <?php echo $pandora_version; ?>
<td rowspan='3' width='5'>
<td class='f9b'> <td class='f9b'>
Login <br> Login <br>
<input class="login" type="text" name="nick" value="demo"> <input class="login" type="text" name="nick" value="">
</td></tr> </td></tr>
<tr><td class='f9b'> <tr><td class='f9b'>
Password <br> Password <br>
<input class="login" type="password" name="pass" value="demo"> <input class="login" type="password" name="pass" value="">
</td></tr> </td></tr>
<tr><td align='center'> <tr><td align='center'>
<input type="submit" class="sub next" value="Login"> <input type="submit" class="sub next" value="Login">

View File

@ -20,7 +20,9 @@
// This is the base config file // This is the base config file
//Pandora Version //Pandora Version
$build_version="PC070524"; //PCyymmdd if (!isset($build_version))
$build_version="PC070529";
if (!isset($pandora_version))
$pandora_version="v1.3 devel"; $pandora_version="v1.3 devel";
// Database configuration (default ones) // Database configuration (default ones)

View File

@ -6,10 +6,8 @@
// Main PHP/SQL code development and project architecture and management // Main PHP/SQL code development and project architecture and management
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com // Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
// CSS and some PHP code additions // CSS and some PHP code additions
// Copyright (c) 2006-2007 Jonathan Barajas, jonathan.barajas[AT]gmail[DOT]com // Copyright (c) 2006 Jose Navarro <jnavarro@jnavarro.net>
// Javascript Active Console code. // Additions to code for Pandora FMS 1.2 graph code
// Copyright (c) 2006 Jose Navarro <contacto@indiseg.net>
// Additions to code for Pandora FMS 1.2 graph code and new XML reporting template managemement
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es // Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
// //
// This program is free software; you can redistribute it and/or // This program is free software; you can redistribute it and/or
@ -29,6 +27,13 @@
// Pandora FMS shares much of it's code with project Babel Enterprise, also a // Pandora FMS shares much of it's code with project Babel Enterprise, also a
// FreeSoftware Project coded by some of the people who makes Pandora FMS // FreeSoftware Project coded by some of the people who makes Pandora FMS
//Pandora Version
$build_version="PC070529";
$pandora_version="v1.3 devel";
global $build_version;
global $pandora_version;
// Set to 1 to do not check for installer or config file
$develop_bypass = 1; $develop_bypass = 1;
if ($develop_bypass != 1){ if ($develop_bypass != 1){
@ -65,6 +70,8 @@ require "include/functions.php"; // Including funcions.
require "include/functions_db.php"; require "include/functions_db.php";
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>

View File

@ -21,7 +21,7 @@ $id_module = 0;
$name = "Pandora FMS combined graph"; $name = "Pandora FMS combined graph";
$width = 550; $width = 550;
$height = 210; $height = 210;
$period = ""; $period = 86401;
//$alerts= ""; //$alerts= "";
$events = ""; $events = "";
$factor = 1; $factor = 1;
@ -45,6 +45,8 @@ if (isset($_GET["store_graph"])){
$width = entrada_limpia($_POST["width"]); $width = entrada_limpia($_POST["width"]);
$height = entrada_limpia($_POST["height"]); $height = entrada_limpia($_POST["height"]);
$events = entrada_limpia($_POST["events"]); $events = entrada_limpia($_POST["events"]);
if ($events == "") // Temporal workaround
$events = 0;
$period = entrada_limpia($_POST["period"]); $period = entrada_limpia($_POST["period"]);
// Create graph // Create graph
$sql = "INSERT INTO tgraph $sql = "INSERT INTO tgraph
@ -80,7 +82,7 @@ if (isset($_GET["store_graph"])){
if (isset($_GET["get_agent"])) { if (isset($_GET["get_agent"])) {
$id_agent = $_POST["id_agent"]; $id_agent = $_POST["id_agent"];
if (isset($_POST["chunk"])) if (isset($_POST["chunk"]))
$chunkdata = isset($_POST["chunk"]); $chunkdata = $_POST["chunk"];
} }
if (isset($_GET["delete_module"] )) { if (isset($_GET["delete_module"] )) {
@ -130,7 +132,6 @@ if (isset($_GET["delete_module"] )) {
} }
} }
if ( (isset($_GET["add_module"]))){ if ( (isset($_GET["add_module"]))){
$id_agent = $_POST["id_agent"]; $id_agent = $_POST["id_agent"];
$id_module = $_POST["id_module"]; $id_module = $_POST["id_module"];
@ -160,7 +161,9 @@ if ( (isset($_GET["add_module"]))){
// Parse CHUNK information into showable information // Parse CHUNK information into showable information
// Split id to get all parameters // Split id to get all parameters
if (! isset($_GET["delete_module"])){ if (! isset($_GET["delete_module"])){
if (isset($chunkdata)) { if (isset($_POST["period"]))
$period = $_POST["period"];
if ((isset($chunkdata) )&& ($chunkdata != "")) {
$module_array = array(); $module_array = array();
$weight_array = array(); $weight_array = array();
$agent_array = array(); $agent_array = array();
@ -195,6 +198,9 @@ if (isset($chunk1)) {
echo "<input type='hidden' name='chunk' value='$chunkdata'>"; echo "<input type='hidden' name='chunk' value='$chunkdata'>";
if (isset($id_agent)) if (isset($id_agent))
echo "<input type='hidden' name='id_agent' value='$id_agent'>"; echo "<input type='hidden' name='id_agent' value='$id_agent'>";
if (isset($period))
echo "<input type='hidden' name='period' value='$period'>";
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>"; echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<tr><th>Agent<th>Module<th>Weight<th>Delete"; echo "<tr><th>Agent<th>Module<th>Weight<th>Delete";
$color=0; $color=0;
@ -242,6 +248,10 @@ if (($render == 1) && (isset($modules))) {
echo $lang_label["graph_builder"]."</h2>"; echo $lang_label["graph_builder"]."</h2>";
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>"; echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<form method='post' action='index.php?sec=reporting&sec2=operation/reporting/graph_builder&get_agent=1'>"; echo "<form method='post' action='index.php?sec=reporting&sec2=operation/reporting/graph_builder&get_agent=1'>";
if (isset($period))
echo "<input type='hidden' name='period' value='$period'>";
echo "<tr>"; echo "<tr>";
echo "<td class='datos'><b>".$lang_label["source_agent"]; echo "<td class='datos'><b>".$lang_label["source_agent"];
echo "</b>"; echo "</b>";

View File

@ -16,7 +16,7 @@ UNLOCK TABLES;
/*!40000 ALTER TABLE `tconfig` DISABLE KEYS */; /*!40000 ALTER TABLE `tconfig` DISABLE KEYS */;
LOCK TABLES `tconfig` WRITE; LOCK TABLES `tconfig` WRITE;
INSERT INTO `tconfig` VALUES (1,'language_code','en'),(3,'block_size','20'),(4,'days_purge','60'),(5,'days_compact','15'),(6,'graph_res','5'),(7,'step_compact','1'),(8,'db_scheme_version','1.3'),(9,'db_scheme_build','PD60328'),(12,'bgimage','background4.jpg'),(13,'show_unknown','0'),(14,'show_lastalerts','1'); INSERT INTO `tconfig` VALUES (1,'language_code','en'),(3,'block_size','20'),(4,'days_purge','60'),(5,'days_compact','15'),(6,'graph_res','5'),(7,'step_compact','1'),(8,'db_scheme_version','1.3'),(9,'db_scheme_build','PD60525'),(12,'bgimage','background4.jpg'),(13,'show_unknown','0'),(14,'show_lastalerts','1'),(15,'style','pandora');
UNLOCK TABLES; UNLOCK TABLES;
/*!40000 ALTER TABLE `tconfig` ENABLE KEYS */; /*!40000 ALTER TABLE `tconfig` ENABLE KEYS */;

View File

@ -87,7 +87,9 @@ class Image_Canvas_GD extends Image_Canvas_WithMap
* @var string * @var string
* @access private * @access private
*/ */
var $_antialias = 'off'; // Pandora FMS: Beware of this, could be slow on old systems
var $_antialias = 'driver';
/** /**
* Create the GD canvas. * Create the GD canvas.

View File

@ -90,6 +90,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
// Init tables // Init tables
for ($y = 0; $y < $module_number; $y++){ for ($y = 0; $y < $module_number; $y++){
$real_data[$y] = array(); $real_data[$y] = array();
$mod_data[$y] = 1; // Data multiplier to get the same scale on all modules
if ($show_event == 1) if ($show_event == 1)
$real_event[$y] = array(); $real_event[$y] = array();
if (isset($weight_list[$y])){ if (isset($weight_list[$y])){
@ -108,9 +109,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
$id_agente = dame_agente_id($nombre_agente); $id_agente = dame_agente_id($nombre_agente);
$nombre_modulo = dame_nombre_modulo_agentemodulo($id_agente_modulo); $nombre_modulo = dame_nombre_modulo_agentemodulo($id_agente_modulo);
$module_list_name[$y] = substr($nombre_agente,0,8)." - ".substr($nombre_modulo,0,8); $module_list_name[$y] = substr($nombre_agente,0,8)."/".substr($nombre_modulo,0,8);
if ($weight_list[$y] != 1)
$module_list_name[$y] .= " (x".$weight_list[$y].")";
for ($x = 0; $x <= $resolution; $x++) { for ($x = 0; $x <= $resolution; $x++) {
$valores[$x][0] = 0; // SUM of all values for this interval $valores[$x][0] = 0; // SUM of all values for this interval
$valores[$x][1] = 0; // counter $valores[$x][1] = 0; // counter
@ -195,8 +194,13 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
$valores[$x][5] = $previous; $valores[$x][5] = $previous;
} }
// Get max value for all graph // Get max value for all graph
if ($valores[$x][5] * $weight_list[$y] > $max_value ) if ($valores[$x][5] > $max_value ){
$max_value = $valores[$x][5] * $weight_list[$y]; $max_value = $valores[$x][5];
}
// This stores in mod_data max values for each module
if ($mod_data[$y] < $valores[$x][5]){
$mod_data[$y] = $valores[$x][5];
}
// Take prev. value // Take prev. value
// TODO: CHeck if there are more than 24hours between // TODO: CHeck if there are more than 24hours between
// data, if there are > 24h, module down. // data, if there are > 24h, module down.
@ -204,6 +208,12 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
} }
} }
for ($y = 0; $y < $module_number; $y++){
$weight_list[$y] = ($max_value / $mod_data[$y]) + ($weight_list[$y]-1);
if ($weight_list[$y] != 1)
$module_list_name[$y] .= " (x". format_numeric($weight_list[$y],1).")";
}
// Create graph // Create graph
// ************* // *************
$Graph =& Image_Graph::factory('graph', array($width, $height)); $Graph =& Image_Graph::factory('graph', array($width, $height));
@ -257,7 +267,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
for ($cc=0; $cc <= $resolution; $cc++) { for ($cc=0; $cc <= $resolution; $cc++) {
$tdate = date('d/m', $valores[$cc][2])."\n".date('H:i', $valores[$cc][2]); $tdate = date('d/m', $valores[$cc][2])."\n".date('H:i', $valores[$cc][2]);
for ($y = 0; $y < $module_number; $y++){ for ($y = 0; $y < $module_number; $y++){
$dataset[$y]->addPoint($tdate, $real_data[$y][$cc]); $dataset[$y]->addPoint($tdate, $real_data[$y][$cc] * $weight_list[$y]);
if (($show_event == 1) AND (isset($real_event[$cc]))) { if (($show_event == 1) AND (isset($real_event[$cc]))) {
$dataset_event->addPoint($tdate, $max_value); $dataset_event->addPoint($tdate, $max_value);
} }
@ -566,7 +576,7 @@ function grafico_modulo_sparse ( $id_agente_modulo, $periodo, $show_event,
} else { } else {
$FillArray->addColor('yellow@0.5'); $FillArray->addColor('yellow@0.5');
$FillArray->addColor('orange@0.6'); $FillArray->addColor('orange@0.6');
$FillArray->addColor('brown@0.7'); $FillArray->addColor('#e37907@0.7');
$FillArray->addColor('red@0.7'); $FillArray->addColor('red@0.7');
$FillArray->addColor('blue@0.7'); $FillArray->addColor('blue@0.7');
$FillArray->addColor('green@0.7'); $FillArray->addColor('green@0.7');