postfix-stats/grapher.sh

147 lines
5.9 KiB
Bash
Raw Normal View History

2018-05-03 19:58:08 +02:00
#!/bin/bash
# Go into appropriate directory
cd `dirname $0`
# Load settings
. ./settings.sh
rrdtool graph $GRAPHDIR/hour.png \
--start end-1h \
--step 60 \
2018-05-04 15:20:04 +02:00
--title "Mail statistics for `hostname -f` - Last hour" \
2018-05-03 19:58:08 +02:00
--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 \
2018-05-04 15:20:04 +02:00
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'
2018-05-03 19:58:08 +02:00
rrdtool graph $GRAPHDIR/6hour.png \
--start end-6h \
--step 60 \
2018-05-04 15:20:04 +02:00
--title "Mail statistics for `hostname -f` - Last 6 hours" \
2018-05-03 19:58:08 +02:00
--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 \
2018-05-04 15:20:04 +02:00
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'
2018-05-03 19:58:08 +02:00
rrdtool graph $GRAPHDIR/day.png \
--start end-24h \
--step 60 \
2018-05-04 15:20:04 +02:00
--title "Mail statistics for `hostname -f` - Last day" \
2018-05-03 19:58:08 +02:00
--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 \
2018-05-04 15:20:04 +02:00
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'
2018-05-03 19:58:08 +02:00
rrdtool graph $GRAPHDIR/week.png \
--start end-7d \
--step 60 \
2018-05-04 15:20:04 +02:00
--title "Mail statistics for `hostname -f` - Last week" \
2018-05-03 19:58:08 +02:00
--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 \
2018-05-04 15:20:04 +02:00
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'
2018-05-03 19:58:08 +02:00