aqs*_*aqs 3 monit system-monitoring
是否可以用于monit
计算流程的实例数(在我的情况下Celery
)并相应地采取行动。
例如,如果有 4 个 celery 守护进程实例,则采取行动
这应该可以使用简短的 shell 脚本和程序状态测试来实现。就像是
check program countCelery with path /usr/local/bin/countCelery.sh with timeout 600 seconds:
if status != 0 alert
Run Code Online (Sandbox Code Playgroud)
使用 shell 脚本,如:
#!/bin/bash
celery_count=$(pgrep -c Celery)
if [[ $celery_count -gt 4 ]]; then
exit 1
else:
exit 0
fi
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1554 次 |
最近记录: |