Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Send Munin generated Varnish statistics by e-mail
VARNISH_LOCATION="Tokyo"
REPORT_PATH=/var/www/html/munin/localhost/localhost
EMAIL_RECIPIENT="admin@example.com"
EMAIL_SUBJECT="Varnish Weekly Statistics"
EMAIL_BODY="Weekly statistics attached."
hash mutt 2>&- || { echo -e >&2 "\nMutt not installed, aborting.\n"; exit 1; }
echo $EMAIL_BODY | mutt -s "$EMAIL_SUBJECT ($VARNISH_LOCATION)" \
-a $REPORT_PATH/varnish_cachehitratio-week.png \
-a $REPORT_PATH/varnish_hitrate-week.png \
-a $REPORT_PATH/varnish_total_objects-week.png \
-a $REPORT_PATH/varnish_allocated-week.png \
-a $REPORT_PATH/df-week.png \
-a $REPORT_PATH/threads-week.png \
-a $REPORT_PATH/cpu-week.png \
-a $REPORT_PATH/memory-week.png \
-- $EMAIL_RECIPIENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.