Skip to content

Instantly share code, notes, and snippets.

@kimlindholm
Created February 13, 2012 14:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kimlindholm/1817400 to your computer and use it in GitHub Desktop.
Save kimlindholm/1817400 to your computer and use it in GitHub Desktop.
Send Munin generated Varnish statistics by e-mail
#!/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
@kimlindholm
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment