Hi again Brady,
You are quite right. I didn't consider the case where there are load-
balancing or a round-robin setup with several servers answering for
the same domain. In this scenario your patch seems definitely useful.
If you would go just a little bit further with your patch we'll be
happy to accept it. Instead of setting just the host header lets make
it general so it is possible to set any HTTP-headers. I propose the
following syntax:
if failed host localhost port 6000 protocol http with http-headers
[Host:example.com],
[Cookie:name=value; path=/] and request '/testing' with timeout
20 seconds for 2 cycles
then restart
In this case the sub-statement "with http-headers [name:value]+" is
_optionally_ associated with the "protocol http" statement instead of
the request statement.
That is, in p.y it is something like this: (not sure if the lexer
returns unqualified tokens anymore such as '[' though).
| PROTOCOL HTTP request
| PROTOCOL HTTP httpheaderlist request
.....
httpheaderlist : httpheader
| httpheaderlist httpheader
;
httpheader : '['STRING':'STRING']' {
// Do something clever
};
On 1. okt. 2009, at 04.12, Brady Catherman wrote:
On Sep 30, 2009, at 7:02 PM, Jan-Henrik Haukeland wrote:
On 1. okt. 2009, at 02.58, Brady wrote:
if failed host localhost port 6000 protocol http and request '/
testing' hostheader 'example.com' with timeout 20 seconds for 2
cycles then restart
Just to clarify, this statement which you can write in Monit
already produce the same request as in your patch:
if failed host example.com port 6000 protocol http and request '/
testing' then restart
That works if you have a fairly simple server setup, but if you have
10 hosts sitting behind a CNAME then your suggested approach will
not do the right thing. It will connect to one of the 10 hosts, and
if it works then it will allow the local host to survive. Even
worse, if your service sites behind a globally load balanced pool
then draining traffic away from a location will disable all local
protocol checking.
In our case we have several layers of front ends between the
resolvable host name, and the software we are monitoring. We monitor
the port/IP pair and try to wrap configuration such that monit's
requests make it through, but this patch allows us to just fetch the
host name we expect without any special cases in our software configs.
- Brady
_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev
_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev