diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 5455dab2bf..cda98f5d96 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -2473,27 +2473,27 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false) else{ $interface_traffic_modules = agents_get_modules($agent_id, $columns, "nombre LIKE 'if%Octets_$interface_name'"); } + if (!empty($interface_traffic_modules) && count($interface_traffic_modules) >= 2) { $interface_traffic_modules_aux = array('in' => '', 'out' => ''); foreach ($interface_traffic_modules as $interface_traffic_module) { $interface_name_escaped = str_replace("/", "\/", $interface_name); - if($type_interface){ - + if ($type_interface) { if (preg_match ("/^" . $interface_name_escaped . "_if(.+)Octets$/i", $interface_traffic_module['nombre'], $matches)) { - if (strtolower($matches[1]) == 'in') { + if (strtolower($matches[1]) == 'in' || strtolower($matches[1]) == 'hcin') { $interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo']; } - elseif (strtolower($matches[1]) == 'out') { + elseif (strtolower($matches[1]) == 'out' || strtolower($matches[1]) == 'hcout') { $interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo']; } } } else{ if (preg_match ("/^if(.+)Octets_$interface_name_escaped$/i", $interface_traffic_module['nombre'], $matches)) { - if (strtolower($matches[1]) == 'in') { + if (strtolower($matches[1]) == 'in' || strtolower($matches[1]) == 'hcin') { $interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo']; } - elseif (strtolower($matches[1]) == 'out') { + elseif (strtolower($matches[1]) == 'out' || strtolower($matches[1]) == 'hcout') { $interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo']; } } diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index e1bc7bd28b..9cb2c5d0da 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -450,6 +450,7 @@ if (!empty($network_interfaces)) { $table_interface->head_colspan[0] = 8; $table_interface->data = array(); $event_text_cont = 0; + foreach ($network_interfaces as $interface_name => $interface) { if (!empty($interface['traffic'])) { $permission = false; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 2472be7cea..5dce55b101 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -82,11 +82,12 @@ $interface_traffic_modules = array( Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>) - + - + @@ -142,6 +143,7 @@ $interface_traffic_modules = array( $width = (int) get_parameter("width", 555); $height = (int) get_parameter("height", 245); $start_date = (string) get_parameter("start_date", date("Y-m-d")); + $start_time = get_parameter ("start_time", date("H:i:s")); $zoom = (int) get_parameter ("zoom", 1); $baseline = get_parameter ("baseline", 0); $show_percentil = get_parameter ("show_percentil", 0); @@ -153,12 +155,19 @@ $interface_traffic_modules = array( echo ""; } - $current = date("Y-m-d"); + /*$current = date("Y-m-d"); if ($start_date != $current) $date = strtotime($start_date); else $date = $utime; + */ + $date = strtotime("$start_date $start_time"); + $now = time(); + + if ($date > $now){ + $date = $now; + } $urlImage = ui_get_full_url(false); @@ -229,6 +238,12 @@ $interface_traffic_modules = array( $table->data[] = $data; $table->rowclass[] = ''; + $data = array(); + $data[0] = __('Begin time'); + $data[1] = html_print_input_text ("start_time", $start_time,'', 10, 10, 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); @@ -295,6 +310,13 @@ $interface_traffic_modules = array( +