2011-07-19 Sergio Martin <sergio.martin@artica.es>

* include/functions_graph.php
	include/graphs/functions_fsgraph.php
	include/graphs/fgraph.php
	include/functions_reporting.php
	include/pandora_graph.php
	include/functions_visual_map.php
	include/ajax/visual_console_builder.ajax.php
	include/config_process.php
	include/functions_custom_graphs.php
	include/fgraph.php
	include/functions_fsgraph.php
	operation/incidents/incident_statistics.php
	operation/agentes/estado_generalagente.php
	operation/agentes/graphs.php
	operation/agentes/tactical.php
	operation/agentes/stat_win.php
	operation/servers/view_server.php
	operation/servers/view_server_detail.php
	operation/integria_incidents/incident_statistics.php
	operation/events/event_statistics.php
	operation/events/events_list.php
	operation/reporting/reporting_xml.php
	mobile/operation/agents/view_agents.php
	mobile/operation/agents/tactical.php
	general/logon_ok.php
	godmode/admin_access_logs.php
	godmode/db/db_info.php
	godmode/db/db_purge.php
	godmode/reporting/graph_builder.preview.php: Delete old graphic engine
	functions and rename the new ones to the final name (delete '2' suffix)



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4585 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-07-19 09:28:09 +00:00
parent 7890cc829e
commit cdad39bd94
30 changed files with 171 additions and 3252 deletions

View File

@ -1,3 +1,36 @@
2011-07-19 Sergio Martin <sergio.martin@artica.es>
* include/functions_graph.php
include/graphs/functions_fsgraph.php
include/graphs/fgraph.php
include/functions_reporting.php
include/pandora_graph.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/config_process.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_fsgraph.php
operation/incidents/incident_statistics.php
operation/agentes/estado_generalagente.php
operation/agentes/graphs.php
operation/agentes/tactical.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_list.php
operation/reporting/reporting_xml.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
general/logon_ok.php
godmode/admin_access_logs.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/reporting/graph_builder.preview.php: Delete old graphic engine
functions and rename the new ones to the final name (delete '2' suffix)
2011-07-18 Sergio Martin <sergio.martin@artica.es>
* godmode/massive/massive_operations.php: Fixed acl last fix

View File

@ -78,13 +78,13 @@ $table->width = "100%";
$table->data[0][0] ='<b>'.__('Monitor health').'</b>';
$table->data[1][0] =
progress_bar2($data["monitor_health"], 280, 20, $data["monitor_health"].'% '.__('of monitors up'), 0);
progress_bar($data["monitor_health"], 280, 20, $data["monitor_health"].'% '.__('of monitors up'), 0);
$table->data[2][0] = '<b>'.__('Module sanity').'</b>';
$table->data[3][0] =
progress_bar2($data["module_sanity"], 280, 20, $data["module_sanity"].'% '.__('of total modules inited'), 0);
progress_bar($data["module_sanity"], 280, 20, $data["module_sanity"].'% '.__('of total modules inited'), 0);
$table->data[4][0] = '<b>'.__('Alert level').'</b>';
$table->data[5][0] =
progress_bar2($data["alert_level"], 280, 20, $data["alert_level"].'% '.__('of defined alerts not fired'), 0);
progress_bar($data["alert_level"], 280, 20, $data["alert_level"].'% '.__('of defined alerts not fired'), 0);
html_print_table ($table);
unset ($table);

View File

@ -78,7 +78,7 @@ echo '</form>';
echo '</div>';
echo '<div style="float: right; width: 300px;">';
echo graphic_user_activity2(300, 140);
echo graphic_user_activity(300, 140);
echo '</div>';
echo '<div style="clear:both;">&nbsp;</div>';

View File

