# rrds/qmaillog - byte, message and delivery counts for qmail
# This is only useful if you're running qmail.  It will show new message
# count, message bytes, number of deliveries attempted, and how they fared,
# and the max concurrency during each period, local and remote.
source		log
step		300
data		messages GAUGE:600:0:U	count info msg
data		bytes	GAUGE:600:0:U	sum info msg \d+: bytes (\d+)
data		del	GAUGE:600:0:U	count starting delivery
data		delok	GAUGE:600:0:U	count delivery \d+: success
data		delfail	GAUGE:600:0:U	count delivery \d+: failure
data		deldefer GAUGE:600:0:U	count delivery \d+: deferral
data		localmax GAUGE:600:0:U	max status: local (\d+)
data		remotemax GAUGE:600:0:U	max status: local \d+/\d+ remote (\d+)
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 3month year

graph		qmailmsg
		--title '##HOST## - QMail Messages (##GRAPHTIME##)'
		--lower-limit 0
		--vertical-label 'messages'
		DEF:messages=##DB##:messages:AVERAGE
		'LINE2:messages###COLOR1##:Messages'
		'GPRINT:messages:AVERAGE:avg=%.0lf%s'
		'GPRINT:messages:MAX:max=%.0lf%s'

graph		qmailmsgbytes
		--title '##HOST## - QMail Msg-bytes (##GRAPHTIME##)'
		--lower-limit 0
		--vertical-label 'bytes'
		DEF:bytes=##DB##:bytes:AVERAGE
		'LINE2:bytes###COLOR1##:Msg Bytes'
		'GPRINT:bytes:AVERAGE:avg=%.0lf%s'
		'GPRINT:bytes:MAX:max=%.0lf%s'

graph		qmaildel
		--title '##HOST## - QMail Deliveries (##GRAPHTIME##)'
		--lower-limit 0
		--vertical-label 'deliveries'
		DEF:del=##DB##:del:AVERAGE
		DEF:delok=##DB##:delok:AVERAGE
		DEF:deldefer=##DB##:deldefer:AVERAGE
		DEF:delfail=##DB##:delfail:AVERAGE
		'LINE2:del###COLOR3##:total'
		'LINE2:delfail###PROBLEMCOLOR##:failures'
		'LINE2:deldefer###COLOR1##:deferrals'
		'LINE2:delok###COLOR2##:successes'
		'GPRINT:del:AVERAGE:avg=%.0lf%s'
		'GPRINT:del:MAX:max=%.0lf%s'

graph		qmailconcurrency
		--title '##HOST## - QMail Concurrency (##GRAPHTIME##)'
		--lower-limit 0
		--vertical-label 'processes'
		DEF:local=##DB##:localmax:AVERAGE
		DEF:remote=##DB##:remotemax:AVERAGE
		'LINE2:remote###COLOR1##:remote'
		'LINE2:local###COLOR2##:local'
		'GPRINT:local:AVERAGE:local avg=%.0lf%s'
		'GPRINT:remote:AVERAGE:remote avg=%.0lf%s'

