fixed errors in meta and windows

This commit is contained in:
daniel 2018-06-14 19:19:58 +02:00
parent 9e229e6228
commit 7d4a29cbe2
4 changed files with 48 additions and 38 deletions

View File

@ -39,16 +39,12 @@ check_login();
global $config; global $config;
/* $params = json_decode($_GET['data'], true);
$params_json = base64_decode((string) get_parameter('params'));
$params = json_decode($params_json, true);
// Metaconsole connection to the node // Metaconsole connection to the node
$server_id = (int) (isset($params['server']) ? $params['server'] : 0); $server_id = $params['server_id'];
if ($config["metaconsole"] && !empty($server_id)) { if ($config["metaconsole"] && !empty($server_id)) {
$server = metaconsole_get_connection_by_id($server_id); $server = metaconsole_get_connection_by_id($server_id);
// Error connecting // Error connecting
if (metaconsole_connect($server) !== NOERR) { if (metaconsole_connect($server) !== NOERR) {
echo "<html>"; echo "<html>";
@ -59,7 +55,7 @@ if ($config["metaconsole"] && !empty($server_id)) {
exit; exit;
} }
} }
*/
$user_language = get_user_language($config['id_user']); $user_language = get_user_language($config['id_user']);
if (file_exists ('languages/'.$user_language.'.mo')) { if (file_exists ('languages/'.$user_language.'.mo')) {
@ -98,7 +94,7 @@ if (file_exists ('languages/'.$user_language.'.mo')) {
<body bgcolor="#ffffff" style='background:#ffffff;'> <body bgcolor="#ffffff" style='background:#ffffff;'>
<?php <?php
$params = json_decode($_GET['data'], true);
$params['only_image'] = false; $params['only_image'] = false;
$params['width'] = '1048'; $params['width'] = '1048';
$params['menu'] = false; $params['menu'] = false;

View File

@ -3237,19 +3237,19 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined = fal
$session_id = session_id(); $session_id = session_id();
$result = exec( $cmd = '"' . io_safe_output($config['phantomjs_bin']) . DIRECTORY_SEPARATOR . 'phantomjs" "' . $file_js . '" '
io_safe_output($config['phantomjs_bin']) . DIRECTORY_SEPARATOR ."phantomjs " . $file_js . " " . . ' "' . $url . '"'
$url . " '" . . ' "' . $type_graph_pdf . '"'
$type_graph_pdf . "' '" . . ' "' . $params_encode_json . '"'
$params_encode_json . "' '" . . ' "' . $params_combined . '"'
$params_combined . "' '" . . ' "' . $module_list . '"'
$module_list . "' " . . ' "' . $img_path . '"'
$img_path . " " . . ' "' . $width_img . '"'
$width_img . " " . . ' "' . $height_img . '"'
$height_img . " '" . . ' "' . $session_id . '"'
$session_id . "' " . . ' "' . $params['return_img_base_64'] . '"';
$params['return_img_base_64']
); $result = exec($cmd);
if($params['return_img_base_64']){ if($params['return_img_base_64']){
return $result; return $result;

View File

@ -701,7 +701,8 @@ function grafico_modulo_sparse_data(
'return_img_base_64' => false, 'return_img_base_64' => false,
'image_treshold' => false, 'image_treshold' => false,
'graph_combined' => false, 'graph_combined' => false,
'zoom' => 1 'zoom' => 1,
'server_id' => null
); );
*/ */
function grafico_modulo_sparse ($params) { function grafico_modulo_sparse ($params) {

View File

@ -2776,7 +2776,8 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
$content, $content,
$report, $report,
$fullscale, $fullscale,
$pdf $pdf,
$id_meta
); );
} }
@ -2785,7 +2786,7 @@ function reporting_network_interfaces_report($report, $content, $type = 'dinamic
function agents_get_network_interfaces_array( function agents_get_network_interfaces_array(
$network_interfaces_by_agents, $return, $network_interfaces_by_agents, $return,
$type, $content, $report, $fullscale, $pdf $type, $content, $report, $fullscale, $pdf, $id_meta
){ ){
if (empty($network_interfaces_by_agents)) { if (empty($network_interfaces_by_agents)) {
$return['failed'] = $return['failed'] =
@ -2816,7 +2817,8 @@ function agents_get_network_interfaces_array(
'date' => $report["datetime"], 'date' => $report["datetime"],
'only_image'=> $pdf, 'only_image'=> $pdf,
'homeurl' => $config['homeurl'], 'homeurl' => $config['homeurl'],
'fullscale' => $fullscale 'fullscale' => $fullscale,
'server_id' => $id_meta
); );
$params_combined = array( $params_combined = array(
@ -3528,7 +3530,8 @@ function reporting_simple_baseline_graph($report, $content,
'only_image' => $only_image, 'only_image' => $only_image,
'homeurl' => ui_get_full_url(false, false, false, false), 'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => $ttl, 'ttl' => $ttl,
'array_data_create' => $baseline_data 'array_data_create' => $baseline_data,
'server_id' => $id_meta
); );
$return['chart'] = grafico_modulo_sparse ($params); $return['chart'] = grafico_modulo_sparse ($params);
@ -3638,7 +3641,8 @@ function reporting_projection_graph($report, $content,
'unit' => '', 'unit' => '',
'only_image' => $pdf, 'only_image' => $pdf,
'homeurl' => ui_get_full_url(false, false, false, false) . '/', 'homeurl' => ui_get_full_url(false, false, false, false) . '/',
'ttl' => $ttl 'ttl' => $ttl,
'server_id' => $id_meta
); );
$params_combined = array( $params_combined = array(
@ -3899,7 +3903,8 @@ function reporting_value($report, $content, $type,$pdf) {
'homeurl' => ui_get_full_url(false, false, false, false), 'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => 1,///2 'ttl' => 1,///2
'type_graph' => $config['type_module_charts'], 'type_graph' => $config['type_module_charts'],
'time_interval' => $content['lapse'] 'time_interval' => $content['lapse'],
'server_id' => $id_meta
); );
$value = ' $value = '
@ -6275,6 +6280,12 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_graph.php');
if ($config['metaconsole']) {
$id_meta = metaconsole_get_id_server($content["server_name"]);
$server = metaconsole_get_connection_by_id ($id_meta);
metaconsole_connect($server);
}
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']); $graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
$return = array(); $return = array();
$return['type'] = 'custom_graph'; $return['type'] = 'custom_graph';
@ -6307,15 +6318,16 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
case 'static': case 'static':
$params =array( $params =array(
'period' => $content['period'], 'period' => $content['period'],
'width' => $width, 'width' => $width,
'height' => $height, 'height' => $height,
'date' => $report["datetime"], 'date' => $report["datetime"],
'only_image' => $pdf, 'only_image' => $pdf,
'homeurl' => ui_get_full_url(false, false, false, false), 'homeurl' => ui_get_full_url(false, false, false, false),
'ttl' => $ttl, 'ttl' => $ttl,
'percentil' => $graphs[0]["percentil"], 'percentil' => $graphs[0]["percentil"],
'fullscale' => $graphs[0]["fullscale"], 'fullscale' => $graphs[0]["fullscale"],
'server_id' => $id_meta
); );
$params_combined = array( $params_combined = array(
@ -6419,7 +6431,8 @@ function reporting_simple_graph($report, $content, $type = 'dinamic',
'compare' => $time_compare_overlapped, 'compare' => $time_compare_overlapped,
'show_unknown' => true, 'show_unknown' => true,
'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null, 'percentil' => ($content['style']['percentil'] == 1) ? $config['percentil'] : null,
'fullscale' => $fullscale 'fullscale' => $fullscale,
'server_id' => $id_meta
); );
$return['chart'] = grafico_modulo_sparse($params); $return['chart'] = grafico_modulo_sparse($params);