@ -18,10 +18,9 @@
// Load global vars
global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once($config['homedir'] . "/include/functions_agents.php");
require_once($config['homedir'] . "/include/functions_modules.php");
require_once($config['homedir'] . "/include/functions_fsgraph.php");
require_once ($config['homedir'] . '/include/functions_graph.php');
require_once($config['homedir'] . '/include/functions_agents.php');
require_once($config['homedir'] . '/include/functions_modules.php');
ui_print_page_header (__('Database maintenance').' &raquo; '.__('Database information'), "images/god8.png", false, "", true);
@ -43,7 +42,7 @@ if (! check_acl ($config['id_user'], 0, "DM")) {
- A more powerful selection (by Agent, by Module, etc).
*/
echo grafico_db_agentes_purge2(0, 600, 400);
echo grafico_db_agentes_purge(0, 600, 400);
echo '<div id="db_info_graph">';
echo '<table border=0 width="98%">';
@ -56,7 +55,7 @@ echo '</td></tr><tr><td><br /></tr></td>';
echo '<tr><td>';
echo '<h4>'.__('Packets per agent').'</h4>';
echo grafico_db_agentes_paquetes2(700, 300);
echo grafico_db_agentes_paquetes(700, 300);
echo '</table>';
echo '<a href="#" onClick="toggleDiv(\'db_info_data\'); toggleDiv(\'db_info_graph\'); return false;"><b>'.__('Press here to get database information as text').'</b>&nbsp;' . html_print_image("images/down.png", true, array("alt" => "down", "title" => "down")) . '</a></div>';

View File

@ -36,7 +36,7 @@ $id_agent = (int) get_parameter_post ("agent", -1);
ui_print_page_header (__('Database maintenance').' &raquo; '.__('Database purge'), "images/god8.png", false, "", true);
echo grafico_db_agentes_purge2($id_agent);
echo grafico_db_agentes_purge($id_agent);
echo '<br /><br />';
echo '<h4>'.__('Get data from agent').'</h4>';

View File

@ -139,7 +139,7 @@ echo "<tr><td>";
if(!empty($modules)) {
require_once ($config["homedir"] . '/include/functions_graph.php');
echo graphic_combined_module2(explode (',', $modules), explode (',', $weights), $period, $width, $height,
echo graphic_combined_module(explode (',', $modules), explode (',', $weights), $period, $width, $height,
'Combined%20Sample%20Graph', '', $events, 0, 0, $stacked, $unixdate);
}
else {

View File

@ -69,7 +69,7 @@ switch ($action) {
echo json_encode($return);
break;
case 'get_image_sparse':
$img = grafico_modulo_sparse2($id_agent_module,
$img = grafico_modulo_sparse($id_agent_module,
$period, false, $width, $height, '', null, false, 0, false, 0, '', 0, 0,
true, true);

View File

@ -28,6 +28,8 @@ $pandora_version = 'v4.0dev';
/* Help to debug problems. Override global PHP configuration */
if (!isset($develop_bypass)) $develop_bypass = 0;
$develop_bypass = 1;
if ($develop_bypass != 1) {
// error_reporting(E_ALL);
@ -156,7 +158,6 @@ db_connect();
// Function include_graphs_dependencies() it's called in the code below
require_once("include_graph_dependencies.php");
//require_once("include/fgraph.php");
include_graphs_dependencies($config['homedir'].'/');
?>

File diff suppressed because it is too large Load Diff

View File

@ -24,11 +24,8 @@
* @global array Contents all var configs for the local instalation.
*/
global $config;
if ($config['flash_charts']) {
require_once ('include/fgraph.php');
}
require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config['homedir'] . '/include/functions_graph.php');
require_once ($config['homedir'] . '/include/functions_users.php');
/**
@ -110,7 +107,7 @@ function custom_graphs_print ($id_graph, $height, $width, $period, $stacked, $re
array_push ($weights, $source['weight']);
}
$output = graphic_combined_module2($modules, $weights, $period, $width, $height,
$output = graphic_combined_module($modules, $weights, $period, $width, $height,
'', '', 0, 0, 0, $stacked, $date);
if ($return)

View File

@ -1,370 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2011 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/**
* @package Include
* @subpackage Graphs
*/
/**
* Include the FusionCharts class
*/
if (!class_exists("FusionCharts")) {
require_once ('FusionCharts/FusionCharts_Gen.php');
}
// Returns the code needed to display the chart
function get_chart_code ($chart, $width, $height, $swf) {
$random_number = rand ();
$div_id = 'chart_div_' . $random_number;
$chart_id = 'chart_' . $random_number;
$output = '<div id="' . $div_id. '"></div>';
$output .= '<script type="text/javascript">
<!--
$(document).ready(function pie_' . $chart_id . ' () {
var myChart = new FusionCharts("' . $swf . '", "' . $chart_id . '", "' . $width. '", "' . $height. '", "0", "1");
myChart.setDataXML("' . addslashes($chart->getXML ()) . '");
myChart.addParam("WMode", "Transparent");
myChart.render("' . $div_id . '");
})
-->
</script>';
return $output;
}
// Returns a 3D bar chart
function fs_3d_bar_chart ($data, $width, $height) {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image ();
}
// Generate the XML
$chart = new FusionCharts('Column3D', $width, $height);
$empty = 1;
foreach ($data as $name => $value) {
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string($name) . ';color=95BB04');
}
$chart->setChartParams('showNames=1;rotateNames=1;showValues=0;showPercentageValues=0;showLimits=0;baseFontSize=9;' . ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
// Return the code
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_Column3D.swf');
}
// Returns a 3D pie chart
function fs_3d_pie_chart ($data, $width, $height) {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image ();
}
// Generate the XML
$chart = new FusionCharts('Pie3D', $width, $height);
$chart->setChartParams('showNames=1;showValues=0;showPercentageValues=0;baseFontSize=9');
$empty = 1;
foreach ($data as $name => $value) {
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string($name));
}
// Chart is not empty, but all elements are 0
if ($empty == 1) {
return fs_error_image ();
}
// Return the code
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_Pie3D.swf');
}
// Returns a 2D area chart
function fs_2d_area_chart ($data, $width, $height, $step = 1, $params = '') {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image ();
}
// Generate the XML
$chart = new FusionCharts('Area2D', $width, $height);
$count = 0;
$num_vlines = 0;
$empty = 1;
foreach ($data as $name => $value) {
if ($count++ % $step == 0) {
$show_name = '1';
$num_vlines++;
} else {
$show_name = '0';
}
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string($name) . ';showName=' . $show_name . ';color=95BB04');
}
$chart->setChartParams('numVDivLines=' . $num_vlines . ';showAlternateVGridColor=1;showNames=1;rotateNames=1;showValues=0;baseFontSize=9;showLimits=0;showAreaBorder=1;areaBorderThickness=1;areaBorderColor=000000' . ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : '') . $params);
// Return the code
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_Area2D.swf');
}
// Returns a Pandora FMS module chart
function fs_module_chart ($data, $width, $height, $avg_only = 1, $step = 10, $time_format = 'G:i', $show_events = 0, $show_alerts = 0, $caption = '', $baseline = 0) {
global $config;
$graph_type = "MSArea2D"; //MSLine is possible also
// Generate the XML
$chart = new FusionCharts($graph_type, $width, $height);
$num_vlines = 0;
$count = 0;
// NO caption needed (graph avg/max/min stats are in the legend now)
/*
if ($caption != '') {
$chart->setChartParam("caption", $caption);
}
*/
$total_max = 0;
$total_avg = 0;
$total_min = 0;
// Create categories
foreach ($data as $value) {
$total_avg +=$value["sum"];
if ($avg_only != 1){
if ($value["max"] > $total_max)
$total_max =$value["max"];
if ($value["min"] < $total_min)
$total_min =$value["min"];
}
if ($count++ % $step == 0) {
$show_name = '1';
$num_vlines++;
} else {
$show_name = '0';
}
$chart->addCategory(date($time_format, $value['timestamp_bottom']), 'hoverText=' . date (html_entity_decode ($config['date_format'], ENT_QUOTES, "UTF-8"), $value['timestamp_bottom']) . ';showName=' . $show_name);
}
if ($count > 0)
$total_avg = format_for_graph($total_avg / $count);
else
$total_avg = 0;
$total_min = format_for_graph ($total_min);
$total_max = format_for_graph ($total_max);
// Event chart
if ($show_events == 1) {
$chart->addDataSet(__('Events'), 'alpha=50;showAreaBorder=1;areaBorderColor=#ff7f00;color=#ff7f00');
foreach ($data as $value) {
$chart->addChartData($value['event']);
}
}
// Alert chart
if ($show_alerts == 1) {
$chart->addDataSet(__('Alerts'), 'alpha=50;showAreaBorder=1;areaBorderColor=#ff0000;color=#ff0000');
foreach ($data as $value) {
$chart->addChartData($value['alert']);
}
}
// Max chart
if ($avg_only == 0) {
$chart->addDataSet(__('Max')." ($total_max)", 'color=' . $config['graph_color3']);
foreach ($data as $value) {
$chart->addChartData($value['max']);
}
}
// Avg chart
$empty = 1;
$chart->addDataSet(__('Avg'). " ($total_avg)", 'color=' . $config['graph_color2']);
foreach ($data as $value) {
if ($value['sum'] > 0) {
$empty = 0;
}
$chart->addChartData($value['sum']);
}
// Min chart
if ($avg_only == 0) {
$chart->addDataSet(__('Min'). " ($total_min)", 'color=' . $config['graph_color1']);
foreach ($data as $value) {
$chart->addChartData($value['min']);
}
}
// Baseline chart
if ($baseline == 1) {
$chart->addDataSet(__('Baseline'), 'color=0097BD;alpha=10;showAreaBorder=0;');
foreach ($data as $value) {
$chart->addChartData($value['baseline']);
}
}
$chart->setChartParams('animation=0;numVDivLines=' . $num_vlines . ';showShadow=0;showAlternateVGridColor=1;showNames=1;rotateNames=1;lineThickness=0.1;anchorRadius=0.5;showValues=0;baseFontSize=9;showLimits=0;showAreaBorder=1;areaBorderThickness=0.1;areaBorderColor=000000' . ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
$random_number = rand ();
$div_id = 'chart_div_' . $random_number;
$chart_id = 'chart_' . $random_number;
$output = '<div id="' . $div_id. '" style="z-index:1;"></div>';
$pre_url = ($config["homeurl"] == "/") ? '' : $config["homeurl"];
$output .= '<script language="JavaScript" src="' . $pre_url . '/include/FusionCharts/FusionCharts.js"></script>';
$output .= '<script type="text/javascript">
<!--
function pie_' . $chart_id . ' () {
var myChart = new FusionCharts("' . $pre_url . '/include/FusionCharts/FCF_'.$graph_type.'.swf", "' . $chart_id . '", "' . $width. '", "' . $height. '", "0", "1");
myChart.setDataXML("' . addslashes($chart->getXML ()) . '");
myChart.addParam("WMode", "Transparent");
myChart.render("' . $div_id . '");
}
pie_' . $chart_id . ' ();
-->
</script>';
return $output;
}
// Returns a Pandora FMS combined chart
function fs_combined_chart ($data, $categories, $sets, $width, $height, $type = 1, $step = 10, $time_format = 'G:i') {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image ();
}
// Generate the XML
switch ($type) {
case 0: $chart_type = 'MSArea2D';
break;
case 1: $chart_type = 'StackedArea2D';
break;
case 2: $chart_type = 'MSLine';
break;
case 3: $chart_type = 'MSLine';
break;
default: $chart_type = 'StackedArea2D';
}
$chart = new FusionCharts($chart_type, $width, $height);
// Create categories
$count = 0;
$num_vlines = 0;
foreach ($categories as $category) {
if ($count++ % $step == 0) {
$show_name = '1';
$num_vlines++;
} else {
$show_name = '0';
}
$chart->addCategory(date($time_format, $category['timestamp_bottom']), 'hoverText=' . date (html_entity_decode ($config['date_format'], ENT_QUOTES, "UTF-8"), $category['timestamp_bottom']) . ';showName=' . $show_name);
}
// Stack charts
$empty = 1;
$prev = array();
for ($i = 0; $i < sizeof ($data); $i++) {
$chart->addDataSet ($sets[$i]);
foreach ($data[$i] as $indice => $value) {
// Custom code to do the stack lines, because library doesn't do itself
if ($type == 3){
if ($i > 0){
$prev[$indice] = $prev[$indice] + $value;
} else {
$prev[$indice] = $value;
}
$myvalue = $prev[$indice];
$chart->addChartData($myvalue);
} else {
$chart->addChartData($value);
}
}
}
$chart->setChartParams('legendAllowDrag=1;legendMarkerCircle=1;animation=0;numVDivLines=' . $num_vlines . ';showShadow=0; showAlternateVGridColor=1;showNames=1;lineThickness=2;anchorRadius=0.7;rotateNames=1;divLineAlpha=30;showValues=0;baseFontSize=9;showLimits=0;showAreaBorder=1;showPlotBorder=1;plotBorderThickness=0;areaBorderThickness=0;areaBorderColor=000000' . ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
// Return the code
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_' . $chart_type . '.swf');
}
// Returns a Pandora FMS agent event chart
function fs_agent_event_chart ($data, $width, $height, $step = 1) {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image ();
}
// Generate the XML
$chart = new FusionCharts('Area2D', $width, $height);
$count = 0;
$num_vlines = 0;
foreach ($data as $name => $value) {
if ($count++ % $step == 0) {
$show_name = '1';
$num_vlines++;
} else {
$show_name = '0';
}
$chart->addChartData(1, 'name=' . clean_flash_string($name) . ';showName=' . $show_name . ';color=' . $value);
}
$chart->setChartParams('numDivLines=0;numVDivLines=0;showNames=1;rotateNames=0;showValues=0;baseFontSize=9;showLimits=0;showAreaBorder=0;areaBorderThickness=1;canvasBgColor=9ABD18');
// Return the code
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_Area2D.swf');
}
// Clean FLASH string strips non-valid characters for flashchart
function clean_flash_string ($string) {
$string = html_entity_decode ($string, ENT_QUOTES, "UTF-8");
$string = str_replace('&', '', $string);
$string = str_replace(' ', '', $string);
$string = str_replace ('"', '', $string);
return substr ($string, 0, 20);
}
// Prints an error image
function fs_error_image () {
global $config;
return html_print_image("images/image_problem.png", true, array("border" => '0'));
}
?>

