1847052 Members
4935 Online
110261 Solutions
New Discussion

Re: script for mwm

 
Earl Rodriguez
New Member

script for mwm

Need a script for mwm - that monitors and sleep for a few minutes then starts the daemon when it is down.
2 REPLIES 2
Mel Burslan
Honored Contributor

Re: script for mwm

mwa status | grep -e scopeux -e midaemon -e ttd -e alarmgen -e agdbserver -e perflbd -e rep_server > /tmp/checkfile
cat /tmp/checkfile | while read line
do
firstword=`echo $line | awk {'print $1'}`
if [ "$firstword" != "Running" ]
then
mwa restart
fi
done



you can fire-up this script from cron every so many minutes or you can put it in a

while true
do
above_script
sleep $NUMBER # waits NUMBER seconds
done


I prefer cron approach though.

You can go more elaborate and parse the line in the script for the subsystem and if one subsystem fails you can only start or restart that one.

Also keep in mind that these subsystems are specific to one of my servers. Yours may be different. If so, change the "grep -e" phrases on the first line to reflect which subsytems running on your server. You can get that information by simply running

mwa status

command.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Tim Nelson
Honored Contributor

Re: script for mwm

Earl,

Are you having a problem with the MWA processes running ? In the 10 years running MWA there were only two reasons that I have had issues. 1) filesystem full 2) corrupt log file usually due to a filesystem full issue.

You may be chasing the tail of some other problem. Fix the source if it exists.