mkdir -p /home/scrips
vim /home/scrips/monitor_serivce_redis.sh
Add the script below into the monitor_serivce_redis.sh file
!/bin/bash
serviceIsRunning=false
var1=$(/etc/init.d/redis status | awk ‘{print $3}’)
if [ “$var1” == ‘running’ ]
then
serviceIsRunning=true
echo “0:200:Running”
fi
if [ $serviceIsRunning == false ]
then
echo “2:404:stop”
fi