FinalBSD, Ace, I was hoping someone would add that feature. Just tested it and it works perfectly.
My tests were: 1) check index.html for value "mytesttext" - result - OK site up - CORRECT (text is present on my page) 2) check index.html for value "not found" - result - site down - CORRECT (text not present on my page) 3) check doesntexist.html for value "not found" - result - site down - CORRECT (even though text is present on apache error page) Ldirectord / LVS also has a seperate interval time for http health checks (so you can make it longer), and also the option to do x TCP checks followed by 1 HTTP/grep check (to lower the impact of health checks on the cluster) These are just ideas for improvements but core feature is very useful, thanks again. 2009/2/18 匡萃彪 <[email protected]> > > Hi folks, > I wrote a patch and add two new features for haproxy(1.3.15.7) yesterday . > > 1. HTTP-ECV(Extended Content Verification) monitor > > add "receive" keyword for HTTP-ECV monitor. > ECV monitors use specified request uri and receive String settings in > an attempt to > retrieve explicit content from backend nodes. The check is successful > when > the content matches the Receive String value. > Syntax: option httpchk GET /uri [receive <receive string>] [HTTP/1.0] > > ------------------------------------------------------------------------------------- > backend www > balance source > cookie SERVERID insert indirect > option httpchk GET /http-ecv.php receive "Hello World!" HTTP/1.0 > server www1 192.168.1.2:80 cookie A check port 80 inter 2000 rise 2 > fall 2 > > ------------------------------------------------------------------------------------- > > 2. When check the reply of services, only 2xx is OK . > > If 2xx and 3xx are OK, assuming the following : > > Apache configuration: > > ------------------------------------------------------------------------------------- > ErrorDocument 404 http://www.example.com/404.html > > ------------------------------------------------------------------------------------- > Haproxy Config: > > ------------------------------------------------------------------------------------- > option httpchk GET /check.php HTTP/1.0 > > ------------------------------------------------------------------------------------- > So, if the file(check.php,) does not exists on the server(s), the > check will be redircted to > http://www.example.com/404.html and get response code 302, it's still > will be OK, but actually it's not. > > Pls forgive my poor english and non-skilled C programming ability. > > Regards! > FinalBSD > > > -- Regards, Malcolm Turnbull. Loadbalancer.org Ltd. Phone: +44 (0)870 443 8779 http://www.loadbalancer.org/

