Search code examples
memcachedgod

Using god monitoring tool to monitor memcache


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.


Solution

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

    god -c /path/to/memcached.god