#!/bin/bash /usr/bin/pgrep -x haproxy &> /dev/null if [ $? -ne 0 ]; then /usr/sbin/service haproxy start echo "" | mail -s "监测到haproxy进程不存在,已经重新启动" 邮箱 fi