check process nginx with pidfile /run/nginx.pid
start program = "/usr/bin/sudo service nginx start" with timeout 30 seconds
restart program = "/usr/bin/sudo service nginx restart"
if failed port 80 type tcp then alert
if failed port 80 type tcp then restartnginx
或者tcp
# 匹配进程名
check process mongo MATCHING mongo
# 配置服务启动和重启命令
start program = "/usr/bin/sudo service mongod start"
restart program = "/usr/bin/sudo service mongod restart"
# 若是端口27017没法访问则认为服务失败,发报警邮件并重启服务
if failed port 27017 type tcp then alert
if failed port 27017 type tcp then restartrest
# 若是在三个周期内重启了3次,则再也不监控
# if 3 restarts within 3 cycles then unmonitor进程