From 0b9f395ec36436831cf135cba125f11a14e1b9d3 Mon Sep 17 00:00:00 2001 From: slerena Date: Mon, 5 Oct 2009 13:14:37 +0000 Subject: [PATCH] 2009-10-05 Sancho Lerena * include/fgraph.php: Solved ticks in X label for boolean graphs. * operation/agentes/datos_agente.php: Show absolute timestamp and data with format_numeric() filter. * operation/agentes/estado_monitores.php: Solved typo. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1999 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 10 ++++++++++ pandora_console/include/fgraph.php | 13 +++++-------- pandora_console/operation/agentes/datos_agente.php | 9 +++++++-- .../operation/agentes/estado_monitores.php | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 682a8ad276..e2a7624610 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,13 @@ +2009-10-05 Sancho Lerena + + * include/fgraph.php: Solved ticks in X label for boolean graphs. + + * operation/agentes/datos_agente.php: Show absolute timestamp and + data with format_numeric() filter. + + * operation/agentes/estado_monitores.php: Solved typo. + + 2009-10-01 Miguel de Dios * pandora_console/godmode/reporting/reporting_builder.php: change the diff --git a/pandora_console/include/fgraph.php b/pandora_console/include/fgraph.php index 9dae6da753..cfded59fbc 100644 --- a/pandora_console/include/fgraph.php +++ b/pandora_console/include/fgraph.php @@ -1399,12 +1399,8 @@ function grafico_modulo_boolean ($id_agente_modulo, $period, $show_event, $engine->fontpath = $config['fontpath']; $engine->alert_top = $show_alert ? $alert_high : false; $engine->alert_bottom = $show_alert ? $alert_low : false;; - - if ($period < 10000) - $engine->xaxis_interval = 20; - else - $engine->xaxis_interval = $resolution * 4; - $engine->yaxis_interval = 1; + + $engine->xaxis_interval = $resolution/10; // Fixed to 10 ticks $engine->xaxis_format = 'date'; $engine->single_graph (); @@ -1577,10 +1573,11 @@ if ($graphic_type) { switch ($graphic_type) { case 'sparse': grafico_modulo_sparse ($id, $period, $draw_events, $width, $height, - $label, $unit_name, $draw_alerts, $avg_only, $pure, $date); + $label, $unit_name, $draw_alerts, $avg_only, $pure, $date); break; case "boolean": - grafico_modulo_boolean ($id, $period, $draw_events, $width, $height , $label, $unit_name, $draw_alerts, 1, $pure, $date); + grafico_modulo_boolean ($id, $period, $draw_events, $width, $height , + $label, $unit_name, $draw_alerts, 1, $pure, $date); break; case "estado_incidente": diff --git a/pandora_console/operation/agentes/datos_agente.php b/pandora_console/operation/agentes/datos_agente.php index ed4436c37b..55ad547624 100644 --- a/pandora_console/operation/agentes/datos_agente.php +++ b/pandora_console/operation/agentes/datos_agente.php @@ -85,9 +85,14 @@ foreach ($result as $row) { } else { $data[0] = ''; } - $data[1] = print_timestamp ($row["utimestamp"], true); + + // This returns data with absolute user-defined timestamp format + // and numeric by data managed with 2 decimals, and not using Graph format + // (replacing 1000 by K and 1000000 by G, like version 2.x + + $data[1] = date ($config["date_format"], $row["utimestamp"]); if (is_numeric ($row["datos"])) { - $data[2] = $row["datos"]; + $data[2] = format_numeric($row["datos"],2); } else { $data[2] = safe_input ($row["datos"]); } diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 9a0e26e336..55e27dba6b 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -126,7 +126,7 @@ foreach ($modules as $module) { $salida = "".substr(salida_limpia($module["datos"]),0,12).""; } - $data[5] .= $salida; + $data[5] = $salida; $graph_type = return_graphtype ($module["id_tipo_modulo"]); if ($module['history_data'] == 1){ $nombre_tipo_modulo = get_moduletype_name ($module["id_tipo_modulo"]);