diff --git a/pandora_console/operation/agentes/networkmap.groups.php b/pandora_console/operation/agentes/networkmap.groups.php index a61447dd62..bcd1ad0808 100644 --- a/pandora_console/operation/agentes/networkmap.groups.php +++ b/pandora_console/operation/agentes/networkmap.groups.php @@ -80,8 +80,16 @@ else { io_safe_output($config['graphviz_bin_dir'] . "/") : ""; + $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; + if ($is_windows) { + $graphviz_path = str_replace("/", "\\", $graphviz_path ); + $filter = $filter . '.exe'; + } - $cmd = escapeshellarg($graphviz_path.$filter) . " -Tcmapx " . escapeshellarg("-o$filename_map") . " -Tpng ". escapeshellarg("-o$filename_img") . " " . escapeshellarg($filename_dot); + $cmd = escapeshellarg($graphviz_path.$filter) . " -Tcmapx " . + escapeshellarg("-o$filename_map") . " -Tpng ". + escapeshellarg("-o$filename_img") . " " . + escapeshellarg($filename_dot); $result = system ($cmd); fclose ($fh); unlink ($filename_dot); @@ -99,7 +107,10 @@ if ($result !== false) { return; } echo "
"; - $image_url = str_replace(realpath(io_safe_output($config['homedir'])), "", realpath($filename_img)); + if ($is_windows) + $image_url = str_replace('\\',"/",str_replace($config['homedir'], "", $filename_img)); + else + $image_url = str_replace(realpath(io_safe_output($config['homedir'])), "", realpath($filename_img)); html_print_image ($image_url, false, array ("alt" => __('Network map'), "usemap" => "#networkmap")); echo "
"; require ($filename_map); diff --git a/pandora_console/operation/agentes/networkmap.topology.php b/pandora_console/operation/agentes/networkmap.topology.php index fd154687a6..9adb140212 100644 --- a/pandora_console/operation/agentes/networkmap.topology.php +++ b/pandora_console/operation/agentes/networkmap.topology.php @@ -85,13 +85,20 @@ else { io_safe_output($config['graphviz_bin_dir'] . "/") : ""; - + $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; + if ($is_windows) { + $graphviz_path = str_replace("/", "\\", $graphviz_path ); + $filename_map = str_replace("/", "\\", $filename_map ); + $filename_img = str_replace("/", "\\", $filename_img ); + $filename_dot = str_replace("/", "\\", $filename_dot ); + $filter = $filter . '.exe'; + } $cmd = escapeshellarg($graphviz_path . $filter) . " -Tcmapx " . escapeshellarg("-o$filename_map") . " -Tpng ". escapeshellarg("-o$filename_img") . " " . escapeshellarg($filename_dot); + $result = system ($cmd); - fclose ($fh); unlink ($filename_dot); //~ html_debug_print($cmd);