Add the following in services. status:
The code is as follows: |
Copy code |
Servicename = ON Or: Servicename = OFF |
If the service name is in this list, ON indicates that dataskq will monitor the service, and OFF means no monitoring. Similar to other functions, if you click "stop" ON the DirectAdmin panel, directAdmin also sets the value above to OFF.
In addition, the following code is still useful and can be used to customize services for monitoring.
Many administrators run a lot of software on Linux systems. DirectAdmin does not check and monitor them to ensure they are running all the time. The following script allows administrators to monitor the running status of the program, as an example, we monitor a spamd program here. Replace the following content with your own information:
The code is as follows: |
Copy code |
#! /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 & amp; quot; Subject: spamd is downnnspamd is downn. nn & amp; quot; |/usr/sbin/exim your@email.com Fi Fi Exit 0; |
After changing this script to your own script, use the chmod command to change its permission to 755, and then set a regular script to check whether the script is running, directAdmin will check the running status of the program once every minute. However, the script cannot determine whether an email is sent after the program fails, so if your program is always there, your mailbox is expected to receive a warning email every minute, so it is enough to set the monitoring interval to 5 to 10 minutes.