Hello Russel.

Fri 08 Jan 1999 05:27, Russell Nelson <[EMAIL PROTECTED]> wrote:

 > Is anybody using MRTG to track the performance of qmail?

Yes, a lot. I find that the MRTG graphs are a great tool to find out the
general situation, and spot odd stuff to have a closer look at. They give a 
wealth of information that no sysadm should be without.

 > Any code they wish to share?

That's a bit more tricky, since our setup is very specific and has costum
patches as well as several other patch sets. At this point our patch set is 
not available for public use.

The general idea I use is inserting counters in qmail-send.c to track the
number of bounces, successes, deferrals, failures, mails and mailbytes. The 
numbers are then written to a file (open_trunc/write/close) at a strategic
point (just before job_close in del_dochan()). Similarly I write the
concurrency numbers to a file in del_status().

Concurrency data can also be tracked by grepping from the output of "ps ax".

You can get some useful statistics from ipfwadm counters. Here is what I
have setup:

# incoming smtp traffic (qmail-smtpd)
ipfwadm -i -A in  -D 0.0.0.0/0 25 -P tcp
# outgoing smtp traffic (qmail-remote)
ipfwadm -i -A out -D 0.0.0.0/0 25 -P tcp
# incoming pop3 traffic (commands sent to qmail-pop3d)
ipfwadm -i -A in  -D 0.0.0.0/0 110 -P tcp
# outgoing pop3 traffic (mail and responses returned by qmail-pop3d)
ipfwadm -i -A out -S 0.0.0.0/0 110 -P tcp

With this I can then extract what I need for MRTG from the output of ipfwadm
-A -l.

To track queue size I use a modified version of qmail-qstat, which also
gives the size of the local and remote queue. This is very inefficient - the
data is probably available somewhere in the qmail-send, qmail-clean or
something and could be written to a file.

In qmail-local.c I have added logging of loops, and the line count from that
log is used to track loops.

It's also a good idea to graph the disk space use from the output of df.

The CPU load average numbers from /proc/loadavg are also good to graph, as
well as a sum of "ps axuh|cut -c 15-19" (percent CPU use).

I have plans to add concurrency tracking to a file as an option directly in 
tcpserver.

Teaser:

As part of a larger project of a fully replicating qmail-based mail cluster,
I have implemented an experimental global mail index (for mails in maildirs)
in a MySQL database, continually updated by qmail-local and qmail-pop3d.
Each mail in the index is tagged with the user id (users are also in a MySQL
database), filename, location (new/cur), size, mtime, ctime and atime. This 
gives yet more possible graphs to make, such as total number of mails, total
size of all mails, how many are in cur and in new, how many are older than a
week, a month, whatever.

-- 
Med venlig hilsen / Best Regards
  Odinn S�rensen (System analyse og programmering) / Image Scandinavia A/S
  Peter Bangs Vej 26, 2000 Frederiksberg, Denmark
  Tlf. (+45) 38 14 70 00 - Fax (+45) 38 14 70 07

Reply via email to