From: alex <bin...@li...> - 2001-09-13 23:55:37
|
alex Thu Sep 13 16:55:32 2001 EDT Added files: /r2/binarycloud/base/utils/logreport README Start.sh /r2/binarycloud/base/utils/logreport/apps mergelog Log: Adding logreport package Index: r2/binarycloud/base/utils/logreport/Start.sh +++ r2/binarycloud/base/utils/logreport/Start.sh #!/bin/sh ############################################################################### # cvs: # $Id: Start.sh,v 1.1 2001/09/13 23:55:32 alex Exp $ # # -License GPL (http://www.gnu.org/copyleft/gpl.html) # This document is (c)2000 The Turing Studio, Inc. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You are permitted to use and distribute this document under the terms # of the GPL. You may distribute and/or incorporate this document as # part of a commercial product, so long as you: # - Agree to explicitly and clearly credit both The Turing Studio, Inc. # and the stated author of this document. # - Obtain prior written permission from The Turing Studio, Inc. # If you have any questions regarding this document, or the system of # which it is a part, direct them to turing at in...@tu.... # have fun! # # -Author Alex Black, en...@tu... ############################################################################### ############################################################################### ## merge and log reporting script ## ## This script assumes you have a webalizer install at apps/webalizer ## It also assumes you have apps/mergelog ## ## The 'dist' versions of these apps are included compiled for linux ## Mergelog source is included, if you require webalizer source, go to: ## ftp://ftp.mrunix.net/pub/webalizer/ ## ## Just call this script, everything else is done for you. ############################################################################### ## where am I? ############################################ pwd=`pwd` ## hello ############################################ echo "------------------------------------------------------" echo "- Log Merge + Report" echo "------------------------------------------------------" ## does a logs dir exist? ############################################ if (test -d apps/webalizer/logs) then echo "logs dir found"; else echo "logs dir not found. created it" mkdir apps/webalizer/logs fi ## does a report dir exist? ############################################ if (test -d ./report) then echo "report dir found"; else echo "report dir not found. created it" mkdir report fi ## ok, start ############################################ echo "------------------------------------------------------" ## resolve the ips in the logs ############################################ echo -n "dns lookups? [y/n]:" read dns_lookup_flag if (test ${dns_lookup_flag} = "y") then echo "running webazolver" echo "--> This will take a couple minutes" for logfile in ${pwd}/incoming/access*; do apps/webalizer/webazolver -N 20 -D ${pwd}/apps/webalizer/dns_cache $logfile done echo "...done" fi ## Name the report ############################################ echo -n "name the report: " read report_name ## nuke any leftovers ############################################ echo "killing previous logfile" rm -f apps/webalizer/logs/merged_log ## merge the logs ############################################ echo "running mergelog" apps/mergelog ${pwd}/incoming/access* >> ${pwd}/apps/webalizer/logs/merged_log echo "...done" ## run webalizer on the log ############################################ echo "running webalizer" apps/webalizer/webalizer -i -D ${pwd}/apps/webalizer/dns_cache -n ${report_name} -o ${pwd}/report -P .php ${pwd}/apps/webalizer/logs/merged_log echo "...done" ## make a convenient tarball ############################################ echo "making a tarball" tar -czf report.tar.gz report echo "...done" echo "------------------------------------------------------" echo "tarball is at report.tar.gz" ## done... outta here ############################################ echo "...complete. bye." exit 0; |