Many admins run extra pieces of software that DA does not check for, to make sure it's running. This is a simple script that enables an admin to keep an eye on any extra software he's running. In this example, we'll be checking on the spamd proram. Replace the bold items with your own info where applicable.
#!/bin/sh
COUNT=`ps -ax | grep -v grep | grep -c spamd`
if [ $COUNT -eq 0 ]; then
#the command used to start spamd
/usr/bin/spamd -d -c -m 5
sleep 3
COUNT=`ps -ax | grep -v grep | grep -c spamd`
if [ $COUNT -eq 0 ]; then echo -e "Subject: spamd is downnnspamd is downn.\n\n" | /usr/sbin/exim your@email.com
fi
fi
exit 0;
Throw that code into your own script file, chmod it to 755, then add a root cronjob to check on it as often as you like. DA checks for services once per minute. However, this script doesn't know if it just sent an email the previous minute, so if the service is still down, you'll get one email every minute. So maybe every 5 or 10 minutes is sufficient.
Most Popular Articles
Change email password without logging in
If you would like your pop users to be able to change their own email passwords without having to...
Setting up DirectAdmin with an SSL certificate
You can switch DirectAdmin to use SSL instead of plain text. -> https instead of http on port...
How to customize the output of webalizer
DirectAdmin uses the default webalizer settings by not specifying a webalizer.conf file at all....
How to allow webalizer stats to be viewable through the web
If a User does not want to have to login to DirectAdmin each time he accesses his webstats, a...
How to setup /~username/domain.com
If you wish to be able to control all domain on an account before they resolve, you can do so by...