Redis 服务监控, 

 

ps=`ps -efl|grep redis|grep -v $0|grep -v grep|wc -l`
if [ $ps -eq 0 ];
then
    echo -e "\n$(date '+%Y-%m-%d %H:%M:%S') start "
    /etc/init.d/redis start 
    echo "$(date '+%Y-%m-%d %H:%M:%S') done"
else
	echo $(date +%F%n%T) "redis正在运行..."
    exit 0;
fi

 

复制上面的代码, 放到宝塔的计划任务, 就能监控redis是否正常, 挂了就会重启redis。 

 

特记录一下。 

 

相关文章:

  • 2021-10-17
  • 2021-08-24
  • 2021-08-13
  • 2021-07-19
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案