Here’s a trivial old script that I sometimes use to monitor for rough processes running on the apache user:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/bash TEST=`ps auxw | grep apache | grep -v "httpd" | grep -v apachewatch | grep -v grep ` if [ "$TEST" != "" ]; then echo "test"; echo "Subject: RP apache alert To: support@reliablepenguin.com Alert ... something fishy on RP ... ------- $TEST ------- " | /usr/sbin/sendmail support@reliablepenguin.com fi |