Evil_TTL> show | s

Health Monitor on F5

Category:F5 -> LTM

HTTP/HTTPS Health Monitor

Default Send String:

GET /\r\n 

This will use HTTP0.9 request. Some servers may not support this version.

Below example for how to use HTTP1.1

GET HTTP/1.1\r\nHost: <example.com>\r\nConnectionClose\r\n\r\n 

A client MUST include HOST header field. Otherwise the server will return http/1.1 400 Bad Request error:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<
html  lang="en" xml:lang="en">
<
head>
<
title>Bad request!</title>
<
link rev="made" href="mailto:root@localhost" />
<
style type="text/css"><!--/*--><![CDATA[/*><!--*/ 
    
body { color#000000; background-color: #FFFFFF; }
    
a:link { color#0000CC; }
    
paddress {margin-left3em;}
    span {font
-sizesmaller;}
/*]]>*/--></style>
</
head>

<
body>
<
h1>Bad request!</h1>
<
p>


    
Your browser (or proxysent a request that
    this server could not understand
.

</
p>
<
p>
If 
you think this is a server errorplease contact
the 
<a href="mailto:root@localhost">webmaster</a>.

</
p>

<
h2>Error 400</h2>
<
address>
  <
a href="/"> </a><br />
  
  <
span>Tue Jun  5 14:24:08 2018<br />
  
Apache</span>
</
address>
[removed]if (top.pageUtilities{ top.pageUtilities.addFrameDocument(document); }[removed][removed]if (top.pageUtilities{ top.pageUtilities.addFrameDocument(document); }[removed]</body>
</
html

Receive string should match a key word in the reply from the server.

Example how to use OR to match either of the results:

Found|302|200 

NOTE. Receive string will match first occurrence in the reply.

Before configuring Send and Receive strings we can simulate them in advance on LTM/GTM as a client and real destination HTTP/HTTPS server.

Use CLI to login onto LTM/GTM and get into advanced shell by typing:

bash 

Monitor HTTP:

(echo -ne "Monitor String"cat) | nc 'Pool Member IP' 'Pool member port' 

Monitor HTTPS:

(echo -ne "Monitor String"cat) | openssl s_client -connect 'Pool Member IP':'Pool member port' -quiet 

Example:

(echo -ne "GET / HTTP/1.1\r\nHost: www.company.com\r\nConnection: Close\r\n\r\n"cat) | nc 1.2.3.4 80
(echo -ne "GET / HTTP/1.1\r\nHost: www.company.com\r\nConnection: Close\r\n\r\n"cat) | openssl s_client -connect 1.2.3.4:443 -quiet 

Example of a reply:

HTTP/1.1 302 Found
Date
Tue05 Jun 2018 04:21:07 GMT
Server
Apache
X
-Frame-OptionsSAMEORIGIN
Set
-Cookie:
Location:
VaryAccept-Encoding
Connection
close
Transfer
-Encodingchunked
Content
-Typetext/htmlcharset=iso-8859-1

298
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<
html><head>
<
title>302 Found</title>
</
head><body>
<
h1>Found</h1>
<
p>The document has moved <a href="">here</a>.</p>
[removed]if (top.pageUtilities{ top.pageUtilities.addFrameDocument(document); }[removed]</body></html
By privilege15