[Mimedefang] Mime Defang Graphs
Ashley M. Kirchner
ashley at pcraft.com
Mon Sep 23 16:16:11 EDT 2002
John Kirkland wrote:
> 1. Add data caching for summary data so I don't have to go back to the
> raw data for each graph.
> 2. Switch graph engine to work off of the /var/log/maillog file.
> 3. Collect additional summary statistics from /var/log/maillog regarding
> total sent messages.
> 4. Add option to graphdefang to display total sent statistics on charts.
Here's an idea (and this is taken directly from the way MRTG works):
Instead of parsing maillog everytime, use 'mailstats' (or whatever the
equivalent is for other MTAs). Parse out the data you need and store it. One
hour from now (or however many times per hour you run your script), parse
'mailstats' again, and compare the values that you received now versus what you
had in the previous run, and calculate the total then. Don't forget to store
the new value. One can even use a Round Robin Database to store these things.
MRTG already does (as long as you combine it with RRDTool.)
So, in my situation, I'm looking at something like this:
# mailstats
Statistics from Thu Feb 28 00:51:56 2002
M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis Mailer
3 2346 10928K 1200 1954K 58 98 local
5 144476 242101K 125797 834919K 21776 16194 esmtp
=============================================================
T 146822 253029K 126997 836873K 21834 16292
C 146822 126997 50496
So, I've had 144,476 esmtp messages since Feb 28th. Now, if I run this
again in an hour, I'll get a higher value, which I can then subtract this from
and get the total messages received in said hour.
This is what I use to plot simple esmtp traffic (amount in and out) seen at
http://mrtg.yeehaw.net/ (scroll down to SMTP stats) - unfortunately I suffered
a 2 hour power failure this morning, so everything appears flat during those 2
hours.
--
W | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley at pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
More information about the MIMEDefang
mailing list