Re: anybody know how to health check a twisted xmlrpc server?

From: David Birdsong <david.birdsong#gmail.com>
Date: Wed, 23 Dec 2009 22:40:17 -0800


On Wed, Dec 23, 2009 at 10:07 PM, David Birdsong <david.birdsong#gmail.com> wrote:
> On Wed, Dec 23, 2009 at 9:57 PM, Willy Tarreau <w#1wt.eu> wrote:
>> On Wed, Dec 23, 2009 at 09:48:15PM -0800, David Birdsong wrote:
>>> i see that POST is a valid httpchk parameter, but without ripping
>>> twisted apart, i'm not sure how it could allow an empty POST through
>>> to code that could return a 200 or 204.
>>>
>>> has anybody already gone through this?
>>
>> Never tested, but right now you can still post contents and headers,
>> though it's a ugly hack. It consists in appending the headers and
>> data after the HTTP version :
>>
>>        option httpchk POST /something HTTP/1.0\r\nContent-length:\ 7\r\n\r\nfoo=bar
>>
> i was wondering if contents were allowed after the headers.  i'll give
> it a shot.
>

ugly, and so far not working:
 option httpchk POST /db_api/lucene_check.php HTTP/1.0\r\n\r\n<?xml version="1.0" encoding="iso-8859-1"?> <methodCall>

<methodName>query</methodName> <params> <param> <value>
<string>kafjkdfajdfkjfkajdf</string> </value> </param> </params>
</methodCall>

if that line wrapped, i have it all on one line in the config.

tcpdump shows only this much coming through: <tcpdump>
POST /db_api/lucene_check.php HTTP/1.0

<?xml

HTTP/1.0 200 OK
</tcpdump>
>> I told you it was ugly :-)
>>
>> You may also have to specify a Host: header depending on your
>> service, and maybe even a content-type. Find about it by trial
>> and error. Please post your findings on the list, as I'm sure
>> other people might be interested too.
>>
>> Regards,
>> Willy
>>
>>
>
Received on 2009/12/24 07:40

This archive was generated by hypermail 2.2.0 : 2009/12/24 07:45 CET