From 8c44f779ee7806ac816f028d7323cda77168bee8 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Fri, 14 Sep 2012 13:12:12 -0300 Subject: sarg - add gzip feature to compress reports and save disk space --- config/sarg/sarg.inc | 29 +++++++++++++++++++++++++++-- config/sarg/sarg_frame.php | 9 ++++++++- config/sarg/sarg_schedule.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 3 deletions(-) (limited to 'config/sarg') diff --git a/config/sarg/sarg.inc b/config/sarg/sarg.inc index 0927b164..2560fb76 100644 --- a/config/sarg/sarg.inc +++ b/config/sarg/sarg.inc @@ -88,13 +88,34 @@ function run_sarg($id=-1) { if ($id >= 0 && is_array($config['installedpackages']['sargschedule']['config'])){ $args=$config['installedpackages']['sargschedule']['config'][$id]['args']; $action=$config['installedpackages']['sargschedule']['config'][$id]['action']; + $gzip=$config['installedpackages']['sargschedule']['config'][$id]['gzip']; + $find=$config['installedpackages']['sargschedule']['config'][$id]['find']; + $gziplevel=$config['installedpackages']['sargschedule']['config'][$id]['gziplevel']; } else{ $args=$_POST['args']; $action=$_POST['action']; + $gzip=$_POST['gzip']; + $find=$_POST['find']; + $gziplevel=$_POST['gziplevel']; + } + $find=(preg_match("/(\d+)/",$find,$find_matches) ? $find_matches[1] : "60"); + log_error("Sarg: force refresh now with {$args} args, compress({$gzip}) and {$action} action after sarg finish."); + if ($gzip=="on"){ + #remove old file if exists + unlink_if_exists("/root/sarg_run_{$id}.sh"); + $gzip_script=<<Aditional Args args + + Gzip + gzip + Post Action action @@ -164,6 +168,44 @@ Choose an action after sarg finishes + + listtopic + temp + Compress Options + + + Enable Compression + gzip + + checkbox + + + Compression level + gziplevel + select + + + + + + + + + + + + + Choose gzip compression level. + + + Find Limit + find + input + 60 + 5 + + Default is to 60 minutes. If your reports take longer to be created, increase this value.]]> + sarg_php_install_command(); -- cgit v1.2.3