Skip to content

Instantly share code, notes, and snippets.

@zobzn
Created September 3, 2013 09:10
Show Gist options
  • Save zobzn/6421476 to your computer and use it in GitHub Desktop.
Save zobzn/6421476 to your computer and use it in GitHub Desktop.
apache error notify
#!/bin/bash
# use ubuntu's notification system to let us know when there's something new in the apache error log
# requires package libnotify-bin
# tail -n0 -f /var/log/apache2/error.log | egrep 'Notice|Warning|Error|Fatal' | while read line
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