# rrds/qmail-smtplog - info from logs of qmail-smtpd (actually tcpserver for qmail-smtpd)
#
source	log
step 	300
data	concurrency	GAUGE:600:0:U	max : status: (\d+)
data	sessions	GAUGE: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="how many smtp processes are running at a time"
	--title "##HOST## - SMTP concurrency (##GRAPHTIME##)"
	--lower-limit 0
	--vertical-label 'sessions'
	DEF:concurrency=##DB##:concurrency:MAX
	'LINE2:concurrency###COLOR1##:sessions'
	'GPRINT:concurrency:MIN:min=%.0lf'
	'GPRINT:concurrency:AVERAGE:avg=%.0lf'
	'GPRINT:concurrency:MAX:max=%.0lf'
	'GPRINT:concurrency:LAST:cur=%.0lf'


graph	sessions desc="how many sessions over a 5-min sample"
	--title "##HOST## - SMTP sessions (##GRAPHTIME##)"
	--lower-limit 0
	--vertical-label 'sessions'
	DEF:sessions=##DB##:sessions:AVERAGE
	'LINE2:sessions###COLOR1##:sessions'
	'GPRINT:sessions:MIN:min=%.0lf'
	'GPRINT:sessions:AVERAGE:avg=%.0lf'
	'GPRINT:sessions:MAX:max=%.0lf'
	'GPRINT:sessions:LAST:cur=%.0lf'
