monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[monit] monit-or-ing a status code returned by URI


From: Elijah Wright
Subject: [monit] monit-or-ing a status code returned by URI
Date: Fri, 18 Jan 2008 21:47:30 -0500


hello,

we are using monit to monitor the status of a rails application running inside a mongrel server.

we want to know that the application thinks it is functional, not just that the mongrel is 'up'.

our rails app has a URI, http://localhost:port/status, that returns either "OK" or "ERROR", depending on the status of the mongrel and the rails app (which will error if, for example, it can't find the files that it needs to run.  :) ).

I've got a monit config line sort of like this... and would like to use an 'or' predicate rather than 'and'.  Does that work?  I can't find any examples...

#
#  this doesn't work, but it does basically what i want... if it can't
#  load the status page then the mongrel must be broken,
#  and if content matches "ERROR" then we also know that
#  it is broken and that we should restart the monitored mongrel.
#
if failed url http:////localhost:9001/status or content = "ERROR" then restart
#

Obviously there's more to the monit config section (check process mongrel, etc...), but hopefully this is enough
to make the nature of my question obvious... is there a better way to do this with monit?

thanks,

--elijah wright
address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]