mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Merge branch 'feature/ticket#1981-Direct-graphs' into develop
This commit is contained in:
commit
e3c1acfcf4
@ -46,6 +46,7 @@ class Tree {
|
|||||||
|
|
||||||
global $config;
|
global $config;
|
||||||
include_once($config['homedir']."/include/functions_servers.php");
|
include_once($config['homedir']."/include/functions_servers.php");
|
||||||
|
include_once($config['homedir']."/include/functions_modules.php");
|
||||||
|
|
||||||
if (defined("METACONSOLE"))
|
if (defined("METACONSOLE"))
|
||||||
enterprise_include_once("meta/include/functions_ui_meta.php");
|
enterprise_include_once("meta/include/functions_ui_meta.php");
|
||||||
@ -1306,31 +1307,35 @@ class Tree {
|
|||||||
$module['serverTypeHTML'] = servers_show_type($module['server_type']);
|
$module['serverTypeHTML'] = servers_show_type($module['server_type']);
|
||||||
|
|
||||||
// Link to the Module graph
|
// Link to the Module graph
|
||||||
$graphType = return_graphtype($module['id_module_type']);
|
$group_id = (int) modules_get_agent_group($module['id']);
|
||||||
$winHandle = dechex(crc32($module['id'] . $module['name']));
|
$module["showGraphs"] = 0;
|
||||||
|
|
||||||
if (!defined('METACONSOLE')) {
|
// ACL
|
||||||
$moduleGraphURL = $config['homeurl'] .
|
if (!empty($group_id) {
|
||||||
"/operation/agentes/stat_win.php?" .
|
$module["showGraphs"] = (int) check_acl($config['id_user'], $group_id, "RR");
|
||||||
"type=$graphType&" .
|
|
||||||
"period=" . SECONDS_1DAY . "&" .
|
|
||||||
"id=" . $module['id'] . "&" .
|
|
||||||
"label=" . rawurlencode(urlencode(base64_encode($module['name']))) . "&" .
|
|
||||||
"refresh=" . SECONDS_10MINUTES;
|
|
||||||
}
|
|
||||||
else if (!empty($server)) {
|
|
||||||
$moduleGraphURL = ui_meta_get_url_console_child(
|
|
||||||
$server, null, null, null, null,
|
|
||||||
"operation/agentes/stat_win.php?" .
|
|
||||||
"type=$graphType&" .
|
|
||||||
"period=" . SECONDS_1DAY . "&" .
|
|
||||||
"id=" . $module["id"] . "&" .
|
|
||||||
"label=" . rawurlencode(urlencode(base64_encode($module['name']))) . "&" .
|
|
||||||
"refresh=" . SECONDS_10MINUTES . "&" .
|
|
||||||
"avg_only=1");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($moduleGraphURL)) {
|
if ($module["showGraphs"]) {
|
||||||
|
$graphType = return_graphtype($module['id_module_type']);
|
||||||
|
$url = ui_get_full_url("operation/agentes/stat_win.php", false, false, false);
|
||||||
|
$winHandle = dechex(crc32($module['id'].$module['name']));
|
||||||
|
|
||||||
|
$graph_params = array(
|
||||||
|
"type" => $graphType,
|
||||||
|
"period" => SECONDS_1DAY,
|
||||||
|
"id" => $module['id'],
|
||||||
|
"label" => rawurlencode(urlencode(base64_encode($module['name']))),
|
||||||
|
"refresh" => SECONDS_10MINUTES
|
||||||
|
);
|
||||||
|
|
||||||
|
if (defined('METACONSOLE') && !empty($server)) {
|
||||||
|
// Set the server id
|
||||||
|
$graph_params["server"] = $module['serverID'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$graph_params_str = http_build_query($graph_params);
|
||||||
|
$moduleGraphURL = "$url?$graph_params_str";
|
||||||
|
|
||||||
$module['moduleGraph'] = array(
|
$module['moduleGraph'] = array(
|
||||||
'url' => $moduleGraphURL,
|
'url' => $moduleGraphURL,
|
||||||
'handle' => $winHandle
|
'handle' => $winHandle
|
||||||
|
@ -2046,35 +2046,41 @@ function events_page_details ($event, $server = "") {
|
|||||||
}
|
}
|
||||||
$table_details->data[] = $data;
|
$table_details->data[] = $data;
|
||||||
|
|
||||||
$data = array();
|
if (check_acl($config['id_user'], $agent['id_grupo'], "RR")) {
|
||||||
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Graph').'</div>';
|
$data = array();
|
||||||
$module_module_type = -1;
|
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Graph').'</div>';
|
||||||
if (isset($module["module_type"])) {
|
|
||||||
$module_module_type = $module["module_type"];
|
$module_type = -1;
|
||||||
}
|
if (isset($module["module_type"])) {
|
||||||
$graph_type = return_graphtype ($module_module_type);
|
$module_type = $module["module_type"];
|
||||||
|
}
|
||||||
$win_handle=dechex(crc32($module["id_agente_modulo"] .
|
$graph_type = return_graphtype ($module_type);
|
||||||
$module["nombre"]));
|
$url = ui_get_full_url("operation/agentes/stat_win.php", false, false, false);
|
||||||
|
$handle = dechex(crc32($module["id_agente_modulo"].$module["nombre"]));
|
||||||
$module_module_name = '';
|
$win_handle = "day_$handle";
|
||||||
if (isset($module["module_name"])) {
|
|
||||||
$module_module_name = $module["module_name"];
|
$graph_params = array(
|
||||||
}
|
"type" => $graph_type,
|
||||||
$link ="winopeng('" . $serverstring .
|
"period" => SECONDS_1DAY,
|
||||||
"operation/agentes/stat_win.php?type=" . $graph_type."&" .
|
"id" => $module["id_agente_modulo"],
|
||||||
"period=" . SECONDS_1DAY . "&" .
|
"label" => rawurlencode(urlencode(base64_encode($module["nombre"]))),
|
||||||
"id=" . $module["id_agente_modulo"] . "&" .
|
"refresh" => SECONDS_10MINUTES
|
||||||
"label=" . rawurlencode(
|
);
|
||||||
urlencode(
|
|
||||||
base64_encode($module_module_name))) . $hashstring . "&" .
|
if (defined('METACONSOLE')) {
|
||||||
(!empty($server) ? "avg_only=1&" : "") .
|
// Set the server id
|
||||||
"refresh=" . SECONDS_10MINUTES . "','day_".$win_handle."')";
|
$graph_params["server"] = $server["id"];
|
||||||
|
}
|
||||||
$data[1] = '<a href="javascript:'.$link.'">';
|
|
||||||
$data[1] .= html_print_image('images/chart_curve.png',true);
|
$graph_params_str = http_build_query($graph_params);
|
||||||
$data[1] .= '</a>';
|
|
||||||
$table_details->data[] = $data;
|
$link = "winopeng('$url?$graph_params_str','$win_handle')";
|
||||||
|
|
||||||
|
$data[1] = '<a href="javascript:'.$link.'">';
|
||||||
|
$data[1] .= html_print_image('images/chart_curve.png',true);
|
||||||
|
$data[1] .= '</a>';
|
||||||
|
$table_details->data[] = $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
$data = array();
|
||||||
|
@ -804,26 +804,26 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
$water_mark = array('file' =>
|
$water_mark = array('file' =>
|
||||||
$config['homedir'] . "/images/logo_vertical_water.png",
|
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url(false, false, false, false) . "/images/logo_vertical_water.png");
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
if ($compare === 'separated') {
|
if ($compare === 'separated') {
|
||||||
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
||||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
||||||
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
||||||
$series_suffix_str, $menu, $backgroundColor).
|
$series_suffix_str, $menu, $backgroundColor).
|
||||||
'<br>'.
|
'<br>'.
|
||||||
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
||||||
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
||||||
$series_type_prev, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
$series_type_prev, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
||||||
$series_suffix_str, $menu, $backgroundColor);
|
$series_suffix_str, $menu, $backgroundColor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Color commented not to restrict serie colors
|
// Color commented not to restrict serie colors
|
||||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
"", $unit, $homeurl, $water_mark, $config['fontpath'], $config['font_size'], $unit, $ttl,
|
||||||
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
$series_type, $chart_extra_data, $warning_min, $critical_min, $adapt_key, false,
|
||||||
$series_suffix_str, $menu, $backgroundColor);
|
$series_suffix_str, $menu, $backgroundColor);
|
||||||
}
|
}
|
||||||
@ -1320,7 +1320,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||||||
|
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
|
|
||||||
//Work around for fixed the agents name with huge size chars.
|
//Work around for fixed the agents name with huge size chars.
|
||||||
@ -1365,8 +1365,8 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||||||
case CUSTOM_GRAPH_AREA:
|
case CUSTOM_GRAPH_AREA:
|
||||||
return area_graph($flash_charts, $graph_values, $width,
|
return area_graph($flash_charts, $graph_values, $width,
|
||||||
$height, $color, $module_name_list, $long_index,
|
$height, $color, $module_name_list, $long_index,
|
||||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
"", $homeurl, $water_mark, $config['fontpath'],
|
"", "", $homeurl, $water_mark, $config['fontpath'],
|
||||||
$fixed_font_size, "", $ttl, array(), array(), 0, 0, '',
|
$fixed_font_size, "", $ttl, array(), array(), 0, 0, '',
|
||||||
false, '', true, $background_color);
|
false, '', true, $background_color);
|
||||||
break;
|
break;
|
||||||
@ -1374,22 +1374,22 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||||||
case CUSTOM_GRAPH_STACKED_AREA:
|
case CUSTOM_GRAPH_STACKED_AREA:
|
||||||
return stacked_area_graph($flash_charts, $graph_values,
|
return stacked_area_graph($flash_charts, $graph_values,
|
||||||
$width, $height, $color, $module_name_list, $long_index,
|
$width, $height, $color, $module_name_list, $long_index,
|
||||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
"", "", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||||
"", $ttl, $homeurl, $background_color);
|
"", $ttl, $homeurl, $background_color);
|
||||||
break;
|
break;
|
||||||
case CUSTOM_GRAPH_LINE:
|
case CUSTOM_GRAPH_LINE:
|
||||||
return line_graph($flash_charts, $graph_values, $width,
|
return line_graph($flash_charts, $graph_values, $width,
|
||||||
$height, $color, $module_name_list, $long_index,
|
$height, $color, $module_name_list, $long_index,
|
||||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
"", "", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||||
"", $ttl, $homeurl, $background_color);
|
"", $ttl, $homeurl, $background_color);
|
||||||
break;
|
break;
|
||||||
case CUSTOM_GRAPH_STACKED_LINE:
|
case CUSTOM_GRAPH_STACKED_LINE:
|
||||||
return stacked_line_graph($flash_charts, $graph_values,
|
return stacked_line_graph($flash_charts, $graph_values,
|
||||||
$width, $height, $color, $module_name_list, $long_index,
|
$width, $height, $color, $module_name_list, $long_index,
|
||||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
"", "", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||||
"", $ttl, $homeurl, $background_color);
|
"", $ttl, $homeurl, $background_color);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1455,15 +1455,15 @@ function graphic_agentaccess ($id_agent, $width, $height, $period = 0, $return =
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
if ($empty_data) {
|
if ($empty_data) {
|
||||||
$out = graph_nodata_image($width, $height);
|
$out = graph_nodata_image($width, $height);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$out = area_graph($config['flash_charts'], $data, $width, $height,
|
$out = area_graph($config['flash_charts'], $data, $width, $height, null, null, null,
|
||||||
null, null, null, ui_get_full_url("images/image_problem.opaque.png"), "", "", ui_get_full_url(false, false, false, false),
|
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark,
|
"", "", ui_get_full_url(false, false, false, false), $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], "", 1, array(), array(), 0, 0, '', false, '', false);
|
$config['fontpath'], $config['font_size'], "", 1, array(), array(), 0, 0, '', false, '', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1553,7 +1553,7 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re
|
|||||||
array_walk($data, 'truncate_negatives');
|
array_walk($data, 'truncate_negatives');
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
$colors = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN);
|
$colors = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN);
|
||||||
|
|
||||||
@ -1566,8 +1566,8 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re
|
|||||||
}
|
}
|
||||||
|
|
||||||
$out = pie2d_graph($config['flash_charts'], $data, $width, $height,
|
$out = pie2d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__("other"),
|
__("other"), ui_get_full_url(false, false, false, false), '',
|
||||||
ui_get_full_url(false), '', $config['fontpath'], $config['font_size'], 1, "hidden", $colors);
|
$config['fontpath'], $config['font_size'], 1, "hidden", $colors);
|
||||||
|
|
||||||
if ($return) {
|
if ($return) {
|
||||||
return $out;
|
return $out;
|
||||||
@ -1635,11 +1635,10 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height, __("other"),
|
return pie3d_graph($config['flash_charts'], $data, $width, $height, __("other"),
|
||||||
'', $water_mark,
|
'', $water_mark, $config['fontpath'], $config['font_size'], 1, "bottom");
|
||||||
$config['fontpath'], $config['font_size'], 1, "bottom");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false, $options = false) {
|
function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false, $options = false) {
|
||||||
@ -1736,8 +1735,7 @@ function graph_sla_slicebar ($id, $period, $sla_min, $sla_max, $date, $daysWeek
|
|||||||
5 => COL_NOTINIT);
|
5 => COL_NOTINIT);
|
||||||
|
|
||||||
return slicesbar_graph($data, $period, $width, $height, $colors,
|
return slicesbar_graph($data, $period, $width, $height, $colors,
|
||||||
$config['fontpath'],
|
$config['fontpath'], $round_corner, $home_url, $ttl);
|
||||||
$round_corner, $home_url, $ttl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1947,7 +1945,7 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
|
|||||||
|
|
||||||
$water_mark = array(
|
$water_mark = array(
|
||||||
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png")
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)
|
||||||
);
|
);
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
@ -1979,11 +1977,10 @@ function grafico_db_agentes_paquetes($width = 380, $height = 300) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return hbar_graph($config['flash_charts'], $data, $width, $height, array(),
|
return hbar_graph($config['flash_charts'], $data, $width, $height, array(),
|
||||||
$legend, "", "", true, "",
|
$legend, "", "", true, "", $water_mark,
|
||||||
$water_mark,
|
|
||||||
$config['fontpath'], $config['font_size'], false);
|
$config['fontpath'], $config['font_size'], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2040,8 +2037,8 @@ function graph_db_agentes_modulos($width, $height) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return hbar_graph($config['flash_charts'],
|
return hbar_graph($config['flash_charts'],
|
||||||
$data, $width, $height, array(),
|
$data, $width, $height, array(),
|
||||||
array(), "", "", true, "",
|
array(), "", "", true, "",
|
||||||
@ -2087,8 +2084,11 @@ function graphic_user_activity ($width = 350, $height = 230) {
|
|||||||
$data[$login['id_usuario']] = $login['n_incidents'];
|
$data[$login['id_usuario']] = $login['n_incidents'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2122,8 +2122,11 @@ function grafico_incidente_prioridad () {
|
|||||||
__('Very serious') => $data_tmp[4],
|
__('Very serious') => $data_tmp[4],
|
||||||
__('Maintenance') => $data_tmp[5]);
|
__('Maintenance') => $data_tmp[5]);
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2157,8 +2160,11 @@ function graph_incidents_status () {
|
|||||||
$data[__("Invalid")]++;
|
$data[__("Invalid")]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, 370, 180,
|
return pie3d_graph($config['flash_charts'], $data, 370, 180,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2195,8 +2201,11 @@ function graphic_incident_group () {
|
|||||||
$data[__('All')] = $incidents_all;
|
$data[__('All')] = $incidents_all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2234,8 +2243,11 @@ function graphic_incident_user () {
|
|||||||
$data[$name] = $incident['n_incidents'];
|
$data[$name] = $incident['n_incidents'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
return pie3d_graph($config['flash_charts'], $data, 320, 200,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2282,8 +2294,11 @@ function graphic_incident_source($width = 320, $height = 200) {
|
|||||||
$data[$origin['origen']] = $origin['n_incident'];
|
$data[$origin['origen']] = $origin['n_incident'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), '', $water_mark,
|
||||||
$config['fontpath'], $config['font_size']);
|
$config['fontpath'], $config['font_size']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2305,7 +2320,7 @@ function graph_events_validated($width = 300, $height = 200, $url = "", $meta =
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false, false));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
echo pie3d_graph(
|
echo pie3d_graph(
|
||||||
true, $data_graph, $width, $height, __("other"), "",
|
true, $data_graph, $width, $height, __("other"), "",
|
||||||
@ -2446,7 +2461,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta =
|
|||||||
arsort($data);
|
arsort($data);
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false, false));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__('Other'), '', $water_mark,
|
__('Other'), '', $water_mark,
|
||||||
@ -2518,7 +2533,7 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200) {
|
|||||||
|
|
||||||
$water_mark = array(
|
$water_mark = array(
|
||||||
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__('Other'), '', $water_mark,
|
__('Other'), '', $water_mark,
|
||||||
@ -2574,7 +2589,7 @@ function grafico_eventos_usuario ($width, $height) {
|
|||||||
|
|
||||||
$water_mark = array(
|
$water_mark = array(
|
||||||
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
'file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
return pie3d_graph($config['flash_charts'], $data, $width, $height,
|
||||||
__('Other'), '', $water_mark,
|
__('Other'), '', $water_mark,
|
||||||
@ -2654,19 +2669,17 @@ function graph_custom_sql_graph ($id, $width, $height, $type = 'sql_graph_vbar',
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'sql_graph_vbar': // vertical bar
|
case 'sql_graph_vbar': // vertical bar
|
||||||
return vbar_graph($flash_charts, $data, $width, $height, array(),
|
return vbar_graph($flash_charts, $data, $width, $height, array(),
|
||||||
array(), "", "", $homeurl,
|
array(), "", "", $homeurl, $water_mark,
|
||||||
$water_mark,
|
|
||||||
$config['fontpath'], $config['font_size'], false, $ttl);
|
$config['fontpath'], $config['font_size'], false, $ttl);
|
||||||
break;
|
break;
|
||||||
case 'sql_graph_hbar': // horizontal bar
|
case 'sql_graph_hbar': // horizontal bar
|
||||||
return hbar_graph($flash_charts, $data, $width, $height, array(),
|
return hbar_graph($flash_charts, $data, $width, $height, array(),
|
||||||
array(), "", "", true, $homeurl,
|
array(), "", "", true, $homeurl, $water_mark,
|
||||||
$water_mark,
|
|
||||||
$config['fontpath'], $config['font_size'], false, $ttl);
|
$config['fontpath'], $config['font_size'], false, $ttl);
|
||||||
break;
|
break;
|
||||||
case 'sql_graph_pie': // Pie
|
case 'sql_graph_pie': // Pie
|
||||||
@ -3246,25 +3259,25 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("/images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
if ($compare === 'separated') {
|
if ($compare === 'separated') {
|
||||||
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height/2, $color, $legend,
|
||||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark,
|
"", $unit, $homeurl, $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu).
|
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu).
|
||||||
'<br>'.
|
'<br>'.
|
||||||
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
area_graph($flash_chart, $chart_prev, $width, $height/2, $color_prev, $legend_prev,
|
||||||
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index_prev, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark,
|
"", $unit, $homeurl, $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type_prev,
|
$config['fontpath'], $config['font_size'], $unit, 1, $series_type_prev,
|
||||||
$chart_extra_data_prev, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
|
$chart_extra_data_prev, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
|
||||||
$long_index, ui_get_full_url("images/image_problem.opaque.png"), "", $unit, $homeurl,
|
$long_index, ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark,
|
"", $unit, $homeurl, $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
$config['fontpath'], $config['font_size'], $unit, 1, $series_type,
|
||||||
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
|
$chart_extra_data, 0, 0, $adapt_key, false, $series_suffix_str, $menu);
|
||||||
}
|
}
|
||||||
@ -3337,11 +3350,12 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
|
|
||||||
return area_graph($flash_chart, $chart, $width, $height, array (), $sources,
|
return area_graph($flash_chart, $chart, $width, $height, array (), $sources,
|
||||||
array (), "images/image_problem.opaque.png", "", $unit, $homeurl,
|
array (), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
|
"", $unit, $homeurl,
|
||||||
$config['homedir'] . "/images/logo_vertical_water.png",
|
$config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
$config['fontpath'], $config['font_size'], $unit, 2);
|
$config['fontpath'], $config['font_size'], $unit, 2);
|
||||||
}
|
}
|
||||||
@ -3415,12 +3429,12 @@ function graph_netflow_total_area ($data, $period, $width, $height, $unit = '',
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
$legend = array (__('Max.') . ' ' . format_numeric($max) . ' ' . __('Min.') . ' ' . format_numeric($min) . ' ' . __('Avg.') . ' ' . format_numeric ($avg));
|
$legend = array (__('Max.') . ' ' . format_numeric($max) . ' ' . __('Min.') . ' ' . format_numeric($min) . ' ' . __('Avg.') . ' ' . format_numeric ($avg));
|
||||||
return area_graph($flash_chart, $chart, $width, $height, array (), $legend,
|
return area_graph($flash_chart, $chart, $width, $height, array (), $legend,
|
||||||
array (), ui_get_full_url("images/image_problem.opaque.png"), "", "", $homeurl,
|
array (), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||||
$water_mark,
|
"", "", $homeurl, $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $unit, $ttl);
|
$config['fontpath'], $config['font_size'], $unit, $ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3454,8 +3468,11 @@ function graph_netflow_aggregate_pie ($data, $aggregate, $ttl = 1, $only_image =
|
|||||||
$flash_chart = false;
|
$flash_chart = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return pie3d_graph($flash_chart, $values, 370, 200,
|
return pie3d_graph($flash_chart, $values, 370, 200,
|
||||||
__('Other'), $config['homeurl'], $config['homedir'] . "/images/logo_vertical_water.png",
|
__('Other'), $config['homeurl'], $water_mark,
|
||||||
$config['fontpath'], $config['font_size'], $ttl);
|
$config['fontpath'], $config['font_size'], $ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3762,7 +3779,7 @@ function grafico_modulo_string ($agent_module_id, $period, $show_events,
|
|||||||
}
|
}
|
||||||
|
|
||||||
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
$water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png",
|
||||||
'url' => ui_get_full_url("/images/logo_vertical_water.png"));
|
'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false));
|
||||||
|
|
||||||
return area_graph($flash_chart, $chart, $width, $height, $color,
|
return area_graph($flash_chart, $chart, $width, $height, $color,
|
||||||
$legend, array(), '', "", $unit, $homeurl,
|
$legend, array(), '', "", $unit, $homeurl,
|
||||||
|
@ -355,48 +355,50 @@ TreeController = {
|
|||||||
|
|
||||||
$content.append($serverTypeImage);
|
$content.append($serverTypeImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Graph pop-up
|
|
||||||
if (typeof element.moduleGraph != 'undefined') {
|
|
||||||
var $graphImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
|
||||||
+'images/chart_curve.png" /> ');
|
|
||||||
$graphImage
|
|
||||||
.addClass('module-graph')
|
|
||||||
.click(function (e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
try {
|
|
||||||
winopeng(element.moduleGraph.url, element.moduleGraph.handle);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
// console.log(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$content.append($graphImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Data pop-up
|
if (typeof element.showGraphs != 'undefined' && element.showGraphs != 0) {
|
||||||
if (typeof element.id != 'undefined' && !isNaN(element.id)) {
|
// Graph pop-up
|
||||||
|
if (typeof element.moduleGraph != 'undefined') {
|
||||||
|
var $graphImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
||||||
|
+'images/chart_curve.png" /> ');
|
||||||
|
$graphImage
|
||||||
|
.addClass('module-graph')
|
||||||
|
.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
var $dataImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
try {
|
||||||
+'images/binary.png" /> ');
|
winopeng(element.moduleGraph.url, element.moduleGraph.handle);
|
||||||
$dataImage
|
}
|
||||||
.addClass('module-data')
|
catch (error) {
|
||||||
.click(function (e) {
|
// console.log(error);
|
||||||
e.preventDefault();
|
}
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
$content.append($graphImage);
|
||||||
var serverName = element.serverName.length > 0 ? element.serverName : '';
|
}
|
||||||
if ($("#module_details_window").length > 0)
|
|
||||||
show_module_detail_dialog(element.id, '', serverName, 0, 86400);
|
// Data pop-up
|
||||||
}
|
if (typeof element.id != 'undefined' && !isNaN(element.id)) {
|
||||||
catch (error) {
|
|
||||||
// console.log(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$content.append($dataImage);
|
var $dataImage = $('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
||||||
|
+'images/binary.png" /> ');
|
||||||
|
$dataImage
|
||||||
|
.addClass('module-data')
|
||||||
|
.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
try {
|
||||||
|
var serverName = element.serverName.length > 0 ? element.serverName : '';
|
||||||
|
if ($("#module_details_window").length > 0)
|
||||||
|
show_module_detail_dialog(element.id, '', serverName, 0, 86400);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// console.log(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$content.append($dataImage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Alerts
|
// Alerts
|
||||||
|
@ -21,32 +21,32 @@ if (! isset($_SESSION['id_usuario'])) {
|
|||||||
|
|
||||||
// Global & session management
|
// Global & session management
|
||||||
require_once ('../../include/config.php');
|
require_once ('../../include/config.php');
|
||||||
require_once ('../../include/auth/mysql.php');
|
require_once ($config['homedir'] . '/include/auth/mysql.php');
|
||||||
require_once ($config['homedir'] . '/include/functions.php');
|
require_once ($config['homedir'] . '/include/functions.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_db.php');
|
require_once ($config['homedir'] . '/include/functions_db.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
require_once ($config['homedir'] . '/include/functions_reporting.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_graph.php');
|
require_once ($config['homedir'] . '/include/functions_graph.php');
|
||||||
require_once ($config['homedir'] . '/include/functions_modules.php');
|
require_once ($config['homedir'] . '/include/functions_modules.php');
|
||||||
|
require_once ($config['homedir'] . '/include/functions_agents.php');
|
||||||
// Hash login process
|
|
||||||
if (! isset ($config['id_user']) && get_parameter("loginhash", 0)) {
|
|
||||||
$loginhash_data = get_parameter("loginhash_data", "");
|
|
||||||
$loginhash_user = str_rot13(get_parameter("loginhash_user", ""));
|
|
||||||
|
|
||||||
if ($config["loginhash_pwd"] != ""
|
|
||||||
&& $loginhash_data == md5($loginhash_user.io_output_password($config["loginhash_pwd"]))) {
|
|
||||||
|
|
||||||
db_logon ($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
|
||||||
$_SESSION['id_usuario'] = $loginhash_user;
|
|
||||||
$config["id_user"] = $loginhash_user;
|
|
||||||
|
|
||||||
$hash_connection_data = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
check_login ();
|
check_login ();
|
||||||
|
|
||||||
|
// Metaconsole connection to the node
|
||||||
|
$server_id = (int) get_parameter("server");
|
||||||
|
if ($config["metaconsole"] && !empty($server_id)) {
|
||||||
|
$server = metaconsole_get_connection_by_id($server_id);
|
||||||
|
|
||||||
|
// Error connecting
|
||||||
|
if (metaconsole_connect($server) !== NOERR) {
|
||||||
|
echo "<html>";
|
||||||
|
echo "<body>";
|
||||||
|
ui_print_error_message(__('There was a problem connecting with the node'));
|
||||||
|
echo "</body>";
|
||||||
|
echo "</html>";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$user_language = get_user_language ($config['id_user']);
|
$user_language = get_user_language ($config['id_user']);
|
||||||
if (file_exists ('../../include/languages/'.$user_language.'.mo')) {
|
if (file_exists ('../../include/languages/'.$user_language.'.mo')) {
|
||||||
$l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo'));
|
$l10n = new gettext_reader (new CachedFileReader ('../../include/languages/'.$user_language.'.mo'));
|
||||||
@ -100,15 +100,28 @@ $label = base64_decode(get_parameter('label', ''));
|
|||||||
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
<body bgcolor="#ffffff" style='background:#ffffff;'>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Get input parameters
|
// Module id
|
||||||
$label = get_parameter ("label","");
|
$id = (int) get_parameter ("id", 0);
|
||||||
if (!isset($_GET["period"]) OR (!isset($_GET["id"]))) {
|
// Agent id
|
||||||
ui_print_error_message(
|
$agent_id = (int) modules_get_agentmodule_agent($id);
|
||||||
__('There was a problem locating the source of the graph'));
|
if (empty($id) || empty($agent_id)) {
|
||||||
|
ui_print_error_message(__('There was a problem locating the source of the graph'));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$period = get_parameter ( "period", SECONDS_1HOUR);
|
// ACL
|
||||||
|
$permission = false;
|
||||||
|
$agent_group = (int) agents_get_agent_group($agent_id);
|
||||||
|
|
||||||
|
if (!empty($agent_group) && check_acl($config['id_user'], $agent_group, "RR")) {
|
||||||
|
$permission = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$permission) {
|
||||||
|
require ($config['homedir'] . "/general/noaccess.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$draw_alerts = get_parameter("draw_alerts", 0);
|
$draw_alerts = get_parameter("draw_alerts", 0);
|
||||||
$avg_only = get_parameter ("avg_only", 0);
|
$avg_only = get_parameter ("avg_only", 0);
|
||||||
$show_other = (bool)get_parameter('show_other', false);
|
$show_other = (bool)get_parameter('show_other', false);
|
||||||
@ -154,7 +167,7 @@ $label = base64_decode(get_parameter('label', ''));
|
|||||||
else
|
else
|
||||||
$date = $utime;
|
$date = $utime;
|
||||||
|
|
||||||
$urlImage = ui_get_full_url(false);
|
$urlImage = ui_get_full_url(false, false, false, false);
|
||||||
|
|
||||||
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
|
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id);
|
||||||
|
|
||||||
@ -216,22 +229,12 @@ $label = base64_decode(get_parameter('label', ''));
|
|||||||
|
|
||||||
// MENU
|
// MENU
|
||||||
$params['body_text'] .= '<form method="get" action="stat_win.php">';
|
$params['body_text'] .= '<form method="get" action="stat_win.php">';
|
||||||
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
|
||||||
$params['body_text'] .= html_print_input_hidden ("label", $label);
|
|
||||||
|
|
||||||
if (isset($hash_connection_data)) {
|
|
||||||
$params['body_text'] .=
|
|
||||||
html_print_input_hidden("loginhash", "auto", true);
|
|
||||||
$params['body_text'] .=
|
|
||||||
html_print_input_hidden("loginhash_data", $loginhash_data, true);
|
|
||||||
$params['body_text'] .=
|
|
||||||
html_print_input_hidden("loginhash_user",
|
|
||||||
str_rot13($loginhash_user), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
||||||
$params['body_text'] .= html_print_input_hidden ("label", $label, true);
|
$params['body_text'] .= html_print_input_hidden ("label", $label, true);
|
||||||
|
|
||||||
|
if (!empty($server_id))
|
||||||
|
$params['body_text'] .= html_print_input_hidden ("server", $server_id, true);
|
||||||
|
|
||||||
if (isset($_GET["type"])) {
|
if (isset($_GET["type"])) {
|
||||||
$type = get_parameter_get ("type");
|
$type = get_parameter_get ("type");
|
||||||
$params['body_text'] .= html_print_input_hidden ("type", $type, true);
|
$params['body_text'] .= html_print_input_hidden ("type", $type, true);
|
||||||
|
@ -893,6 +893,7 @@ else {
|
|||||||
|
|
||||||
foreach ($result_server as $result_element_key => $result_element_value) {
|
foreach ($result_server as $result_element_key => $result_element_value) {
|
||||||
|
|
||||||
|
$result_server[$result_element_key]['server_id'] = $server["id"];
|
||||||
$result_server[$result_element_key]['server_name'] = $server["server_name"];
|
$result_server[$result_element_key]['server_name'] = $server["server_name"];
|
||||||
$result_server[$result_element_key]['server_url'] = $server["server_url"]."/";
|
$result_server[$result_element_key]['server_url'] = $server["server_url"]."/";
|
||||||
$result_server[$result_element_key]['hashdata'] = $hashdata;
|
$result_server[$result_element_key]['hashdata'] = $hashdata;
|
||||||
@ -1196,39 +1197,30 @@ foreach ($result as $row) {
|
|||||||
|
|
||||||
$data[7] = "";
|
$data[7] = "";
|
||||||
|
|
||||||
if ($row['history_data'] == 1) {
|
if ($row['history_data'] == 1 && check_acl($config['id_user'], $row['id_group'], "RR") {
|
||||||
|
|
||||||
$graph_type = return_graphtype ($row["module_type"]);
|
$graph_type = return_graphtype ($row["module_type"]);
|
||||||
|
|
||||||
$nombre_tipo_modulo = modules_get_moduletype_name ($row["module_type"]);
|
$url = ui_get_full_url("operation/agentes/stat_win.php", false, false, false);
|
||||||
$handle = "stat".$nombre_tipo_modulo."_".$row["id_agente_modulo"];
|
$handle = dechex(crc32($row["id_agente_modulo"].$row["module_name"]));
|
||||||
$url = 'include/procesos.php?agente='.$row["id_agente_modulo"];
|
$win_handle = "day_$handle";
|
||||||
$win_handle=dechex(crc32($row["id_agente_modulo"].$row["module_name"]));
|
|
||||||
|
|
||||||
if (defined('METACONSOLE'))
|
$graph_params = array(
|
||||||
$link ="winopeng('" .
|
"type" => $graph_type,
|
||||||
$row['server_url'] . "operation/agentes/stat_win.php?" .
|
"period" => SECONDS_1DAY,
|
||||||
"type=$graph_type&" .
|
"id" => $row["id_agente_modulo"],
|
||||||
"period=" . SECONDS_1DAY . "&" .
|
"label" => rawurlencode(urlencode(base64_encode($row["module_name"]))),
|
||||||
"loginhash=auto&" .
|
"refresh" => SECONDS_10MINUTES
|
||||||
"loginhash_data=" . $row["hashdata"] . "&" .
|
);
|
||||||
"loginhash_user=" . str_rot13($row["user"]) . "&" .
|
|
||||||
"id=" . $row["id_agente_modulo"] . "&" .
|
if (defined('METACONSOLE') && isset($row["server_id"])) {
|
||||||
"label=" . rawurlencode(
|
// Set the server id
|
||||||
urlencode(
|
$graph_params["server"] = $row["server_id"];
|
||||||
base64_encode($row["module_name"]))) . "&" .
|
}
|
||||||
"avg_only=1&" .
|
|
||||||
"refresh=" . SECONDS_10MINUTES . "', 'day_".$win_handle."')";
|
$graph_params_str = http_build_query($graph_params);
|
||||||
else
|
|
||||||
$link ="winopeng('" .
|
$link = "winopeng('$url?$graph_params_str','$win_handle')";
|
||||||
"operation/agentes/stat_win.php?" .
|
|
||||||
"type=$graph_type&" .
|
|
||||||
"period=" . SECONDS_1DAY . "&" .
|
|
||||||
"id=".$row["id_agente_modulo"]."&" .
|
|
||||||
"label=" . rawurlencode(
|
|
||||||
urlencode(
|
|
||||||
base64_encode($row["module_name"]))) . "&" .
|
|
||||||
"refresh=" . SECONDS_10MINUTES . "', 'day_".$win_handle."')";
|
|
||||||
|
|
||||||
$data[7] = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a>';
|
$data[7] = '<a href="javascript:'.$link.'">' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . '</a>';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user