qmailanalog operation

2001-08-09 Thread Gareth Hall

Hi all! 

I have just installed the qmailanalog 0.70 binary for openbsd.
I've noticed that there doesn't appear to be alot of information on
qmailanalog.   atm I'm having problems with getting started.I use
multilog on my qmail system.   Would someone be kind enough to offer some
starting off instructions to see results with this program? (: 

Many Thanks. 

Gareth. 



Re: qmailanalog operation

2001-08-09 Thread Martin

Hello Gareth.

 Hi all! 
 
   I have just installed the qmailanalog 0.70 binary for openbsd.
 I've noticed that there doesn't appear to be alot of information on
 qmailanalog.   atm I'm having problems with getting started.I use
 multilog on my qmail system.   Would someone be kind enough to offer
 some
 starting off instructions to see results with this program? (: 
 
 Many Thanks. 
 
 Gareth. 


Try this (call it mylog (for example) and put it in /usr/local/bin.  
Don`t forget to change the e-mail address.

-
#!/bin/sh

PATH=/usr/local/bin/qmailanalog:/usr/local/bin:$PATH
export PATH

umask 077

TMP_FILE=/var/log/qmail/qmailanalog.tmp
EXT_FILE=/var/log/qmail/qmailanalog.ext
OUT_FILE=/var/log/qmail/qmailanalog.out
LOG_FILE=/var/log/qmail/*

rm -f $TMP_FILE $OUT_FILE

cat  MAIL_HEADER  $OUT_FILE
From: Postmaster@domain
To: whoever@domain
Subject: `hostname` qmail statistics

MAIL_HEADER

touch $EXT_FILE
cat $EXT_FILE $LOG_FILE | matchup  $TMP_FILE 5$EXT_FILE.new
mv $EXT_FILE.new $EXT_FILE

zoverall  $TMP_FILE  $OUT_FILE
echo ---  $OUT_FILE
zfailures  $TMP_FILE  $OUT_FILE
echo ---  $OUT_FILE
zdeferrals  $TMP_FILE  $OUT_FILE
echo ---  $OUT_FILE
#zddist  $TMP_FILE  $OUT_FILE
#Echo ---  $OUT_FILE
#zrxdelay  $TMP_FILE  $OUT_FILE
echo ---  $OUT_FILE
zrecipients  $TMP_FILE  $OUT_FILE
echo ---  $OUT_FILE
#zsuccesses  $TMP_FILE  $OUT_FILE
#echo ---  $OUT_FILE
#zsenders  $TMP_FILE  $OUT_FILE
#echo ---  $OUT_FILE
zrhosts  $TMP_FILE  $OUT_FILE
#echo ---  $OUT_FILE
#zsendmail  $TMP_FILE  $OUT_FILE
#echo ---  $OUT_FILE
#zsuids  $TMP_FILE  $OUT_FILE

/var/qmail/bin/qmail-inject  $OUT_FILE
rm -f $TMP_FILE $OUT_FILE
---

unrem the other ones if you like but it will be big.  I just use the 
zoverall, zfailures, zdeferrals, zrecipients and zrhosts.

Then :-

type   crontab -e and add this :-

01 1 * * */usr/local/bin/mylog

esc : wq (normal vi stuff).

To test you can just invoke it at any time by doing /usr/local/bin/mylog.

Have fun.

Oh...no times as I haven`t patched and added tai64nfrac.

Regards...Martin





Re: qmailanalog operation

2001-08-09 Thread Ross Cooney

On Thu, Aug 09, 2001 at 10:54:25PM -0400, Martin wrote:
 Hello Gareth.
 
K  Hi all! 
  
  I have just installed the qmailanalog 0.70 binary for openbsd.
  I've noticed that there doesn't appear to be alot of information on
  qmailanalog.   atm I'm having problems with getting started.I use
  multilog on my qmail system.   Would someone be kind enough to offer
  some
  starting off instructions to see results with this program? (: 


I use:

To list general details:
awk '{$1=;$2=;$3=;$4=;$5=;print}' /var/log/maillog | cat |
/usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zoverall

To list the details of all the users ont he system:
awk '{$1=;$2=;$3=;$4=;$5=;print}' /var/log/maillog | cat |
/usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zrecipients

To list all the people who have sent emails to our customers:
awk '{$1=;$2=;$3=;$4=;$5=;print}' /var/log/maillog | cat |
/usr/local/qmailanalog/bin/matchup | /usr/local/qmailanalog/bin/zsenders



Ross









og/qmail/*
 
 rm -f $TMP_FILE $OUT_FILE
 
 cat  MAIL_HEADER  $OUT_FILE
 From: Postmaster@domain
 To: whoever@domain
 Subject: `hostname` qmail statistics
 
 MAIL_HEADER
 
 touch $EXT_FILE
 cat $EXT_FILE $LOG_FILE | matchup  $TMP_FILE 5$EXT_FILE.new
 mv $EXT_FILE.new $EXT_FILE
 
 zoverall  $TMP_FILE  $OUT_FILE
 echo ---  $OUT_FILE
 zfailures  $TMP_FILE  $OUT_FILE
 echo ---  $OUT_FILE
 zdeferrals  $TMP_FILE  $OUT_FILE
 echo ---  $OUT_FILE
 #zddist  $TMP_FILE  $OUT_FILE
 #Echo ---  $OUT_FILE
 #zrxdelay  $TMP_FILE  $OUT_FILE
 echo ---  $OUT_FILE
 zrecipients  $TMP_FILE  $OUT_FILE
 echo ---  $OUT_FILE
 #zsuccesses  $TMP_FILE  $OUT_FILE
 #echo ---  $OUT_FILE
 #zsenders  $TMP_FILE  $OUT_FILE
 #echo ---  $OUT_FILE
 zrhosts  $TMP_FILE  $OUT_FILE
 #echo ---  $OUT_FILE
 #zsendmail  $TMP_FILE  $OUT_FILE
 #echo ---  $OUT_FILE
 #zsuids  $TMP_FILE  $OUT_FILE
 
 /var/qmail/bin/qmail-inject  $OUT_FILE
 rm -f $TMP_FILE $OUT_FILE
 ---
 
 unrem the other ones if you like but it will be big.  I just use the 
 zoverall, zfailures, zdeferrals, zrecipients and zrhosts.
 
 Then :-
 
 type   crontab -e and add this :-
 
 01 1 * * */usr/local/bin/mylog
 
 esc : wq (normal vi stuff).
 
 To test you can just invoke it at any time by doing /usr/local/bin/mylog.
 
 Have fun.
 
 Oh...no times as I haven`t patched and added tai64nfrac.
 
 Regards...Martin
 
 

-- 
_
Ross Cooney

Virus Scanner: http://www.antivirus.ie/index.mv?free_scan=1
Perl Tutorial: http://www.cyber-sentry.com/perl/tut.mv?art=1