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 restart
或者
# 匹配进程名 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 restart
# 如果在三个周期内重启了3次,则不再监控 # if 3 restarts within 3 cycles then unmonitor
(adsbygoogle = window.adsbygoogle || []).push({});
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有