qmailanalog

 < Free Open Study > 



qmailanalog processes qmail-send's log files and produces a series of reports that tell you how much and what kind of work the system is doing. If you need statistics about how many messages are being sent or received, how big they are, and how quickly they're being processed, qmailanalog is what you need.

qmailanalog relies on log-entry timestamps in the fractional second format used by accustamp, an obsolete time-stamping utility. To use it with logs generated by multilog, which are in Temps Atomique International 64-bit, nanosecond precision (TAI64N) format, you'll need to translate them into the old format. One program to do that is available from http://www.qmail.org/tai64nfrac.

qmailanalog was written by Daniel Bernstein, who maintains a Web page for it (http://cr.yp.to/qmailanalog.html).

Using qmailanalog

Installing qmailanalog following the directions in INSTALL is straightforward, but running it is a little tricky, especially because it doesn't understand TAI64N timestamps:

  1. First, install qmailanalog using the directions in INSTALL.

  2. Download tai64nfrac to /usr/local/src/tai64nfrac.c, edit the file and remove everything above the line containing /* $Id$. Compile the program using:

     # cc -o /usr/local/bin/tai64nfrac /usr/local/src/tai64nfrac.c # 

  3. Process one or more qmail-send log files through tai64nfrac. The input log entries should look something like this:

     @400000003b88ef5c313ae1e4 status: local 0/10 remote 0/20 

    In particular, each line must start with a TAI64N timestamp (the @400000003b88ef5c313ae1e4 part) followed by a qmail-send log message (the status: local 0/10 remote 0/20 part).

    For example:

     # tai64nfrac < /var/log/qmail/@* > logs.frac # 

    The lines in logs.frac should look like this:

     998829906.825942500 status: local 0/10 remote 0/20 

  4. Process the fractional-timestamp log file using matchup. Because the log files may contain entries for messages that haven't been delivered yet, matchup will write those entries to file descriptor 5. Save them to a file for inclusion in the next matchup run. For example:

     # /usr/local/qmailanalog/bin/matchup < logs.frac > logs.match 5> logs.cont # 

    Each line in logs.match contains all of the relevant information for a single delivery attempt.

  5. Use the scripts in /usr/local/qmailanalog/bin with names starting with z to produce a report from logs.match. For example, to produce an over-all summary report:

     /usr/local/qmailanalog/bin/zoverall < logs.match 

    Each report includes an explanation of its output.

  6. Use the scripts in /usr/local/qmailanalog/bin with names starting with x to extract entries for particular messages, senders, or recipients. These extracted entries can then be passed through a z script. For example, for a report on the recipient hosts of messages from root@dolphin.example.com, you could do this:

     # cd /usr/local/qmailanalog # bin/xsender root@dolphin.example.com < log.match | bin/zrhosts  . . .report. . . 



 < Free Open Study > 



The Qmail Handbook
The qmail Handbook
ISBN: 1893115402
EAN: 2147483647
Year: 2001
Pages: 186
Authors: Dave Sill

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net