'; echo ''; ui_print_error_message( __('There was a problem connecting with the node') ); echo ''; echo ''; exit; } } $user_language = get_user_language($config['id_user']); if (file_exists('../../include/languages/'.$user_language.'.mo')) { $l10n = new gettext_reader( new CachedFileReader('../../include/languages/'.$user_language.'.mo') ); $l10n->load_tables(); } global $config; echo ''; if ($config['style'] === 'pandora_black' && !is_metaconsole()) { echo ''; } $id = get_parameter('id'); $id_agent = db_get_value( 'id_agente', 'tagente_modulo', 'id_agente_modulo', $id ); $alias = db_get_value('alias', 'tagente', 'id_agente', $id_agent); $label = db_get_value( 'nombre', 'tagente_modulo', 'id_agente_modulo', $id ); ui_require_css_file('register', 'include/styles/', true); // Connection lost alert. $conn_title = __('Connection with console has been lost'); $conn_text = __('Connection to the console has been lost. Please check your internet connection.'); ui_require_javascript_file('connection_check'); set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false)); ui_print_message_dialog( $conn_title, $conn_text, 'connection', '/images/fail@svg.svg' ); ?> 0) { $query = ui_get_url_refresh(false); echo ''; } ?> <?php echo __('%s Graph', get_product_name()).' ('.$alias.' - '.$label; ?>) '; echo ''; ui_print_error_message( __('There was a problem connecting with the node') ); echo ''; echo ''; exit; } } $draw_alerts = get_parameter_checkbox('draw_alerts', 0); $period = get_parameter('period'); $id = get_parameter('id', 0); $start_date = get_parameter('start_date', date('Y/m/d')); $start_time = get_parameter('start_time', date('H:i:s')); $draw_events = get_parameter_checkbox('draw_events', 0); $graph_type = get_parameter('type', 'sparse'); $zoom = get_parameter('zoom', $config['zoom_graph']); $baseline = get_parameter('baseline', 0); $show_events_graph = get_parameter('show_events_graph', 0); $show_percentil = get_parameter_checkbox('show_percentil', 0); $time_compare_separated = get_parameter_checkbox('time_compare_separated', 0); $time_compare_overlapped = get_parameter_checkbox('time_compare_overlapped', 0); $unknown_graph = get_parameter_checkbox('unknown_graph', 1); $histogram = (bool) get_parameter('histogram', 0); $period_graph = (int) get_parameter('period_graph', 0); $enable_projected_period = get_parameter_checkbox('enable_projected_period', 0); $period_projected = get_parameter('period_projected', SECONDS_5MINUTES); $period_maximum = get_parameter_checkbox('period_maximum', 1); $period_minimum = get_parameter_checkbox('period_minimum', 1); $period_average = get_parameter_checkbox('period_average', 1); $period_summatory = get_parameter_checkbox('period_summatory', 0); $period_slice_chart = get_parameter('period_slice_chart', SECONDS_1HOUR); $period_mode = get_parameter('period_mode', CUSTOM_GRAPH_VBARS); $graph_tab = get_parameter('graph_tab', 'tabs-chart-module-graph'); $time_compare = false; if ($time_compare_separated) { $time_compare = 'separated'; } else if ($time_compare_overlapped) { $time_compare = 'overlapped'; } if ($histogram === false) { $fullscale_sent = get_parameter('fullscale_sent', 0); if (!$fullscale_sent) { if (isset($config['full_scale_option']) === false || $config['full_scale_option'] == 0 ) { $fullscale = 0; } else if ($config['full_scale_option'] == 1) { $fullscale = 1; } else if ($config['full_scale_option'] == 2) { if ($graph_type == 'boolean') { $fullscale = 1; } else { $fullscale = 0; } } } else { $fullscale = get_parameter_checkbox('fullscale', 0); } $type_mode_graph = get_parameter_checkbox( 'type_mode_graph', ($fullscale === 1) ? 0 : $config['type_mode_graph'] ); if ($zoom > 1) { $height = ($height * ($zoom / 2.1)); $width = ($width * ($zoom / 1.4)); } // Build date. $date = strtotime($start_date.' '.$start_time); $now = time(); if ($date > $now) { $date = $now; } $urlImage = ui_get_full_url(false, false, false, false); $unit = db_get_value( 'unit', 'tagente_modulo', 'id_agente_modulo', $id ); if (isset($_GET['type']) === true) { $type = get_parameter_get('type'); } } $form_data = [ 'id' => $id, 'refresh' => $refresh, 'draw_events' => $draw_events, 'draw_alerts' => $draw_alerts, 'start_date' => $start_date, 'start_time' => $start_time, 'unknown_graph' => $unknown_graph, 'period' => $period, 'zoom' => $zoom, 'show_percentil' => $show_percentil, 'time_compare_overlapped' => $time_compare_overlapped, 'time_compare_separated' => $time_compare_separated, 'type_mode_graph' => $type_mode_graph, 'fullscale' => $fullscale, 'enable_projected_period' => $enable_projected_period, 'period_projected' => $period_projected, 'type' => $type, 'label' => $label, 'server_id' => $server_id, 'histogram' => $histogram, 'period_graph' => $period_graph, 'period_maximum' => $period_maximum, 'period_minimum' => $period_minimum, 'period_average' => $period_average, 'period_summatory' => $period_summatory, 'period_slice_chart' => $period_slice_chart, 'period_mode' => $period_mode, 'graph_tab' => $graph_tab, ]; $params = [ 'agent_module_id' => $id, 'period' => $period, 'show_events' => $draw_events, 'title' => $label, 'unit_name' => $unit, 'show_alerts' => $draw_alerts, 'date' => $date, 'unit' => $unit, 'baseline' => $baseline, 'homeurl' => $urlImage, 'adapt_key' => 'adapter_'.$graph_type, 'compare' => $time_compare, 'show_unknown' => $unknown_graph, 'percentil' => (($show_percentil) ? $config['percentil'] : null), 'type_graph' => $config['type_module_charts'], 'fullscale' => $fullscale, 'zoom' => $zoom, 'height' => 300, 'type_mode_graph' => $type_mode_graph, 'histogram' => $histogram, 'begin_date' => strtotime($start_date.' '.$start_time), 'enable_projected_period' => $enable_projected_period, 'period_projected' => $period_projected, 'period_maximum' => $period_maximum, 'period_minimum' => $period_minimum, 'period_average' => $period_average, 'period_summatory' => $period_summatory, 'period_slice_chart' => $period_slice_chart, 'period_mode' => $period_mode, 'graph_tab' => $graph_tab, ]; if ($histogram === false) { $output = '
'; $output .= '
'; $output .= draw_container_chart_stat_win($graph_tab); $output .= '
'; $output .= '
'; } else { // Graph. $output .= draw_container_chart_stat_win(); } echo $output; if (is_metaconsole() === true && empty($server_id) === false) { metaconsole_restore_db(); } ?>