#!/bin/bash # Go into appropriate directory cd `dirname $0` # Load settings . ./settings.sh rrdtool graph $GRAPHDIR/hour.png \ --start end-1h \ --step 60 \ --title "Mail statistics for `hostname -f` - Last hour" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event' rrdtool graph $GRAPHDIR/6hour.png \ --start end-6h \ --step 60 \ --title "Mail statistics for `hostname -f` - Last 6 hours" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event' rrdtool graph $GRAPHDIR/day.png \ --start end-24h \ --step 60 \ --title "Mail statistics for `hostname -f` - Last day" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event' rrdtool graph $GRAPHDIR/week.png \ --start end-7d \ --step 60 \ --title "Mail statistics for `hostname -f` - Last week" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event' rrdtool graph $GRAPHDIR/month.png \ --start end-1m \ --step 60 \ --title "Mail statistics for `hostname -f` - Last month" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event' rrdtool graph $GRAPHDIR/year.png \ --start end-1y \ --step 60 \ --title "Mail statistics for `hostname -f` - Last year" \ --vertical-label "mails/minute" \ -h 200 -w 800 --slope-mode \ DEF:log_lines=$RRDFILE:log_lines:AVERAGE \ DEF:mail_sent=$RRDFILE:mail_sent:AVERAGE \ DEF:mail_deferred=$RRDFILE:mail_deferred:AVERAGE \ DEF:mail_bounced_total=$RRDFILE:mail_bounced_total:AVERAGE \ DEF:mail_bounced_spam=$RRDFILE:mail_bounced_spam:AVERAGE \ DEF:mail_bounced_reputation=$RRDFILE:mail_bounced_reputation:AVERAGE \ AREA:mail_deferred#77777733 \ LINE:mail_deferred#777777:'deferred' \ AREA:mail_sent#00DD0055 \ LINE:mail_sent#00DD00:'sent' \ AREA:mail_bounced_total#0000FF77 \ LINE:mail_bounced_total#0000FF:'bounced total' \ AREA:mail_bounced_spam#FF0000AA \ LINE:mail_bounced_spam#FF0000:'bounced due to SPAM' \ AREA:mail_bounced_reputation#FF00FFFF \ LINE:mail_bounced_reputation#FF00FFFF:'reputation event'