#!/bin/sh # # simple web interface to pflogsumm 3/18/99 # 3/21/99 enhanced to look at multiple maillogs # 4/16/99 meta refresh for killpf # 4/23/99 entire uses $cat so 'rsh mailhost /bin/cat' will work in $cat/$zcat # # chris@nmedia.net # # Note the user who the cgi runs as must be able to run pflogsumm/ps/cat and # read the specified mail logs... Also, this script assumes that your # logs are either not rotated much at all or are rotated at most once per day. # If your maillogs are rotated more then once a day, the results for # the 'today' and 'yesterday' options may not cover the full day! # # If you are using pflogsumm-beta from 3/21/99 or a release version # from a later date then you should comment out the current "opts" entry # below and uncomment the new one! # # If you are not getting any results, run this program from the command line # with appropriate arguments (yesterday, today, entire, all, one, two, ...) # to see the errors that are being generated! # # If you run this on a host that is not your mail server, you can # define 'cat' and 'zcat' to be something like 'rsh mailhost /bin/cat' # and/or 'rsh mailhost /usr/bin/zcat' or something like that...Or ssh.. # From Geoff Gibbs # ps="/usr/ucb/ps" # or /bin/ps for BSD host="mail.empnet.com" # change to your mail server maillog="/var/log/maillog" # change to your mail log maillog0="/var/log/maillog.0" # or maillog.0.gz maillog1="/var/log/maillog.1" # or maillog.1.gz maillog2="/var/log/maillog.2" # or maillog.2.gz maillog3="/var/log/maillog.3" # or maillog.3.gz zcat="/bin/cat" # or /usr/bin/zcat if your rotated logs are compressed cat="/bin/cat" # almost always /bin/cat pflog="/usr/local/bin/pflogsumm.pl" # or /usr/local/bin/pflogsumm-beta.pl opts="-c 100" # Extra options to use with pflogsumm #opts="-h 150 -u 100" # Next version of pflogsumm changes options! scr="mail.cgi" # name of this script (if index.cgi, you can leave it blank) # # disable filename globbing set -f # echo "Content-type: text/html" echo echo echo "$host statistics: $1" echo "
" echo "

$host

" echo "

" if test "$1" = ""; then echo "

" echo "" echo "