使用大神监控工具监控memcache

发布于 2024-11-10 02:16:39 字数 900 浏览 3 评论 0原文

我正在尝试使用God监控工具来监控memcached。这是我的 memcached.god 文件:

God.watch do |w|
  w.name = "memcached"
  w.interval = 30.seconds # default
  w.start = "/etc/init.d/memcached start"
  w.stop = "killall memcached"
  w.restart = "/etc/init.d/memcached restart && sleep 1"
  w.start_grace = 10.seconds
  w.restart_grace = 10.seconds
  w.pid_file = "/var/run/memcached.pid"
  w.uid = "memcache"

  # clean pid files before start if necessary
  w.behavior(:clean_pid_file)

  w.start_if do |start|
    start.condition(:process_running) do |c| # check if process is running
        c.interval = 5.minute
        c.running = false
    end
  end
end

god load -c /path/to/memcached.god 不会给出任何错误。但是当我运行 god status 时,我没有看到 memcached,也没有看到 god log memcached 重新运行,

Please wait...
No such watch

我确信 god 监控正在运行,因为它对于 apache2 工作得很好。知道为什么我遇到这个问题吗?

I am trying to monitor memcached using god monitoring tool. Here is my memcached.god file:

God.watch do |w|
  w.name = "memcached"
  w.interval = 30.seconds # default
  w.start = "/etc/init.d/memcached start"
  w.stop = "killall memcached"
  w.restart = "/etc/init.d/memcached restart && sleep 1"
  w.start_grace = 10.seconds
  w.restart_grace = 10.seconds
  w.pid_file = "/var/run/memcached.pid"
  w.uid = "memcache"

  # clean pid files before start if necessary
  w.behavior(:clean_pid_file)

  w.start_if do |start|
    start.condition(:process_running) do |c| # check if process is running
        c.interval = 5.minute
        c.running = false
    end
  end
end

god load -c /path/to/memcached.god does not give any error. But when I run god status I don't see memcached and also god log memcached retruns

Please wait...
No such watch

I am sure god monitoring is running as it works fine for apache2. Any idea why an I having this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枕梦 2024-11-17 02:16:39

您现在可能已经明白了这一点,但为了将来的参考,这是运行它的方法:

god -c /path/to/memcached.god

You probably figured this out by now, but for future reference this is how to run it:

god -c /path/to/memcached.god
堇年纸鸢 2024-11-17 02:16:39

我认为你不想要 -c。尝试:

god load /path/to/memcached.god

至少,帮助是这么说的......

I don't think you want the -c. Try:

god load /path/to/memcached.god

At least, that is what the help says...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文