View File

@ -25,7 +25,7 @@ define("GRAPH_STACKED_AREA", 1);
define("GRAPH_LINE", 2);
define("GRAPH_STACKED_LINE", 3);
function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
$width, $height , $title = '', $unit_name = null,
$show_alerts = false, $avg_only = 0, $pure = false,
$date = 0, $unit = '', $baseline = 0, $return_data = 0, $show_title = true,
@ -106,7 +106,7 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
// Check available data
if (count ($data) < $min_necessary) {
if (!$graphic_type) {
return fs_error_image2 ();
return fs_error_image ();
}
graphic_error ();
}
@ -333,7 +333,7 @@ function grafico_modulo_sparse2 ($agent_module_id, $period, $show_events,
*
* @return Mixed
*/
function graphic_combined_module2 ($module_list, $weight_list, $period, $width, $height,
function graphic_combined_module ($module_list, $weight_list, $period, $width, $height,
$title, $unit_name, $show_events = 0, $show_alerts = 0, $pure = 0,
$stacked = 0, $date = 0, $only_image = false, $homeurl = '', $ttl = 1) {
global $config;
@ -685,7 +685,7 @@ function graphic_combined_module2 ($module_list, $weight_list, $period, $width,
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_agentaccess2 ($id_agent, $width, $height, $period = 0) {
function graphic_agentaccess ($id_agent, $width, $height, $period = 0) {
global $config;
global $graphic_type;
@ -743,7 +743,7 @@ function graphic_agentaccess2 ($id_agent, $width, $height, $period = 0) {
* @param integer height pie graph height
* @param integer id_agent Agent ID
*/
function graph_event_module2 ($width = 300, $height = 200, $id_agent) {
function graph_event_module ($width = 300, $height = 200, $id_agent) {
global $config;
global $graphic_type;
@ -770,7 +770,7 @@ function graph_event_module2 ($width = 300, $height = 200, $id_agent) {
$events = db_get_all_rows_sql ($sql);
if ($events === false) {
if (! $graphic_type) {
return fs_error_image2 ();
return fs_error_image ();
}
graphic_error ();
return;
@ -794,7 +794,7 @@ function graph_event_module2 ($width = 300, $height = 200, $id_agent) {
$config['fontpath'], $config['font_size']);
}
function progress_bar2($progress, $width, $height, $title = '', $mode = 1) {
function progress_bar($progress, $width, $height, $title = '', $mode = 1) {
global $config;
$out_of_lim_str = __("Out of limits");
@ -825,7 +825,7 @@ function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek
* @param integer width pie graph width
* @param integer height pie graph height
*/
function grafico_db_agentes_purge2 ($id_agent, $width, $height) {
function grafico_db_agentes_purge ($id_agent, $width, $height) {
global $config;
global $graphic_type;
@ -886,7 +886,7 @@ function grafico_db_agentes_purge2 ($id_agent, $width, $height) {
* @param integer width pie graph width
* @param integer height pie graph height
*/
function grafico_db_agentes_paquetes2($width = 380, $height = 300) {
function grafico_db_agentes_paquetes($width = 380, $height = 300) {
global $config;
global $graphic_type;
@ -970,7 +970,7 @@ function graph_db_agentes_modulos2($width, $height) {
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_user_activity2 ($width = 350, $height = 230) {
function graphic_user_activity ($width = 350, $height = 230) {
global $config;
global $graphic_type;
@ -1009,7 +1009,7 @@ function graphic_user_activity2 ($width = 350, $height = 230) {
/**
* Print a pie graph with priodity incident
*/
function grafico_incidente_prioridad2 () {
function grafico_incidente_prioridad () {
global $config;
global $graphic_type;
@ -1044,7 +1044,7 @@ function grafico_incidente_prioridad2 () {
/**
* Print a pie graph with incidents data
*/
function graph_incidents_status2 () {
function graph_incidents_status () {
global $config;
global $graphic_type;
$data = array (0, 0, 0, 0);
@ -1079,7 +1079,7 @@ function graph_incidents_status2 () {
/**
* Print a pie graph with incident data by group
*/
function graphic_incident_group2 () {
function graphic_incident_group () {
global $config;
global $graphic_type;
@ -1112,7 +1112,7 @@ function graphic_incident_group2 () {
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_incident_user2 () {
function graphic_incident_user () {
global $config;
global $graphic_type;
@ -1149,7 +1149,7 @@ function graphic_incident_user2 () {
* @param integer width pie graph width
* @param integer height pie graph height
*/
function graphic_incident_source2($width = 320, $height = 200) {
function graphic_incident_source($width = 320, $height = 200) {
global $config;
global $graphic_type;
@ -1194,7 +1194,7 @@ function graphic_incident_source2($width = 320, $height = 200) {
* @param integer height pie graph height
* @param string url
*/
function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") {
function grafico_eventos_grupo ($width = 300, $height = 200, $url = "") {
global $config;
global $graphic_type;
@ -1260,7 +1260,7 @@ function grafico_eventos_grupo2 ($width = 300, $height = 200, $url = "") {
*
* @param string filter Filter for query in DB
*/
function grafico_eventos_total2($filter = "") {
function grafico_eventos_total($filter = "") {
global $config;
global $graphic_type;
@ -1297,7 +1297,7 @@ function grafico_eventos_total2($filter = "") {
* @param integer height pie graph height
* @param integer period time period
*/
function grafico_eventos_usuario2 ($width, $height) {
function grafico_eventos_usuario ($width, $height) {
global $config;
global $graphic_type;
@ -1337,7 +1337,7 @@ function grafico_eventos_usuario2 ($width, $height) {
* @param integer width graph width
* @param integer Graph type 1 vbar, 2 hbar, 3 pie
*/
function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '', $ttl = 1) {
function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar', $only_image = false, $homeurl = '', $ttl = 1) {
global $config;
$report_content = db_get_row ('treport_content', 'id_rc', $id);
@ -1407,7 +1407,7 @@ function graph_custom_sql_graph2 ($id, $width, $height, $type = 'sql_graph_vbar'
* @param integer height pie graph height
* @param integer period time period
*/
function graphic_agentevents2 ($id_agent, $width, $height, $period = 0) {
function graphic_agentevents ($id_agent, $width, $height, $period = 0) {
global $config;
global $graphic_type;
@ -1450,12 +1450,12 @@ function graphic_agentevents2 ($id_agent, $width, $height, $period = 0) {
}
if (! $graphic_type) {
return fs_agent_event_chart2 ($data, $width, $height, $resolution / 750);
return fs_agent_event_chart ($data, $width, $height, $resolution / 750);
}
}
// Clean FLASH string strips non-valid characters for flashchart
function clean_flash_string2 ($string) {
function clean_flash_string ($string) {
$string = html_entity_decode ($string, ENT_QUOTES, "UTF-8");
$string = str_replace('&', '', $string);
$string = str_replace(' ', '', $string);
@ -1464,11 +1464,11 @@ function clean_flash_string2 ($string) {
}
// Returns a Pandora FMS agent event chart
function fs_agent_event_chart2 ($data, $width, $height, $step = 1) {
function fs_agent_event_chart ($data, $width, $height, $step = 1) {
global $config;
if (sizeof ($data) == 0) {
return fs_error_image2 ();
return fs_error_image ();
}
// Generate the XML
@ -1483,24 +1483,24 @@ function fs_agent_event_chart2 ($data, $width, $height, $step = 1) {
} else {
$show_name = '0';
}
$chart->addChartData(1, 'name=' . clean_flash_string2($name) . ';showName=' . $show_name . ';color=' . $value);
$chart->addChartData(1, 'name=' . clean_flash_string($name) . ';showName=' . $show_name . ';color=' . $value);
}
$chart->setChartParams('numDivLines=0;numVDivLines=0;showNames=1;rotateNames=0;showValues=0;baseFontSize=9;showLimits=0;showAreaBorder=0;areaBorderThickness=1;canvasBgColor=9ABD18');
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/FusionCharts/FCF_Area2D.swf');
return get_chart_code ($chart, $width, $height, 'include/FusionCharts/FCF_Area2D.swf');
}
// Prints an error image
function fs_error_image2 () {
function fs_error_image () {
global $config;
return html_print_image("images/image_problem.png", true, array("border" => '0'));
}
function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events,
function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
$date = 0, $only_image = false, $homeurl = '') {
global $config;
@ -1578,7 +1578,7 @@ function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events,
// Check available data
if (count ($data) < $min_necessary) {
if (!$graphic_type) {
return fs_error_image2 ();
return fs_error_image ();
}
graphic_error ();
}
@ -1814,7 +1814,7 @@ function grafico_modulo_boolean2 ($agent_module_id, $period, $show_events,
* @param integer pure Fullscreen (1 or 0)
* @param integer date date
*/
function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
function grafico_modulo_string ($agent_module_id, $period, $show_events,
$width, $height , $title, $unit_name, $show_alerts, $avg_only = 0, $pure=0,
$date = 0, $only_image = false, $homeurl = '') {
global $config;
@ -1892,7 +1892,7 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
// Check available data
if (count ($data) < $min_necessary) {
if (!$graphic_type) {
return fs_error_image2 ();
return fs_error_image ();
}
graphic_error ();
}
@ -2033,12 +2033,12 @@ function grafico_modulo_string2 ($agent_module_id, $period, $show_events,
$config['fontpath'], $config['font_size'], "");
}
function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
function grafico_modulo_log4x ($id_agente_modulo, $periodo, $show_event,
$width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure=0,
$date = 0)
{
grafico_modulo_log4x_trace2("<pre style='text-align:left;'>");
grafico_modulo_log4x_trace("<pre style='text-align:left;'>");
if ($date == "")
$now = time ();
@ -2073,7 +2073,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$num_slices = $periodo / $adjust_time;
$fechatope_index = grafico_modulo_log4x_index2($fechatope, $adjust_time);
$fechatope_index = grafico_modulo_log4x_index($fechatope, $adjust_time);
$sql1="SELECT utimestamp, SEVERITY " .
" FROM tagente_datos_log4x " .
@ -2084,7 +2084,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$max_count = -1;
$min_count = 9999999;
grafico_modulo_log4x_trace2("$sql1");
grafico_modulo_log4x_trace("$sql1");
$rows = 0;
@ -2100,7 +2100,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
if (!isset($valores[$severity]))
$valores[$severity] = array();
$dest = grafico_modulo_log4x_index2($utimestamp, $adjust_time);
$dest = grafico_modulo_log4x_index($utimestamp, $adjust_time);
$index = (($dest - $fechatope_index) / $adjust_time) - 1;
@ -2117,25 +2117,25 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$min_count = min($min_count, $valores[$severity][$index]['count']);
}
grafico_modulo_log4x_trace2("$rows rows");
grafico_modulo_log4x_trace("$rows rows");
// Create graph
// *************
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
//set_error_handler("myErrorHandler");
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
set_include_path(get_include_path() . PATH_SEPARATOR . getcwd() . "/../../include");
require_once 'Image/Graph.php';
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
$Graph =& Image_Graph::factory('graph', array($width, $height));
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
@ -2169,7 +2169,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$title_period = html_entity_decode($title_period);
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
if ($pure == 0){
$Graph->add(
@ -2199,7 +2199,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$Graph->add($Plotarea = Image_Graph::factory('plotarea', array('Image_Graph_Axis', 'Image_Graph_Axis')));
}
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
$dataset = array();
@ -2224,7 +2224,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$x = 100.0 * ($pivot - $fechatope) / ($now - $fechatope);
if ($x > 100) $x = 100;
$size = grafico_modulo_log4x_bubble_size2($count, $max_count, $max_bubble_radius);
$size = grafico_modulo_log4x_bubble_size($count, $max_count, $max_bubble_radius);
// pivot is the value in the X axis
// y is the number of steps (from the bottom of the graphics) (zero based)
@ -2244,14 +2244,14 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$i++;
}
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
// create the 1st plot as smoothed area chart using the 1st dataset
$Plot =& $Plotarea->addNew('bubble', array(&$dataset));
$Plot->setFont($Font);
$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
$AxisX->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', 'grafico_modulo_log4x_format_x_axis2'));
$AxisX->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', 'grafico_modulo_log4x_format_x_axis'));
$AxisX->forceMinimum($fechatope);
$AxisX->forceMaximum($now);
@ -2277,10 +2277,10 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
//$GridY2->setLineStyle(Image_Graph::factory('Image_Graph_Line_Dotted', array("white", "gray", "gray", "gray")));
$GridY2->setLineStyle(Image_Graph::factory('Image_Graph_Line_Formatted', array(array("transparent", "transparent", "transparent", "gray"))));
//*/
//grafico_modulo_log4x_trace2(print_r($AxisX, true));
//grafico_modulo_log4x_trace(print_r($AxisX, true));
$AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
$AxisY->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', 'grafico_modulo_log4x_format_y_axis2'));
$AxisY->setDataPreprocessor(Image_Graph::factory('Image_Graph_DataPreprocessor_Function', 'grafico_modulo_log4x_format_y_axis'));
$AxisY->setLabelOption("showtext",true);
//$AxisY->setLabelInterval(0);
//$AxisY->showLabel(IMAGE_GRAPH_LABEL_ZERO);
@ -2303,7 +2303,7 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
foreach($colors as $color)
$FillArray->addColor($color);
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
$FillArray->addColor('green@0.6');
//$AxisY_Weather =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
@ -2326,24 +2326,24 @@ function grafico_modulo_log4x_2 ($id_agente_modulo, $periodo, $show_event,
$plotMinMax =& $PlotareaMinMax->addNew('bubble', array(&$dataset, true));
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
$Graph->done();
grafico_modulo_log4x_trace2(__LINE__);
grafico_modulo_log4x_trace(__LINE__);
}
function grafico_modulo_log4x_index2($x, $interval)
function grafico_modulo_log4x_index($x, $interval)
{
return $x + $interval - (($x - 1) % $interval) - 1;
}
function grafico_modulo_log4x_trace2($str)
function grafico_modulo_log4x_trace($str)
{
//echo "$str\n";
}
function grafico_modulo_log4x_bubble_size2($count, $max_count, $max_bubble_radius)
function grafico_modulo_log4x_bubble_size($count, $max_count, $max_bubble_radius)
{
//Superformula de ROA
$r0 = 1.5;
@ -2377,7 +2377,7 @@ function grafico_modulo_log4x_bubble_size2($count, $max_count, $max_bubble_radiu
return 5 + log($count);
}
function grafico_modulo_log4x_format_x_axis2 ( $number , $decimals=2, $dec_point=".", $thousands_sep=",")
function grafico_modulo_log4x_format_x_axis ( $number , $decimals=2, $dec_point=".", $thousands_sep=",")
{
// $number is the unix time in the local timezone
@ -2389,7 +2389,7 @@ function grafico_modulo_log4x_format_x_axis2 ( $number , $decimals=2, $dec_point
return date("d/m", $number) . "\n" . date("H:i", $number);
}
function grafico_modulo_log4x_format_y_axis2 ( $number , $decimals=2, $dec_point=".", $thousands_sep=",")
function grafico_modulo_log4x_format_y_axis ( $number , $decimals=2, $dec_point=".", $thousands_sep=",")
{
$n = "";

View File

@ -25,7 +25,6 @@
require_once ($config["homedir"]."/include/functions.php");
require_once ($config["homedir"]."/include/functions_db.php");
require_once ($config["homedir"]."/include/functions_agents.php");
//include_once ($config["homedir"]."/include/fgraph.php");
include_once($config["homedir"] . "/include/functions_groups.php");
require_once ('functions_graph.php');
include_once($config['homedir'] . "/include/functions_modules.php");
@ -2051,7 +2050,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$data[0] = grafico_modulo_sparse2($content['id_agent_module'], $content['period'],
$data[0] = grafico_modulo_sparse($content['id_agent_module'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', 0, 0, true, true);
@ -2077,7 +2076,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
}
$data = array ();
$data[0] = grafico_modulo_sparse2($layout_data['id_agente_modulo'], $content['period'],
$data[0] = grafico_modulo_sparse($layout_data['id_agente_modulo'], $content['period'],
false, $sizgraph_w, $sizgraph_h, '', '', false, true, true,
$report["datetime"], '', true, 0, true, true);
array_push ($table->data, $data);
@ -2121,7 +2120,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
require_once ($config["homedir"] . '/include/functions_graph.php');
$data[0] = graphic_combined_module2(
$data[0] = graphic_combined_module(
$modules,
$weights,
$content['period'],
@ -2589,7 +2588,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$data[0] = graph_custom_sql_graph2($content["id_rc"], $sizgraph_w, 200, $content["type"], true);
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true);
array_push($table->data, $data);
break;

View File

@ -117,12 +117,12 @@ function visual_map_print_item($layoutData) {
echo '<div id="' . $id . '" class="item percentile_bar" style="left: 0px; top: 0px; color: ' . $color . '; text-align: center; position: absolute; ' . $sizeStyle . ' margin-top: ' . $top . 'px; margin-left: ' . $left . 'px;">';
echo $text . '<br />';
echo progress_bar2($percentile, $width, 15);
echo progress_bar($percentile, $width, 15);
echo '</div>';
break;
case MODULE_GRAPH:
$img = grafico_modulo_sparse2($id_module, $period, 0, $width,
$img = grafico_modulo_sparse($id_module, $period, 0, $width,
$height, '', null, false, 0, false, 0, '', 0, 0, true, true);
$img = str_replace('>', 'class="image" id="image_' . $id . '" />', $img);
@ -877,9 +877,9 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
echo "<br>";
if ($resizedMap)
echo progress_bar2($percentile, ((integer)($proportion * $width)), 15);
echo progress_bar($percentile, ((integer)($proportion * $width)), 15);
else
echo progress_bar2($percentile, $width, 15);
echo progress_bar($percentile, $width, 15);
if ($endTagA) echo '</a>';
@ -930,12 +930,12 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line
// ATTENTION: DO NOT USE &amp; here because is bad-translated and doesnt work
// resulting fault image links :(
echo grafico_modulo_sparse2 ($layout_data['id_agente_modulo'], $layout_data['period'],
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
false, ((integer)($proportion * $layout_data['width'])), ((integer)($proportion * $layout_data['height'])),
'', null, false, 0, false, 0, '', 0, 0, true, true);
}
else {
echo grafico_modulo_sparse2 ($layout_data['id_agente_modulo'], $layout_data['period'],
echo grafico_modulo_sparse ($layout_data['id_agente_modulo'], $layout_data['period'],
false, $layout_data['width'], $layout_data['height'],
'', null, false, 0, false, 0, '', 0, 0, true, true);
}

View File

@ -407,7 +407,7 @@ function pie_graph($graph_type, $flash_chart, $chart_data, $width, $height,
return fs_2d_pie_chart (array_values($chart_data), array_keys($chart_data), $width, $height);
break;
case "3d":
return fs_3d_pie_chart2(array_values($chart_data), array_keys($chart_data), $width, $height);
return fs_3d_pie_chart(array_values($chart_data), array_keys($chart_data), $width, $height);
break;
}
}

View File

@ -462,7 +462,7 @@ function date_to_epoch ($date) {
}
// Returns the code needed to display the chart
function get_chart_code2 ($chart, $width, $height, $swf) {
function get_chart_code ($chart, $width, $height, $swf) {
$random_number = rand ();
$div_id = 'chart_div_' . $random_number;
$chart_id = 'chart_' . $random_number;
@ -480,7 +480,7 @@ function get_chart_code2 ($chart, $width, $height, $swf) {
}
// Prints a 3D pie chart
function fs_3d_pie_chart2 ($data, $names, $width, $height, $background = "EEEEEE") {
function fs_3d_pie_chart ($data, $names, $width, $height, $background = "EEEEEE") {
if ((sizeof ($data) != sizeof ($names)) OR (sizeof($data) == 0) ){
return;
}
@ -492,11 +492,11 @@ function fs_3d_pie_chart2 ($data, $names, $width, $height, $background = "EEEEEE
$chart->setChartParams($params);
for ($i = 0; $i < sizeof ($data); $i++) {
$chart->addChartData($data[$i], 'name=' . clean_flash_string2($names[$i]));
$chart->addChartData($data[$i], 'name=' . clean_flash_string($names[$i]));
}
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Pie3D.swf');
return get_chart_code ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Pie3D.swf');
}
// Prints a 2D pie chart
@ -512,11 +512,11 @@ function fs_2d_pie_chart ($data, $names, $width, $height, $background = "EEEEEE"
$chart->setChartParams($params);
for ($i = 0; $i < sizeof ($data); $i++) {
$chart->addChartData($data[$i], 'name=' . clean_flash_string2($names[$i]));
$chart->addChartData($data[$i], 'name=' . clean_flash_string($names[$i]));
}
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Pie2D.swf');
return get_chart_code ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Pie2D.swf');
}
// Returns a 2D column chart
@ -583,7 +583,7 @@ function fs_2d_column_chart ($data, $width, $height) {
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string2($name) . ';showName=' . $show_name . ';color=95BB04');
$chart->addChartData($value, 'name=' . clean_flash_string($name) . ';showName=' . $show_name . ';color=95BB04');
}
}
@ -658,7 +658,7 @@ function fs_2d_hcolumn_chart ($data, $width, $height) {
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string2($name) . ';showName=' . $show_name/* . ';color=95BB04'*/);
$chart->addChartData($value, 'name=' . clean_flash_string($name) . ';showName=' . $show_name/* . ';color=95BB04'*/);
}
}
@ -667,7 +667,7 @@ function fs_2d_hcolumn_chart ($data, $width, $height) {
$chart->setChartParams($params.';numVDivLines='.$num_vlines.($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Bar2D.swf');
return get_chart_code ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Bar2D.swf');
}
// Returns a 3D column chart
@ -695,14 +695,14 @@ function fs_3d_column_chart ($data, $width, $height) {
if ($value > 0) {
$empty = 0;
}
$chart->addChartData($value, 'name=' . clean_flash_string2($name) . ';showName=' . $show_name . ';color=95BB04');
$chart->addChartData($value, 'name=' . clean_flash_string($name) . ';showName=' . $show_name . ';color=95BB04');
}
$chart->setChartParams('decimalPrecision=0;showAlternateVGridColor=1; numVDivLines='.$num_vlines.';showNames=1;rotateNames=1;showValues=0;showPercentageValues=0;showLimits=0;baseFontSize=9;'
. ($empty == 1 ? ';yAxisMinValue=0;yAxisMaxValue=1' : ''));
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Column2D.swf');
return get_chart_code ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Column2D.swf');
}
// Prints a Gantt chart
@ -828,7 +828,7 @@ function fs_gantt_chart ($title, $from, $to, $tasks, $milestones, $width, $heigh
// Tasks
foreach ($tasks as $task) {
$chart->addGanttProcess (clean_flash_string2($task['name']), 'id=' . $task['id'] . ';link=' . urlencode($task['link']));
$chart->addGanttProcess (clean_flash_string($task['name']), 'id=' . $task['id'] . ';link=' . urlencode($task['link']));
$chart->addGanttTask (__('Planned'), 'start=' . $task['start'] . ';end=' . $task['end'] . ';id=' . $task['id'] . ';processId=' . $task['id'] . ';color=4b3cff;height=5;topPadding=10;animation=0');
@ -849,7 +849,7 @@ function fs_gantt_chart ($title, $from, $to, $tasks, $milestones, $width, $heigh
if ($milestones !== '') {
$chart->addGanttProcess (__('Milestones'), 'id=0');
foreach ($milestones as $milestone) {
$chart->addGanttTask (clean_flash_string2($milestone['name']), 'start=' . $milestone['date'] . ';end=' . $milestone['date'] . ';id=ms-' . $milestone['id'] . ';processId=0;color=ffffff;alpha=0;height=60;topPadding=0;animation=0');
$chart->addGanttTask (clean_flash_string($milestone['name']), 'start=' . $milestone['date'] . ';end=' . $milestone['date'] . ';id=ms-' . $milestone['id'] . ';processId=0;color=ffffff;alpha=0;height=60;topPadding=0;animation=0');
$chart->addGanttMilestone ('ms-' . $milestone['id'], 'date=' . $milestone['date'] . ';radius=8;color=efbb07;shape=star;numSides=3;borderThickness=1');
}
}
@ -858,7 +858,7 @@ function fs_gantt_chart ($title, $from, $to, $tasks, $milestones, $width, $heigh
$chart->addTrendLine ('start=' . date ('d/m/Y') . ';displayValue='. __('Today') . ';color=666666;isTrendZone=1;alpha=20');
// Return the code
return get_chart_code2 ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Gantt.swf');
return get_chart_code ($chart, $width, $height, 'include/graphs/FusionCharts/FCF_Gantt.swf');
}
?>

View File

@ -1,99 +0,0 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/**
* @package Include
* @subpackage Graphs
*/
/**
* PandoraGraphAbstract a abstract class.
* @package Include
*/
abstract class PandoraGraphAbstract {
public $width = 300;
public $height = 200;
public $data;
public $legend = false;
public $fontpath;
public $three_dimensions = true;
public $graph_color = array ();
public $xaxis_interval = 1;
public $yaxis_interval = 5;
public $xaxis_format = 'numeric';
public $yaxis_format = 'numeric';
public $show_title = false;
public $show_legend = false;
public $background_gradient = false;
public $title = "";
public $subtitle = "";
public $stacked = false;
public $zoom = 85;
public $events = false;
public $alert_top = false;
public $alert_bottom = false;
public $date_format = "d/m";
public $max_value = 0;
public $min_value = 0;
public $background_color = '#FFFFFF';
public $border = true;
public $watermark = true;
public $show_axis = true;
public $show_grid = true;
abstract protected function pie_graph ();
abstract protected function horizontal_bar_graph ();
abstract protected function vertical_bar_graph ();
abstract protected function sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name);
abstract protected function single_graph ();
abstract protected function combined_graph ($values, $events, $alerts, $unit_name, $max_value, $stacked);
abstract protected function progress_bar ($value, $color);
abstract protected function graph_sla_horizontal ($data);
}
function get_graph_engine ($period = 3600) {
global $config;
if (file_exists ('pchart_graph.php')) {
require_once ('pchart_graph.php');
$engine = new PchartGraph ();
if (isset ($config['graphics_palette']))
$engine->load_palette ($config['graphics_palette']);
} else {
exit;
}
$engine->graph_color[1] = $config['graph_color1'];
$engine->graph_color[2] = $config['graph_color2'];
$engine->graph_color[3] = $config['graph_color3'];
$engine->graph_color[4] = "#FED000"; // Yellow
$engine->graph_color[5] = "#00FEF0"; // Cyan
$engine->graph_color[6] = "#FF81EC"; // Pink
$engine->graph_color[7] = "#FF8D00"; // Orange
$engine->graph_color[8] = "#7E7E7E"; // Grey
$engine->graph_color[9] = "#000000"; // Black
if ($period <= 86400)
$engine->date_format = 'g:iA';
elseif ($period <= 604800)
$engine->date_format = 'd/m';
else
$engine->date_format = 'd/m/y';
return $engine;
}
?>

View File

@ -43,16 +43,16 @@ class Tactical {
$table->data[0][0] = "<h3 class='title_h3_server'>" . __('Status') . "</h3>" ;
$table->data[1][0] = '<span title="' . __('Global health') . '" alt="' . __('Global health') . '">' . __('G') . '</span> ';
$table->data[1][1] =
progress_bar2($data["global_health"], 70, 8, '', 0);
progress_bar($data["global_health"], 70, 8, '', 0);
$table->data[2][0] = '<span title="' . __('Monitor health') . '" alt="' . __('Monitor health') . '">' . __('M') . '</span> ';
$table->data[2][1] =
progress_bar2($data["monitor_health"], 70, 8, '', 0);
progress_bar($data["monitor_health"], 70, 8, '', 0);
$table->data[3][0] = '<span title="' . __('Module sanity') . '" alt="' . __('Module sanity') . '">' . __('M') . '</span> ';
$table->data[3][1] =
progress_bar2($data["module_sanity"], 70, 8, '', 0);
progress_bar($data["module_sanity"], 70, 8, '', 0);
$table->data[4][0] = '<span title="' . __('Alert level') . '" alt="' . __('Alert level') . '">' . __('A') . '</span> ';
$table->data[4][1] =
progress_bar2($data["alert_level"], 70, 8, '', 0);
progress_bar($data["alert_level"], 70, 8, '', 0);
$table->data[5][0] = $table->data[5][1] = '';
$table->data[6][0] = $table->data[6][1] = '';
$table->data[7][0] = $table->data[7][1] = '';

View File

@ -409,7 +409,7 @@ class viewGraph {
echo "<h3 class='title_h3'>" . __('Graph') . "</h3>";
echo grafico_modulo_sparse2($this->idAgentModule, $this->period, 0, 240,
echo grafico_modulo_sparse($this->idAgentModule, $this->period, 0, 240,
120, io_safe_output($this->agentModule['nombre']), null, true,
0, true, 0, true, true, true, true);

View File

@ -52,13 +52,13 @@ echo '<div style="height: 10px">&nbsp;</div>';
echo '<div style="float:right; width:320px; padding-top:11px;">';
echo '<b>'.__('Agent access rate (24h)').'</b><br />';
graphic_agentaccess2($id_agente, 280, 110, 86400);
graphic_agentaccess($id_agente, 280, 110, 86400);
echo '<div style="height:25px">&nbsp;</div>';
echo '<b>'.__('Events generated -by module-').'</b><br />';
echo graph_event_module2 (290, 120, $id_agente);
echo graph_event_module (290, 120, $id_agente);
if ($config['flash_charts']) {
echo graphic_agentevents2 ($id_agente, 290, 60, 86400);
echo graphic_agentevents ($id_agente, 290, 60, 86400);
}
echo '</div>';
@ -177,7 +177,7 @@ if ($agent['timezone_offset'] != 0) {
$progress = agents_get_next_contact($id_agente);
echo '<tr><td class="datos"><b>'.__('Next agent contact').'</b></td>';
echo '<td class="datos f9" colspan="2">' . progress_bar2($progress, 200, 20) . '</td></tr>';
echo '<td class="datos f9" colspan="2">' . progress_bar($progress, 200, 20) . '</td></tr>';
// Custom fields
$fields = db_get_all_rows_filter('tagent_custom_fields', array('display_on_front' => 1));

View File

@ -126,7 +126,7 @@ else
foreach ($modulesChecked as $idModuleShowGraph => $value) {
echo "<h4>" . $modules[$idModuleShowGraph] . '</h4>';
$unit = modules_get_unit ($idModuleShowGraph);
echo grafico_modulo_sparse2($idModuleShowGraph, $period, $draw_events, $width, $height,
echo grafico_modulo_sparse($idModuleShowGraph, $period, $draw_events, $width, $height,
$modules[$idModuleShowGraph], null, $draw_alerts, $avg_only, false, $date, $unit);
}

View File

@ -148,24 +148,24 @@ $urlImage .= $config['dbhost'] . $config['homeurl'] . '/';
//
switch ($graph_type) {
case 'boolean':
echo grafico_modulo_boolean2 ($id, $period, $draw_events, $width, $height,
echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height,
$label, null, $draw_alerts, 1, false, $date, false, $urlImage);
break;
case 'sparse':
echo grafico_modulo_sparse2 ($id, $period, $draw_events, $width, $height,
echo grafico_modulo_sparse ($id, $period, $draw_events, $width, $height,
$label, null, $draw_alerts, $avg_only, false, $date, '', $baseline,
0, true, false, $urlImage);
break;
case 'string':
echo grafico_modulo_string2 ($id, $period, $draw_events, $width, $height,
echo grafico_modulo_string ($id, $period, $draw_events, $width, $height,
$label, null, $draw_alerts, 1, false, $date, false, $urlImage);
break;
case 'log4x':
echo grafico_modulo_log4x_2 ($id, $period, $draw_events, $width, $height,
echo grafico_modulo_log4x ($id, $period, $draw_events, $width, $height,
$label, $unit_name, $draw_alerts, 1, $pure, $date, 1);
break;
default:
echo fs_error_image2 ('../images');
echo fs_error_image ('../images');
break;
}

View File

@ -86,28 +86,28 @@ $table->data[0][0] ='<b>'.__('Global health').'</b>';
$table->style[1] = "padding-top:4px; padding-bottom:4px;";
$table->data[1][0] =
progress_bar2($data["global_health"], 140, 20, $data["global_health"].'% '.__('of monitors OK'), 0);
progress_bar($data["global_health"], 140, 20, $data["global_health"].'% '.__('of monitors OK'), 0);
$table->style[2] = "padding-top:4px; padding-bottom:4px;";
$table->data[2][0] ='<b>'.__('Monitor health').'</b>';
$table->style[3] = "padding-top:4px; padding-bottom:4px;";
$table->data[3][0] =
progress_bar2($data["monitor_health"], 140, 20, $data["monitor_health"].'% '.__('of monitors up'), 0);
progress_bar($data["monitor_health"], 140, 20, $data["monitor_health"].'% '.__('of monitors up'), 0);
$table->style[4] = "padding-top:4px; padding-bottom:4px;";
$table->data[4][0] = '<b>'.__('Module sanity').'</b>';
$table->style[5] = "padding-top:4px; padding-bottom:4px;";
$table->data[5][0] =
progress_bar2($data["module_sanity"], 140, 20, $data["module_sanity"].'% '.__('of total modules inited'), 0);
progress_bar($data["module_sanity"], 140, 20, $data["module_sanity"].'% '.__('of total modules inited'), 0);
$table->style[6] = "padding-top:4px; padding-bottom:4px;";
$table->data[6][0] = '<b>'.__('Alert level').'</b>';
$table->style[7] = "padding-top:4px; padding-bottom:4px;";
$table->data[7][0] =
progress_bar2($data["alert_level"], 140, 20, $data["alert_level"].'% '.__('of defined alerts not fired'), 0);
progress_bar($data["alert_level"], 140, 20, $data["alert_level"].'% '.__('of defined alerts not fired'), 0);
html_print_table ($table);
unset ($table);
@ -275,7 +275,7 @@ if($is_admin) {
if ($server["type"] != "snmp") {
$data[3] =
progress_bar2($server["load"], 80, 20);
progress_bar($server["load"], 80, 20);
if ($server["type"] != "recon"){
$data[4] = $server["lag_txt"];

View File

@ -33,16 +33,16 @@ ui_print_page_header (__('Statistics'), "images/lightning_go.png",false, false);
echo "<table width=95%>";
echo "<tr><td valign='top'>";
echo "<h3>".__('Event graph')."</h3>";
echo grafico_eventos_total2();
echo grafico_eventos_total();
echo "</td><td valign='top'>";
echo "<h3>".__('Event graph by user')."</h3>";
echo grafico_eventos_usuario2(300, 200);
echo grafico_eventos_usuario(300, 200);
echo "</td></tr>";
echo "<tr><td>";
echo "<h3>".__('Event graph by group')."</h3>";
echo grafico_eventos_grupo2(300, 200);
echo grafico_eventos_grupo(300, 200);
echo '</td></tr>';
echo "</table>";

View File

@ -252,7 +252,7 @@ html_print_submit_button (__('Update'), '', false, 'class="sub upd"');
echo "</td></tr></table></form>"; //This is the filter div
echo '<div style="width:220px; float:left;">';
echo grafico_eventos_grupo2(220, 180, rawurlencode ($sql_post));
echo grafico_eventos_grupo(220, 180, rawurlencode ($sql_post));
echo '</div>';
echo '<div id="steps_clean">&nbsp;</div>';
echo '</div>';

View File

@ -30,19 +30,19 @@ ui_print_page_header (__('Statistics'), "images/book_edit.png", false, "", false
echo '<table width="90%">
<tr><td valign="top"><h3>'.__('Incidents by status').'</h3>';
echo graph_incidents_status2 ();
echo graph_incidents_status ();
echo '<td valign="top"><h3>'.__('Incidents by priority').'</h3>';
echo grafico_incidente_prioridad2 ();
echo grafico_incidente_prioridad ();
echo '<tr><td><h3>'.__('Incidents by group').'</h3>';
echo graphic_incident_group2();
echo graphic_incident_group();
echo '<td><h3>'.__('Incidents by user').'</h3>';
echo graphic_incident_user2();
echo graphic_incident_user();
echo '<tr><td><h3>'.__('Incidents by source').'</h3>';
echo graphic_incident_source2();
echo graphic_incident_source();
echo '</table>';
?>

View File

@ -30,19 +30,19 @@ ui_print_page_header (__('Statistics'), "images/book_edit.png", false, "", false
echo '<table width="90%">
<tr><td valign="top"><h3>'.__('Incidents by status').'</h3>';
echo graph_incidents_status2 ();
echo graph_incidents_status ();
echo '<td valign="top"><h3>'.__('Incidents by priority').'</h3>';
echo grafico_incidente_prioridad2 ();
echo grafico_incidente_prioridad ();
echo '<tr><td><h3>'.__('Incidents by group').'</h3>';
echo graphic_incident_group2();
echo graphic_incident_group();
echo '<td><h3>'.__('Incidents by user').'</h3>';
echo graphic_incident_user2();
echo graphic_incident_user();
echo '<tr><td><h3>'.__('Incidents by source').'</h3>';
echo graphic_incident_source2();
echo graphic_incident_source();
echo '</table>';
?>

View File

@ -192,7 +192,7 @@ foreach ($contents as $content) {
case 'simple_graph':
$data["title"] = __('Simple graph');
$img = grafico_modulo_sparse2($content['id_agent_module'],
$img = grafico_modulo_sparse($content['id_agent_module'],
$content['period'], 0, 720,
230, '', null, false, true, false, $datetime, '', 0, 0, true, true);
preg_match("/src='(.*)'/", $img, $matches);
@ -204,7 +204,7 @@ foreach ($contents as $content) {
case 'simple_baseline_graph':
$data["title"] = __('Simple baseline graph');
$img = grafico_modulo_sparse2($content['id_agent_module'],
$img = grafico_modulo_sparse($content['id_agent_module'],
$content['period'], 0, 720,
230, '', null, false, true, false, ($datetime + $content['period']), '', true, 0, true, true);
@ -232,7 +232,7 @@ foreach ($contents as $content) {
array_push ($weights, $content2["weight"]);
}
$img = $data[0] = graphic_combined_module2(
$img = $data[0] = graphic_combined_module(
$modules,
$weights,
$content['period'],

View File

@ -80,7 +80,7 @@ foreach ($servers as $server) {
// Load
$data[3] =
progress_bar2($server["load"], 60, 20, $server["lag_txt"], 0);
progress_bar($server["load"], 60, 20, $server["lag_txt"], 0);
$data[4] = $server["modules"] . " ".__('of')." ". $server["modules_total"];
$data[5] = '<span style="white-space:nowrap;">'.$server["lag_txt"].'</span>';
$data[6] = $server['threads'].' : '.$server['queued_modules'];

View File

@ -140,7 +140,7 @@ foreach ($recon_tasks as $task) {
$data[6] = "-";
}
else {
$data[6] = progress_bar2($task['status'], 100, 20, __('Progress').':'.$task["status"].'%', 0);
$data[6] = progress_bar($task['status'], 100, 20, __('Progress').':'.$task["status"].'%', 0);
}
$data[7] = ui_print_timestamp ($task["utimestamp"], true);