PRTG giám sát dịch vụ redis up/down thông qua bash script – PRTG monitoring service redis up/down via bash script

on
  1. Monitoring on CentOS 6

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

Leave a Reply

Your email address will not be published. Required fields are marked *