# rrds/sendmaillog - message, byte and delivery counts for sendmail
# This is only useful if you're running sendmail.  It will count the new
# messages and message bytes and the deliveries attempted and how they fared.
# I need some data to improve the patterns for delfail and deldefer.  Send me
# lines from the log which were defered and failed, different kinds if there
# is more than one kind of message.
source		log
step		300
data		messages GAUGE:600:0:U	count sendmail\[\d+\]:\s+\S+\s+from=
data		bytes	GAUGE:600:0:U	sum sendmail\[\d+\]:\s+\S+\s+from=\S+, size=(\d+)
data		del	GAUGE:600:0:U	count sendmail\[\d+\]:\s+\S+\s+to=
data		delok	GAUGE:600:0:U	count sendmail\[\d+\]:\s+\S+\s+to=.*, stat=Sent
data		delfail	GAUGE:600:0:U	count sendmail\[\d+\]:\s+\S+\s+to=.*, stat=[A-RT-Z]
data		deldefer GAUGE:600:0:U	count sendmail\[\d+\]:\s+\S+\s+to=.*, stat=0
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		sendmailmsg
		--title '##HOST## - Sendmail Messages (##GRAPHTIME##)'
		--lower-limit 0
		--vertical-label 'messages'
		DEF:messages=##DB##:messages:AVERAGE
		'LINE2:messages###COLOR1##:Messages'
		'GPRINT:messages:MAX:max=%.0lf%s'

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

graph		sendmaildel
		--title '##HOST## - Sendmail 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:delfail###PROBLEMCOLOR##:failures'
		'LINE2:deldefer###COLOR1##:deferrals'
		'LINE2:delok###COLOR2##:successes'
		'LINE2:del###COLOR3##:total'
		'GPRINT:del:MAX:max=%.0lf%s'

