'.__('Pandora agents').' » '.__('Network map').' '; if ($pure == 1) { echo ''; print_image ("images/normalscreen.png", false, array ('title' => __('Normal screen'), 'alt' => __('Normal screen'))); echo ''; } else { echo ''; print_image ("images/fullscreen.png", false, array ('title' => __('Normal screen'), 'alt' => __('Normal screen'))); echo ''; } echo ''; // Layout selection $layout_array = array ( 'circular' => 'circular', 'radial' => 'radial', 'spring1' => 'spring 1', 'spring2' => 'spring 2', 'flat' => 'flat'); echo '
'; // Set filter $filter = get_filter ($layout); // Generate dot file $graph = generate_dot (__('Pandora FMS'), $group, $simple, $font_size, $layout, $nooverlap, $zoom, $ranksep, $center, $regen, $pure); if ($graph === false) { print_error_message (__('Map could not be generated')); echo __('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 = $config["attachment_store"]."/networkmap_".$layout; $filename_img = "attachment/networkmap_".$layout."_".$font_size; $filename_dot = $config["attachment_store"]."/networkmap_".$layout; if ($simple) { $filename_map .= "_simple"; $filename_img .= "_simple"; $filename_dot .= "_simple"; } if ($nooverlap) { $filename_map .= "_nooverlap"; $filename_img .= "_nooverlap"; $filename_dot .= "_nooverlap"; } $filename_map .= ".map"; $filename_img .= ".png"; $filename_dot .= ".dot"; if ($regen != 1 && file_exists ($filename_img) && filemtime ($filename_img) > get_system_time () - 300) { $result = true; } else { $fh = @fopen ($filename_dot, 'w'); if ($fh === false) { $result = false; } else { fwrite ($fh, $graph); $cmd = "$filter -Tcmapx -o".$filename_map." -Tpng -o".$filename_img." ".$filename_dot; $result = system ($cmd); fclose ($fh); unlink ($filename_dot); } } if ($result !== false) { if (! file_exists ($filename_map)) { print_error_message (__('Map could not be generated')); echo $result; echo "system()
call (PHP Safe Mode or SELinux)";
echo "