Skip to content

Instantly share code, notes, and snippets.

@dave1010
Created November 30, 2010 17:31
Show Gist options
  • Save dave1010/722024 to your computer and use it in GitHub Desktop.
Save dave1010/722024 to your computer and use it in GitHub Desktop.
notify-apache-errors.sh
#!/bin/bash
# use ubuntu's notification system to let us know when there's something new in the apache error log
tail -n0 -f /var/log/apache2/error.log | while read line
do
body=`echo $line | cut -f 9- -d ' '`
notify-send -c im.received -i error "Apache / PHP error" "$body"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment