监控haproxy宕机重启脚本

#!/bin/bash
/usr/bin/pgrep -x haproxy &> /dev/null
if [ $? -ne 0 ]; then
  /usr/sbin/service haproxy start
  echo "" | mail -s "监测到haproxy进程不存在,已经重新启动" 邮箱
fi
posted @ 2020-03-26 09:38  荣神益人  阅读(417)  评论(0编辑  收藏  举报