恒美微站
首页
关于我们
建站服务
主题模板
案例展示
资讯中心
联系我们
superlance 的监控案例
首页
资讯中心
/
superlance 的监控案例
superlance 的监控案例
发布时间:2026/9/1 7:15:30
pip install superlance#案例1supervisord 管理监控脚本 monitor.sh 后台运行2监控脚本扫描监控业务进程状态,cat /etc/supervisord.d/listener.conf[eventlistener:nginx-exited] command/bin/bash /tmp/monitor.sh eventsPROCESS_STATE_EXITED redirect_stderrfalse stdout_logfile /tmp/listener.stdout.log stderr_logfile /tmp/listener.stderr.log#/tmp/monitor.sh#!/bin/bash while true do sleep 1 isokps -ef|grep -v group |grep group.sh|wc -l if [ $isok -lt 1 ] then echo date /tmp/alert.log #curl post #send alert /bin/bash /tmp/group.sh fi done#group.sh#!/bin/bash while true do sleep 30 done