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 (Add icon.) icon.

7

Enter a name for the service monitor.

8

Enter the interval in seconds at which a server is to be pinged.

9

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

10

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

11

Select the way in which to send the health check request to the server from the drop-down menu.

12

For HTTP and HTTPS traffic, perform the steps below.

a

Enter the string that the monitor expects to match in the status line of HTTP response in the Expected section.

For example, 200,301,302,401.

b

Select the method to detect server status from the drop-down menu.

c

Enter the URL to be used in the sample request.

d

If you select the POST method, enter the data to be sent.

13

Enter the string to be matched in the response content in the Receive section.

If the string in the Expected section is not matched, the monitor does not try to match the Receive content.

14

Enter advanced monitor parameters as key=value pairs in the Extension section.

A sample extension, warning=10, indicates that if a server does not respond within 10 seconds, the status is set as warning.

All extension items should be separated with a carriage return character.

<extension>eregi="(OK1|OK2)"</extension>

Refer to the table for supported protocol extensions.

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-version=3

Force SSL handshake using sslv3.

sslv3 and tlsv1 are disabled in the health check option by default.

ssl-version=10

Force SSL handshake using tls 1.0.

ssl-version=11

Force SSL handshake using tls 1.1.

ssl-version=12

Force SSL handshake using tls 1.2.

ciphers=’ECDHE-RSA-AES256-GCM-SHA384’

Display ciphers used in HTTPS health check.

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.

15

Click OK.

Associate a service monitor with a pool.