You create a service monitor to define health check parameters for a particular type of network traffic. When you associate a service monitor with a pool, the pool members are monitored according to the service monitor parameters

1

Log in to the vSphere Web Client.

2

Click Networking & Security and then click NSX Edges.

3

Double-click an NSX Edge.

4

Click Manage and then click the Load Balancer tab.

5

In the left navigation panel, click Service Monitoring.

6

Click the Add icon.

7

Type a name for the service monitor.

8

Type the interval at which a server is to be pinged.

9

Type the maximum time in seconds within which a response from the server must be received.

10

Type the number of times the server must be pinged before it is declared down.

11

Select the way in which you want to send the health check request to the server.

12

For HTTP and HTTPS traffic, perform the steps below.

a

In Expect, type the string that the monitor expects to match in the status line of HTTP response (for example, HTTP/1.1).

b

Select the method to be used to detect server status.

c

Type the URL to be used in the sample request.

d

If you selected the POST method, type the data to be sent.

e

In Receive, type the string to be matched in the response content.

If Expect is not matched, the monitor does not try to match the Receive content.

f

(Optional) In Extension, type advanced monitor parameters as key=value pairs. For example, warning=10 indicates that if a server does not respond within 10 seconds, its status is set as warning. All extension items should be separated with a carriage return character. For example:

<extension>delay=2
critical=3
escape</extension>

Refer to the table below for extensions supported for each protocol.

Extensions for TCP Protocol

Monitor Extension

Description

escape

Can use \n, \r, \t, or \ in send or quit string. Must come before send or quit option. Default: nothing added to send, \r\n added to end of quit.

all

All expect strings need to occur in server response. Default is any.

quit=STRING

String to send to server to initiate a clean close of the connection.

refuse=ok|warn|crit

Accept TCP refusals with states ok, warn, or criti Default is crit.

mismatch=ok|warn|crit

Accept expected string mismatches with states ok, warn, or crit. Default is warn.

jail

Hide output from TCP socket.

maxbytes=INTEGER

Close connection once more than the specified number of bytes are received.

delay=INTEGER

Seconds to wait between sending string and polling for response.

certificate=INTEGER[,INTEGER]

Minimum number of days a certificate has to be valid. The first value is #days for warning and the second value is critical (if not specified - 0).

ssl

Use SSL for the connection.

warning=DOUBLE

Response time in seconds to result in warning status.

critical=DOUBLE

Response time in seconds to result in critical status.

Extensions for HTTP/HTTPS Protocol

Monitor Extension

Description

no-body

Do not wait for document body: stop reading after headers. Note that this still does an HTTP GET or POST, not a HEAD.

max-age=SECONDS

Warn if document is more than SECONDS old. The number can also be in the form 10m for minutes, 10h for hours, or 10d for days.

content-type=STRING

specify Content-Type header media type in POST calls.

linespan

Allow regex to span newlines (must precede -r or -R).

regex=STRING or ereg=STRING

Search page for regex STRING.

eregi=STRING

Search page for case-insensitive regex STRING.

invert-regex

Return CRITICAL if found, OK if not.

proxy-authorization=AUTH_PAIR

Username:password on proxy-servers with basic authentication.

useragent=STRING

String to be sent in HTTP header as User Agent.

header=STRING

Any other tags to be sent in HTTP header. Use multiple times for additional headers.

onredirect=ok|warning|critical|follow|sticky|stickyport

How to handle redirected pages. sticky is like follow but stick to the specified IP address. stickyport also ensures port stays the same.

pagesize=INTEGER:INTEGER

Minimum page size required (bytes) : Maximum page size required (bytes).

warning=DOUBLE

Response time in seconds to result in warning status.

critical=DOUBLE

Response time in seconds to result in critical status.

Extensions for HTTPS Protocol

Monitor Extension

Description

sni

Enable SSL/TLS hostname extension support (SNI).

certificate=INTEGER

Minimum number of days a certificate has to be valid. Port defaults to 443. When this option is used the URL is not checked.

authorization=AUTH_PAIR

Username:password on sites with basic authentication.

13

Click OK.

Associate a service monitor with a pool.