2010-04-28 Sancho Lerena <slerena@artica.es>

* include/pChart/pChart.class:

    * include/pChart/pData.class

    * include/fgraph.php: Fixed bug with eventgraph in graph_event_module().

    * include/functions.php: return_graphtype() uses now the log4x id 24 in
    ttipo_modulo, fixing the problem in graph visualizer. Anyway, log4x graphs
    doesn't work on php >= 5.3.x :((

    * operation/agentes/estado_monitores.php: Fixed id (24) for link in log4x.

    * operation/agentes/stat_win.php: Included missing functions_reporting.php
    include, it was missing.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2621 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-04-28 09:10:23 +00:00
parent d6f7244a89
commit 6b2821da3c
7 changed files with 39 additions and 6 deletions

View File

@ -1,3 +1,20 @@
2010-04-28 Sancho Lerena <slerena@artica.es>
* include/pChart/pChart.class:
* include/pChart/pData.class
* include/fgraph.php: Fixed bug with eventgraph in graph_event_module().
* include/functions.php: return_graphtype() uses now the log4x id 24 in
ttipo_modulo, fixing the problem in graph visualizer. Anyway, log4x graphs
doesn't work on php >= 5.3.x :((
* operation/agentes/estado_monitores.php: Fixed id (24) for link in log4x.
* operation/agentes/stat_win.php: Included missing functions_reporting.php
include, it was missing.
2010-04-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_html.php: Added at print_checkbox

View File

@ -888,7 +888,7 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
$data = array ();
$max_items = 6;
$sql = sprintf ('SELECT COUNT(id_evento),nombre
$sql = sprintf ('SELECT COUNT(id_evento) as count_number, nombre
FROM tevento, tagente_modulo
WHERE id_agentmodule = id_agente_modulo
AND disabled = 0 AND tevento.id_agente = %d
@ -901,8 +901,10 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
graphic_error ();
return;
}
foreach ($events as $event) {
$data[$event['nombre'].' ('.$event[0].')'] = $event[0];
$data[$event['nombre'].' ('.$event['count_number'].')'] = $event["count_number"];
}
/* System events */
@ -1756,7 +1758,7 @@ function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
$max_count = max($max_count, $valores[$severity][$index]['count']);
$min_count = min($min_count, $valores[$severity][$index]['count']);
}
}
grafico_modulo_log4x_trace("$rows rows");

View File

@ -1005,7 +1005,7 @@ function return_graphtype ($id_module_type){
case 9:
return "boolean";
break;
case 30:
case 24:
return "log4x";
break;
}

View File

@ -2707,6 +2707,11 @@
$SpliceDistanceRatio = $SpliceDistance;
$SkewHeight = ($Radius * $Skew) / 100;
// Avoid division by zero
if ($PieSum == 0)
$PieSum = 1;
$SpliceRatio = (360 - $SpliceDistanceRatio * count($iValues) ) / $PieSum;
$SplicePercent = 100 / $PieSum;
$rSplicePercent = 100 / $rPieSum;
@ -2793,6 +2798,8 @@
if ( $EnhanceColors ) { $ColorRatio = 30 / $SpliceHeight; } else { $ColorRatio = 25 / $SpliceHeight; }
for($i=$SpliceHeight-1;$i>=1;$i--)
{
if (!isset($iValues))
$iValues = array();
foreach($iValues as $Key => $Value)
{
$C_GraphLo = $this->AllocateColor($this->Picture,$this->Palette[$Key]["R"],$this->Palette[$Key]["G"],$this->Palette[$Key]["B"],-10);

View File

@ -124,7 +124,13 @@
$ID = 0;
for($i=0;$i<=count($this->Data);$i++)
{ if(isset($this->Data[$i][$Serie])) { $ID = $i+1; } }
{
if (isset($this->Data[$i]))
if(isset($this->Data[$i][$Serie]))
{
$ID = $i+1;
}
}
if ( count($Value) == 1 )
{

View File

@ -119,7 +119,7 @@ foreach ($modules as $module) {
$data[4] = print_status_image($status, $title, true);
if ($module["id_tipo_modulo"] == 30) { // log4x
if ($module["id_tipo_modulo"] == 24) { // log4x
switch($module["datos"]) {
case 10: $salida = "TRACE"; $style="font-weight:bold; color:darkgreen;"; break;
case 20: $salida = "DEBUG"; $style="font-weight:bold; color:darkgreen;"; break;

View File

@ -30,6 +30,7 @@ if (! isset($_SESSION["id_user"])) {
require_once ($config["homedir"] . '/include/functions.php');
require_once ($config["homedir"] . '/include/functions_db.php');
require_once ($config["homedir"] . '/include/functions_reporting.php');
require_once ($config["homedir"] . '/include/fgraph.php');
check_login ();