load_tables(); } echo ''; $id = get_parameter('id'); $label = base64_decode(get_parameter('label', '')); ?> 0) { $query = ui_get_url_refresh (false); echo ''; } ?> Pandora FMS Graph (<?php echo modules_get_agentmodule_agent_name ($id) . ' - ' . $label; ?>) " . __('There was a problem locating the source of the graph') . ""; exit; } $period = get_parameter ( "period", SECONDS_1HOUR); $draw_alerts = get_parameter("draw_alerts", 0); $avg_only = get_parameter ("avg_only", 0); $show_other = (bool)get_parameter('show_other', false); if ($show_other) { $avg_only = 0; } $period = get_parameter ("period", 86400); $id = get_parameter ("id", 0); $width = get_parameter ("width", 555); $height = get_parameter ("height", 245); $label = get_parameter ("label", ""); $start_date = get_parameter ("start_date", date("Y-m-d")); $draw_events = get_parameter ("draw_events", 0); $graph_type = get_parameter ("type", "sparse"); $zoom = get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_events_graph = get_parameter ("show_events_graph", 0); $time_compare_separated = get_parameter ("time_compare_separated", 0); $time_compare_overlapped = get_parameter ("time_compare_overlapped", 0); $unknown_graph = get_parameter_checkbox ("unknown_graph", 1); $time_compare = false; if($time_compare_separated) { $time_compare = 'separated'; } else if($time_compare_overlapped) { $time_compare = 'overlapped'; } if ($zoom > 1) { $height = $height * ($zoom / 2.1); $width = $width * ($zoom / 1.4); echo ""; } $utime = get_system_time (); $current = date("Y-m-d", $utime); if ($start_date != $current) $date = strtotime($start_date); else $date = $utime; $urlImage = ui_get_full_url(false); $unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $id); // log4x doesnt support flash yet // if ($config['flash_charts'] == 1) echo '
'; else echo '
'; switch ($graph_type) { case 'boolean': echo grafico_modulo_boolean ($id, $period, $draw_events, $width, $height, $label, $unit, $draw_alerts, $avg_only, false, $date, false, $urlImage, 'adapter_'.$graph_type, $time_compare, $unknown_graph); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date); break; case 'sparse': echo grafico_modulo_sparse ($id, $period, $draw_events, $width, $height, $label, null, $draw_alerts, $avg_only, false, $date, $unit, $baseline, 0, true, false, $urlImage, 1, false, 'adapter_'.$graph_type, $time_compare, $unknown_graph); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date); break; case 'string': echo grafico_modulo_string ($id, $period, $draw_events, $width, $height, $label, null, $draw_alerts, 1, false, $date, false, $urlImage, 'adapter_'.$graph_type); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, 'adapted_'.$graph_type, $date); break; case 'log4x': echo grafico_modulo_log4x ($id, $period, $draw_events, $width, $height, $label, $unit_name, $draw_alerts, 1, $pure, $date); echo '
'; if ($show_events_graph) echo graphic_module_events($id, $width, $height, $period, $config['homeurl'], $zoom, '', $date); break; default: echo fs_error_image ('../images'); break; } echo '
'; /////////////////////////// // SIDE MENU /////////////////////////// $params = array(); // TOP TEXT $params['top_text'] = "" . __('Pandora FMS Graph configuration menu') . ""; $params['top_text'] .= "

"; $params['top_text'] .=__('Please, make your changes and apply with the Reload button'); // MENU $params['body_text'] = '
'; $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", $loginhash_user, true); } $params['body_text'] .= html_print_input_hidden ("id", $id, true); $params['body_text'] .= html_print_input_hidden ("label", $label, true); if (isset($_GET["type"])) { $type = get_parameter_get ("type"); $params['body_text'] .= html_print_input_hidden ("type", $type, true); } $table->id = 'stat_win_form'; $table->width = '100%'; $table->size[0] = '50%'; $table->cellspacing = 2; $table->cellpadding = 2; $table->class = 'databox_frame'; $data = array(); $data[0] = __('Refresh time'); $data[1] = html_print_extended_select_for_time("refresh", $refresh, '', '', 0, 7, true); $table->data[] = $data; $table->rowclass[] = ''; if ($graph_type != "boolean") { $data = array(); $data[0] = __('Avg. Only'); $data[1] = html_print_checkbox ("avg_only", 1, (bool) $avg_only, true, false, 'show_others()'); $data[1] .= html_print_input_hidden('show_other', 0, true); $table->data[] = $data; $table->rowclass[] = ''; } $data = array(); $data[0] = __('Begin date'); $data[1] = html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 15, 255, true); $data[1] .= html_print_image ("images/calendar_view_day.png", true, array ("onclick" => "scwShow(scwID('text-start_date'),this);")); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Zoom factor'); $options = array (); $options[$zoom] = 'x'.$zoom; $options[1] = 'x1'; $options[2] = 'x2'; $options[3] = 'x3'; $options[4] = 'x4'; $data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Time range'); $data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Show events'); $data[1] = html_print_checkbox ("draw_events", 1, (bool) $draw_events, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Show alerts'); $data[1] = html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Show event graph'); $data[1] = html_print_checkbox ("show_events_graph", 1, (bool) $show_events_graph, true); $table->data[] = $data; $table->rowclass[] = ''; switch ($graph_type) { case 'boolean': case 'sparse': $data = array(); $data[0] = __('Time compare') . ' (' . __('Overlapped') . ')'; $data[1] = html_print_checkbox ("time_compare_overlapped", 1, (bool) $time_compare_overlapped, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Time compare') . ' (' . __('Separated') . ')'; $data[1] = html_print_checkbox ("time_compare_separated", 1, (bool) $time_compare_separated, true); $table->data[] = $data; $table->rowclass[] = ''; $data = array(); $data[0] = __('Show unknown graph'); $data[1] = html_print_checkbox ("unknown_graph", 1, (bool) $unknown_graph, true); $table->data[] = $data; $table->rowclass[] = ''; break; } $data = array(); $data[0] = ''; $data[1] = '
' . html_print_submit_button (__('Reload'), "submit", false, 'class="sub next"', true) . "
"; $table->data[] = $data; $table->rowclass[] = ''; $params['body_text'] .= html_print_table($table, true); $params['body_text'] .= '
'; // ICONS $params['icon_closed'] = '/images/graphmenu_arrow_hide.png'; $params['icon_open'] = '/images/graphmenu_arrow.png'; // SIZE $params['width'] = 400; // POSITION $params['position'] = 'left'; html_print_side_layer($params); ?>