Fix grapher
This commit is contained in:
parent
11fd5e0a71
commit
cda058b33d
171
grapher.sh
171
grapher.sh
|
@ -6,141 +6,44 @@ 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'
|
||||
period_filenames=("hour.png" "6hours.png" "day.png" "week.png" "month.png" "6months.png" "year.png")
|
||||
period_startparams=("end-1h" "end-6h" "end-24h" "end-7d" "end-1m" "end-6m" "end-1y")
|
||||
period_texts=("Last hour" "Last 6 hours" "Last day" "Last week" "Last month" "Last 6 months" "Last year")
|
||||
|
||||
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'
|
||||
for index in ${!period_filenames[*]}; do
|
||||
filename=${period_filenames[$index]}
|
||||
startparam=${period_startparams[$index]}
|
||||
text=${period_texts[$index]}
|
||||
|
||||
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'
|
||||
# Draw the graphs
|
||||
|
||||
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'
|
||||
# Outbound mail
|
||||
rrdtool graph $GRAPHDIR/$filename \
|
||||
--start $startparam \
|
||||
--step 60 \
|
||||
--title "Mail statistics for `hostname -f` - $text" \
|
||||
--vertical-label "mails/minute" \
|
||||
-h 200 -w 800 --slope-mode \
|
||||
DEF:mo_sent=$RRDFILE:mo_sent:AVERAGE \
|
||||
DEF:mo_deferred=$RRDFILE:mo_deferred:AVERAGE \
|
||||
DEF:mo_bounced_total=$RRDFILE:mo_bounced_total:AVERAGE \
|
||||
DEF:mo_bounced_spam=$RRDFILE:mo_bounced_spam:AVERAGE \
|
||||
DEF:mo_bounced_reputation=$RRDFILE:mo_bounced_reputation:AVERAGE \
|
||||
DEF:mo_deliverable=$RRDFILE:mo_deliverable:AVERAGE \
|
||||
DEF:mo_undeliverable=$RRDFILE:mo_undeliverable:AVERAGE \
|
||||
AREA:mo_deferred#77777733 \
|
||||
LINE:mo_deferred#777777:'deferred' \
|
||||
AREA:mo_sent#00DD0055 \
|
||||
LINE:mo_sent#00DD00:'sent' \
|
||||
AREA:mo_deliverable#00AA0077 \
|
||||
LINE:mo_deliverable#00AA00:'deliverable' \
|
||||
AREA:mo_undeliverable#AA880077 \
|
||||
LINE:mo_undeliverable#AA8800:'undeliverable' \
|
||||
AREA:mo_bounced_total#0000FF77 \
|
||||
LINE:mo_bounced_total#0000FF:'bounced total' \
|
||||
AREA:mo_bounced_spam#FF0000AA \
|
||||
LINE:mo_bounced_spam#FF0000:'bounced due to SPAM' \
|
||||
AREA:mo_bounced_reputation#FF00FFFF \
|
||||
LINE:mo_bounced_reputation#FF00FFFF:'reputation event'
|
||||
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue