使用神监控工具监控memcache

时间:2011-05-26 02:13:33

标签: memcached 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不会给出任何错误。但是当我运行上帝状态时,我没有看到memcached和上帝日志记忆重建

Please wait...
No such watch

我确信上帝监控正在运行,因为它适用于apache2。知道为什么我有这个问题。

2 个答案:

答案 0 :(得分:0)

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

god load /path/to/memcached.god

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

答案 1 :(得分:0)

您现在可能已经想到了这一点,但是为了将来参考,这是如何运行它:

god -c /path/to/memcached.god