From d60a9e5a390f31fec70f10de50f7055ad86798a5 Mon Sep 17 00:00:00 2001 From: Baptiste Assmann Date: Sat, 25 Apr 2015 16:27:23 +0200 Subject: [PATCH] DOC: tcpcheck comment documentation Introduction of new tcpcheck comment directive and also update texpcheck ruleset examples. --- doc/configuration.txt | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index c5e0e2105..9c009432a 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -5611,34 +5611,47 @@ option tcp-check In this mode, many questions may be sent and many answers may be analysed. + A fifth mode can be used to insert comments in different steps of the + script. + + For each tcp-check rule you create, you can add a "comment" directive, + followed by a string. This string will be reported in the log and stderr + in debug mode. It is useful to make user-friendly error reporting. + The "comment" is of course optional. + + Examples : # perform a POP check (analyse only server's banner) option tcp-check - tcp-check expect string +OK\ POP3\ ready + tcp-check expect string +OK\ POP3\ ready comment POP\ protocol # perform an IMAP check (analyse only server's banner) option tcp-check - tcp-check expect string *\ OK\ IMAP4\ ready + tcp-check expect string *\ OK\ IMAP4\ ready comment IMAP\ protocol # look for the redis master server after ensuring it speaks well # redis protocol, then it exits properly. # (send a command then analyse the response 3 times) option tcp-check + tcp-check comment PING\ phase tcp-check send PING\r\n - tcp-check expect +PONG + tcp-check expect +PONGe + tcp-check comment role\ check tcp-check send info\ replication\r\n tcp-check expect string role:master + tcp-check comment QUIT\ phase tcp-check send QUIT\r\n tcp-check expect string +OK forge a HTTP request, then analyse the response (send many headers before analyzing) option tcp-check + tcp-check comment forge\ and\ send\ HTTP\ request tcp-check send HEAD\ /\ HTTP/1.1\r\n tcp-check send Host:\ www.mydomain.com\r\n tcp-check send User-Agent:\ HAProxy\ tcpcheck\r\n tcp-check send \r\n - tcp-check expect rstring HTTP/1\..\ (2..|3..) + tcp-check expect rstring HTTP/1\..\ (2..|3..) comment check\ HTTP\ response See also : "tcp-check expect", "tcp-check send"