Resource icon

Service Monitor and Restart Script

Matt

Owner
Matt submitted a new resource:

Service Monitor and Restart Script - Monitor and Restart Processes

Create a new file called process.txt in the /root/scripts folder (you might need to also make the /root/scripts folder)

Get a list of the processes you want to monitor from the ps -ef output
Bash:
/usr/sbin/mysqld
/usr/bin/memcached
/usr/libexec/postfix/master
/bin/java
and add them to this file.

Code:
#!/bin/bash
echo "Checking all processes are running....";
for i in `/bin/cat /root/scripts/process.txt`
do
        if
        [ $(ps aux | grep -e "$i" | grep -v grep | wc...
Read more about this resource...
 
Top