' . __('No agents found') . ''; return; } // Generate image and map // If image was generated just a few minutes ago, then don't regenerate // (it takes long) unless regen checkbox is set $filename_map = io_safe_output($config["attachment_store"]) . "/networkmap_" . $filter; $filename_img = io_safe_output($config["attachment_store"]) . "/networkmap_" . $filter . "_" . $font_size; $filename_dot = io_safe_output($config["attachment_store"]) . "/networkmap_" . $filter; if ($simple) { $filename_map .= "_simple"; $filename_img .= "_simple"; $filename_dot .= "_simple"; } if ($nooverlap) { $filename_map .= "_nooverlap"; $filename_img .= "_nooverlap"; $filename_dot .= "_nooverlap"; } $filename_map .= "_" . $id_networkmap . ".map"; $filename_img .= "_" . $id_networkmap . ".png"; $filename_dot .= "_" . $id_networkmap . ".dot"; if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - SECONDS_5MINUTES) { $result = true; } else { $fh = @fopen ($filename_dot, 'w'); if ($fh === false) { $result = false; } else { fwrite ($fh, $graph); $graphviz_path = ($config['graphviz_bin_dir']) ? io_safe_output($config['graphviz_bin_dir']."/") : ""; $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); } } if ($result !== false) { if (! file_exists ($filename_map)) { ui_print_error_message (__('Map could not be generated')); echo $result; echo "
Apparently something went wrong reading the output.
"; echo "
Is ".$config["attachment_store"]." readable by the webserver process?"; echo "

Is ".$filter." (usually part of GraphViz) and echo installed and able to be executed by the webserver process?"; return; } echo "
"; $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); } else { ui_print_error_message (__('Map could not be generated')); echo $result; echo "
Apparently something went wrong executing the command or writing the output.
"; echo "
Is ".$filter." (usually part of GraphViz) and echo installed and able to be executed by the webserver process?"; echo "

Is your webserver restricted from executing command line tools through the system() call (PHP Safe Mode or SELinux)"; echo "

Is ".$config["attachment_store"]." writeable by the webserver process? To change this do the following (POSIX-based systems): chown <apache user> ".$config["attachment_store"]; return; } ?>