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.
Mest populär
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 use DirectAdmin PHP Version Selector?
Login as user.Under Your Account, click on Domain Setup. Click on the domain name. After that,...
DirectAdmin Locations of Logs
DirectAdmin Logs Description Location Error Logs...
Changing DirectAdmin's "admin" account password
Login as root via SSH to your VPS, then perform the following command: passwd admin You can...