首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用monit对puma服务器进行监控

无法使用monit对puma服务器进行监控
EN

Stack Overflow用户
提问于 2016-12-16 17:52:22
回答 1查看 793关注 0票数 1

我的mmonit配置文件:

代码语言:javascript
复制
  check process qifu with pidfile /var/www/qifu/tmp/pids/puma.pid
    start program = "/bin/bash -l -c 'cd /var/www/qifu && pumactl -F config/puma_production.rb start'" with timeout 60 seconds
    stop program  = "/bin/bash -l -c 'cd /var/www/qifu && pumactl -F config/puma_production.rb stop'"
    if cpu > 60% for 2 cycles then alert
    if cpu > 80% for 5 cycles then restart
    if 3 restarts within 5 cycles then timeout

当我直接从终端执行start和stop命令时,它起作用了,但mmonit不起作用。

EN

回答 1

Stack Overflow用户

发布于 2018-12-14 01:36:50

看起来你需要切换用户。尝试将命令更改为以/bin/su - <user> -c开头,以便您的代码变为:

代码语言:javascript
复制
check process qifu with pidfile /var/www/qifu/tmp/pids/puma.pid
    start program = "/bin/su - <user> -c 'cd /var/www/qifu && pumactl -F config/puma_production.rb start'" with timeout 60 seconds
    stop program  = "/bin/su - <user> -c 'cd /var/www/qifu && pumactl -F config/puma_production.rb stop'"
    if cpu > 60% for 2 cycles then alert
    if cpu > 80% for 5 cycles then restart
    if 3 restarts within 5 cycles then timeout
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41181559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档