diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 53b1d8387d..0f0fdf6990 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -14,8 +14,10 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -include_once('include/graphs/fgraph.php'); -include_once('include/functions_snmp_browser.php'); +global $config; + +include_once($config['homedir'] . '/include/graphs/fgraph.php'); +include_once($config['homedir'] . '/include/functions_snmp_browser.php'); function pandora_realtime_graphs () { global $config; @@ -25,8 +27,11 @@ function pandora_realtime_graphs () { $action = get_parameter('action', 'list'); $onheader = array(); - - ui_print_page_header (__("Realtime graphs"), "images/extensions.png", false, "", false, $onheader); + + $hide_header = get_parameter('hide_header', 0); + if (!$hide_header) { + ui_print_page_header (__("Realtime graphs"), "images/extensions.png", false, "", false, $onheader); + } $chart[time()]['graph'] = '0'; $interactive_graph = true; @@ -136,6 +141,10 @@ function pandora_realtime_graphs () { snmp_browser_print_container (false, '100%', '60%', 'none'); } + // Print the relative path to AJAX calls: + html_print_input_hidden('rel_path', get_parameter('rel_path', '')); + + // Print the form echo '
'; @@ -144,9 +153,9 @@ function pandora_realtime_graphs () { html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); html_print_input_hidden ('incremental_base', '0'); - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; + echo ''; // Store servers timezone offset to be retrieved from js set_js_value('timezone_offset', date('Z', time())); diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 53baa810e4..6c535f2e5d 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -58,9 +58,11 @@ function refresh_graph () { postvars['snmp_address'] = $('#text-ip_target').val(); postvars['refresh'] = refresh; - + + var rel_path = $("#hidden-rel_path").val(); + $.ajax({ - url: "extensions/realtime_graphs/ajax.php", + url: rel_path + "extensions/realtime_graphs/ajax.php", type: "POST", dataType: "json", data: postvars, diff --git a/pandora_console/include/functions_extensions.php b/pandora_console/include/functions_extensions.php index 160ba3ac41..47e30d71fd 100755 --- a/pandora_console/include/functions_extensions.php +++ b/pandora_console/include/functions_extensions.php @@ -92,28 +92,27 @@ function extensions_is_extension ($page) { * * @param bool $enterprise */ -function extensions_get_extensions ($enterprise = false) { - - $dir = EXTENSIONS_DIR; - $master_dir = ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; +function extensions_get_extensions ($enterprise = false, $rel_path = '') { + + $dir = $rel_path . EXTENSIONS_DIR; + $master_dir = $rel_path . ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; $handle = false; if ($enterprise) { - $dir = ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; + $dir = $rel_path . ENTERPRISE_DIR . '/' . EXTENSIONS_DIR; if (defined("METACONSOLE")) { - $dir = '../' . EXTENSIONS_DIR; - $master_dir = '../' . EXTENSIONS_DIR; + $dir = $rel_path . '../' . EXTENSIONS_DIR; + $master_dir = $rel_path . '../' . EXTENSIONS_DIR; } } else { if (defined("METACONSOLE")) { - $dir = '../../' . $dir; - $master_dir = '../' . EXTENSIONS_DIR; + $dir = $rel_path . '../../' . $dir; + $master_dir = $rel_path . '../' . EXTENSIONS_DIR; } } - + if (file_exists ($dir)) $handle = @opendir ($dir); - if (empty ($handle)) return; @@ -148,7 +147,7 @@ function extensions_get_extensions ($enterprise = false) { /* Load extensions in enterprise directory */ if (! $enterprise && file_exists ($master_dir)) - return array_merge ($extensions, extensions_get_extensions (true)); + return array_merge ($extensions, extensions_get_extensions (true, $rel_path)); return $extensions; } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index dfb4cb3610..4eea443856 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2711,11 +2711,13 @@ function get_module_realtime_link_graph ($module) { 'snmp_address' => $module['ip_target'], 'snmp_community' => $module['snmp_community'], 'snmp_oid' => $module['snmp_oid'], - 'snmp_ver' => $module['tcp_send'] + 'snmp_ver' => $module['tcp_send'], + 'hide_header' => 1, + 'rel_path' => '../../' ); // Incremental type if ($module['id_tipo_modulo'] == 16) $params['incremental'] = 1; - $link = "index.php?sec=view&sec2=extensions/realtime_graphs&"; //FIXME: Not definitive URL + $link = "operation/agentes/realtime_win.php?"; foreach ($params as $p_key => $p_value) { $link .= "$p_key=" . urlencode(io_safe_output($p_value)) . "&"; } @@ -2723,7 +2725,7 @@ function get_module_realtime_link_graph ($module) { $win_handle = "realtime_" . dechex(crc32($module["id_agente_modulo"].$module["nombre"])); - $link_button = '' . + $link_button = '' . html_print_image("images/chart_curve.png", true, array("border" => '0', "alt" => "")) . //FIXME: Not definitive image ' '; diff --git a/pandora_console/operation/agentes/realtime_win.php b/pandora_console/operation/agentes/realtime_win.php new file mode 100644 index 0000000000..6106583c80 --- /dev/null +++ b/pandora_console/operation/agentes/realtime_win.php @@ -0,0 +1,105 @@ +"; + echo ""; + ui_print_error_message(__('There was a problem connecting with the node')); + echo ""; + echo "