Re: Help on qmailanalog
"Ari Arantes Filho" [EMAIL PROTECTED] wrote: I'm trying to use qmailanalog without successfull. I've read MATCHUP and all documentation in /usr/local/qmailanalog/doc but I'm still lost. Could you send me some layout output and input for the zoverall and others tools? I've tried using splogger and multilog, but the output is null!!! How can I use qmailanalog? Since you have multilog, you're using daemontools 0.60 or 0.61. qmailananlog doesn't work with the TAI64N timestamps these versions of daemontools produce. Hopefully, Dan will release a new qmailanalog for TAI64N soon. In the meantime, a script was posted here yesterday to convert TAI64N timestamps to the old TAI format. -Dave
Re: Help on qmailanalog
"Ronny" == Ronny Haryanto [EMAIL PROTECTED] writes: Ronny I use this script to send me a log analysis nightly (via crontab). Ronny Add the z* commands as you like before ")| qmail-inject". Ronny #!/bin/sh Ronny PATH=/usr/local/qmailanalog/bin:/var/qmail/bin:/bin Ronny QMAILLOG="/tmp/q.$$" Ronny umask 077 Ronny cat /var/log/qmail/* | matchup $QMAILLOG 5/dev/null Ronny DATE=`date +'%a %d %b'` Ronny (echo "To: [EMAIL PROTECTED]" Ronny echo "From: [EMAIL PROTECTED]" Ronny echo "Subject: qmail report $DATE" Ronny echo "" Ronny zoverall $QMAILLOG Ronny zfailures $QMAILLOG Ronny zdeferrals $QMAILLOG)| qmail-inject Ronny rm -f $QMAILLOG You really shouldn't be throwing away the output from fd5. It's there for a reason. I use this script: #!/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/log.1.gz" rm -f $TMP_FILE $OUT_FILE cat MAIL_HEADER $OUT_FILE From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: `hostname` qmail statistics MAIL_HEADER touch $EXT_FILE (cat $EXT_FILE; gunzip -c $LOG_FILE | tai64nepoch) | matchup $TMP_FILE 5$EXT_FILE.new mv $EXT_FILE.new $EXT_FILE zoverall $TMP_FILE $OUT_FILE echo "--" $OUT_FILE zddist$TMP_FILE $OUT_FILE /var/qmail/bin/qmail-inject $OUT_FILE rm -f $TMP_FILE $OUT_FILE I've attached a patch for daemontools-0.61 which creates tai64nepoch, something I hacked from tai64nlocal. I happen to rotate my logs nightly, using qfilelog instead of using multilog (rotating logs based on size is fine, but multilog really should support logs rotated based on time as well - something as simply as rotating whenever it receives a HUP or USR1 would make me happy). j. -- Jay Soffian [EMAIL PROTECTED]UNIX Systems Engineer 404.572.1941 Cox Interactive Media
Re: Help on qmailanalog
On 04-Jan-2000, Jay Soffian wrote: Ronny cat /var/log/qmail/* | matchup $QMAILLOG 5/dev/null You really shouldn't be throwing away the output from fd5. It's there for a reason. [...excellent script snipped...] Sorry. I forgot to mention that I only want to see what's already done, I don't want to see pending messages and deliveries in the output of that particular script. Like Jay said, one would probably want to use the output of file descriptor 5 as well if one desires to see the analysis of pending messages and deliveries. -- Ronny Haryanto
Re: Help on qmailanalog
On Tue, 4 Jan 2000 13:14:27 -0600, Ronny Haryanto wrote: Like Jay said, one would probably want to use the output of file descriptor 5 as well if one desires to see the analysis of pending messages and deliveries. The info (pending messages) is required by matchup to match the final delivery of messages started before the analysis period. If you don't do this, your statistics will be bogus as will any info messages that weren't both sent and successfully delivered within the analysis period. -Sincerely, Fred (Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)
Re: Help on qmailanalog
"Jay" == Jay Soffian [EMAIL PROTECTED] writes: Jay I've attached a patch for daemontools-0.61 which creates tai64nepoch, Jay something I hacked from tai64nlocal. I happen to rotate my logs Oops, forgot to attach the patch. Attached. j. -- Jay Soffian [EMAIL PROTECTED]UNIX Systems Engineer 404.572.1941 Cox Interactive Media diff -c -N daemontools-0.61.orig/Makefile daemontools-0.61/Makefile *** daemontools-0.61.orig/Makefile Thu Aug 26 02:56:44 1999 --- daemontools-0.61/Makefile Mon Nov 1 21:44:37 1999 *** *** 318,324 ./compile open_write.c prog: \ ! svscan supervise svok svstat svc fghack multilog tai64n tai64nlocal \ softlimit setuidgid envuidgid rts matchtest prot.o: \ --- 318,324 ./compile open_write.c prog: \ ! svscan supervise svok svstat svc fghack multilog tai64n tai64nlocal tai64nepoch \ softlimit setuidgid envuidgid rts matchtest prot.o: \ *** *** 557,562 --- 557,570 tai64n.o: \ compile tai64n.c timestamp.h substdio.h readwrite.h exit.h ./compile tai64n.c + + tai64nepoch: \ + load tai64nepoch.o substdio.a error.a str.a fs.a + ./load tai64nepoch substdio.a error.a str.a fs.a + + tai64nepoch.o: \ + compile tai64nepoch.c substdio.h subfd.h substdio.h exit.h fmt.h + ./compile tai64nepoch.c tai64nlocal: \ load tai64nlocal.o substdio.a error.a str.a fs.a diff -c -N daemontools-0.61.orig/tai64nepoch.c daemontools-0.61/tai64nepoch.c *** daemontools-0.61.orig/tai64nepoch.c Wed Dec 31 19:00:00 1969 --- daemontools-0.61/tai64nepoch.c Tue Jan 4 13:09:42 2000 *** *** 0 --- 1,68 + #include sys/types.h + #include sys/time.h + #include "substdio.h" + #include "subfd.h" + #include "exit.h" + #include "fmt.h" + + char num[FMT_ULONG]; + + void get(ch) + char *ch; + { + int r; + + r = substdio_get(subfdin,ch,1); + if (r == 1) return; + if (r == 0) _exit(0); + _exit(111); + } + + void out(buf,len) + char *buf; + int len; + { + if (substdio_put(subfdout,buf,len) == -1) + _exit(111); + } + + time_t secs; + unsigned long nanosecs; + unsigned long u; + struct tm *t; + + main() + { + char ch; + + for (;;) { + get(ch); + if (ch == '@') { + secs = 0; + nanosecs = 0; + for (;;) { + get(ch); + u = ch - '0'; + if (u = 10) { + u = ch - 'a'; + if (u = 6) break; + u += 10; + } + secs = 4; + secs += nanosecs 28; + nanosecs = 0xfff; + nanosecs = 4; + nanosecs += u; + } + secs -= 4611686018427387914ULL; + out(num,fmt_ulong(num,(unsigned long) (secs))); + out(".",1); + out(num,fmt_uint0(num,(unsigned int) nanosecs,9)); + } + for (;;) { + out(ch,1); + if (ch == '\n') break; + get(ch); + } + } + }
Help on qmailanalog
Hi, I'm trying to use qmailanalog without successfull. I've read MATCHUP and all documentation in /usr/local/qmailanalog/doc but I'm still lost. Could you send me some layout output and input for the zoverall and others tools? I've tried using splogger and multilog, but the output is null!!! How can I use qmailanalog? Best regards, Ari
Re: Help on qmailanalog
On 03-Jan-2000, Ari Arantes Filho wrote: I'm trying to use qmailanalog without successfull. I've read MATCHUP and all documentation in /usr/local/qmailanalog/doc but I'm still lost. Could you send me some layout output and input for the zoverall and others tools? I've tried using splogger and multilog, but the output is null!!! How can I use qmailanalog? I use this script to send me a log analysis nightly (via crontab). Add the z* commands as you like before ")| qmail-inject". #!/bin/sh PATH=/usr/local/qmailanalog/bin:/var/qmail/bin:/bin QMAILLOG="/tmp/q.$$" umask 077 cat /var/log/qmail/* | matchup $QMAILLOG 5/dev/null DATE=`date +'%a %d %b'` (echo "To: [EMAIL PROTECTED]" echo "From: [EMAIL PROTECTED]" echo "Subject: qmail report $DATE" echo "" zoverall $QMAILLOG zfailures $QMAILLOG zdeferrals $QMAILLOG)| qmail-inject rm -f $QMAILLOG -- Ronny Haryanto