# rrds/qmail-smtplog - info from logs of qmail-smtpd (actually tcpserver for qmail-smtpd)
# CVS $Id: qmail-smtplog,v 1.4 2003/03/20 18:09:45 remstats Exp $
# from remstats version @@VERSION@@
# Copyright 2003 by Thomas Erskine <@@AUTHOR@@>

source	log
step 	300
data	concurrency	GAUGE:600:0:U	max : status: (\d+)
data	sessions	DERIVE:600:0:U	count : pid
archives day-avg week-avg month-avg 3month-avg year-avg day-min week-min month-min 3month-min year-min day-max week-max month-max 3month-max year-max
times	day yesterday week month 3month year

graph	concurrency desc='This is collected by the log-collector.  It works by connecting to the log-server running on the host and requesting it to get information about new records on the log-files that it has been told to serve.  In this case, it is examining the records from an instance of tcpserver (see <A HREF="http://cr.yp.to/ucspi-tcp.html">UCSPI-TCP</A>), which is providing smtp service by running qmail-smtpd from <A HREF="http://cr.yp.to/qmail.html">qmail</A> to find the maximum number of sessions running concurrently.  This tells how many incoming mmessages the host was receiving via SMTP.'
	--title "##HOST## - SMTP concurrency (##GRAPHTIME##)"
	--lower-limit 0
	--vertical-label 'sessions'
	DEF:concurrency=##DB##:concurrency:MAX
	CDEF:missing=concurrency,UN,INF,UNKN,IF
	'LINE2:concurrency###COLOR1##:sessions'
	'GPRINT:concurrency:MIN:min=%.0lf'
	'GPRINT:concurrency:AVERAGE:avg=%.0lf'
	'GPRINT:concurrency:MAX:max=%.0lf'
	'GPRINT:concurrency:LAST:cur=%.0lf'
	'AREA:missing###MISSING##:missing'

graph	sessions desc="how many sessions over a 5-min sample"
	--title "##HOST## - SMTP sessions (##GRAPHTIME##)"
	--lower-limit 0
	--vertical-label 'sessions/s'
	DEF:sessions=##DB##:sessions:AVERAGE
	CDEF:missing=sessions,UN,INF,UNKN,IF
	'LINE2:sessions###COLOR1##:sessions'
	'GPRINT:sessions:MIN:min=%.0lf'
	'GPRINT:sessions:AVERAGE:avg=%.0lf'
	'GPRINT:sessions:MAX:max=%.0lf'
	'GPRINT:sessions:LAST:cur=%.0lf'
	'AREA:missing###MISSING##:missing'
