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 program. 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
How to install DirectAdmin on VPS/Dedicated server?
Note: FOR DirectAdmin INSTALLATION YOU NEED TO HAVE A FRESH CENTOS INSTALL - Recommended amount...
How to Setup DirectAdmin Hosting Control Panel on CentOS 6 / 7?
The complete installation steps for DirectAdmin Web Hosting control Panel on CentOS 6 and CentOS...
How to create a Reseller Package in DirectAdmin?
Step 1: You need to log into your DirectAdmin panel with your admin user. Step 2: Then, click on...
How to create a Reseller Account in DirectAdmin?
Once you have your reseller package created, you can move onto creating your reseller’s...
How to create a User Package in DirectAdmin?
You can create user accounts either through the admin login or any reseller login. 1) Logged into...