HealthMonitor

Description

API


    POST /api/healthmonitor
    PUT /api/healthmonitor/<key>
    DELETE /api/healthmonitor/<key>
    GET /api/healthmonitor
    GET /api/healthmonitor/<key>

CLI


    configure healthmonitor <key>
    show healthmonitor <key>

Examples

To create a basic HTTP health monitor that uses GET / to determine if the service is alive

 POST /api/healthmonitor

{
    "receive_timeout": 4, 
    "name": "http-hmon", 
    "failed_checks": 3, 
    "send_interval": 10, 
    "http_monitor": {
        "http_request": "GET / HTTP/1.0", 
        "http_response_code": [
            {
                "code": "HTTP_2XX"
            }
        ]
    }, 
    "type": "HEALTH_MONITOR_HTTP"
}
 

Data

HealthMonitor

uuid

Type
string
Category
required
Description
UUID of the health monitor.

name

Type
string
Category
required
Description
A user friendly name for this health monitor.

send_interval

Type
int32
Category
optional
Description
Frequency, in seconds, that monitors are sent to a server.
Default
10

receive_timeout

Type
int32
Category
optional
Description
A valid response from the server is expected within the receive timeout window. This timeout must be less than the send interval. If server status is regularly flapping up and down, consider increasing this value.
Default
4

successful_checks

Type
int32
Category
optional
Description
Number of continuous successful health checks before server is marked up.
Default
2

failed_checks

Type
int32
Category
optional
Description
Number of continuous failed health checks before the server is marked down.
Default
2

type

Type
enum
Category
required
Description
Type of the health monitor.
Choices
HEALTH_MONITOR_TCP, HEALTH_MONITOR_HTTPS, HEALTH_MONITOR_EXTERNAL, HEALTH_MONITOR_UDP, HEALTH_MONITOR_DNS, HEALTH_MONITOR_HTTP, HEALTH_MONITOR_PING

tcp_monitor

Type
HealthMonitorTcp
Category
optional
Description

http_monitor

Type
HealthMonitorHttp
Category
optional
Description

https_monitor

Type
HealthMonitorHttp
Category
optional
Description

external_monitor

Type
HealthMonitorExternal
Category
optional
Description

udp_monitor

Type
HealthMonitorUdp
Category
optional
Description

dns_monitor

Type
HealthMonitorDNS
Category
optional
Description

monitor_port

Type
int32
Category
optional
Description
Use this port instead of the port defined for the server in the Pool. If the monitor succeeds to this port, the load balanced traffic will still be sent to the port of the server defined within the Pool.

description

Type
string
Category
optional
Description

tenant_ref

Type
Reference to Tenant
Category
required
Description

HealthMonitorTcp

tcp_request

Type
string
Category
optional
Description
Request data to send after completing the TCP handshake.

tcp_response

Type
string
Category
optional
Description
Match for the desired keyword in the first 2Kb of the server's UDP response. If this field is left blank, no server response is required.

HealthMonitorHttp

http_request

Type
string
Category
optional
Description
Send an HTTP request to the server. The default GET / HTTP/1.0 may be extended with additional headers or information. For instance, GET /index.htm HTTP/1.1 Host: www.site.com Connection: Close
Default
GET / HTTP/1.0

http_response_code

Type
RepeatableHttpResponse
Category
repeated
Description
List of HTTP response codes to match as successful. Default is 2xx.

http_response

Type
string
Category
optional
Description
Match for a keyword in the first 2Kb of the server header and body response.

RepeatableHttpResponse

code

Type
enum
Category
required
Description
HTTP response codes to match.
Default
HTTP_2XX
Choices
HTTP_5XX, HTTP_4XX, HTTP_2XX, HTTP_3XX, HTTP_ANY

HealthMonitorExternal

command_path

Type
string
Category
optional
Description
Path of external health monitor script.

command_parameters

Type
string
Category
optional
Description
Optional arguments to feed into the script.

command_code

Type
string
Category
required
Description
Command script provided inline.

command_variables

Type
string
Category
optional
Description
Environment variables to be fed into the script.

HealthMonitorUdp

udp_request

Type
string
Category
optional
Description
Send UDP request.

udp_response

Type
string
Category
optional
Description
Match for keyword in the UDP response.

HealthMonitorDNS

query_name

Type
string
Category
required
Description
The DNS monitor will query the DNS server for the fully qualified name in this field.

qtype

Type
enum
Category
optional
Description
Query_Type: Response has atleast one answer of which the resource record type matches the query type Any_Type: Response should contain atleast one answer AnyThing: An empty answer is enough
Default
DNS_QUERY_TYPE
Choices
DNS_ANY_TYPE, DNS_ANY_THING, DNS_QUERY_TYPE

rcode

Type
enum
Category
optional
Description
When No Error is selected, a DNS query will be marked failed is any error code is returned by the server. With Any selected, the monitor ignores error code in the responses.
Default
RCODE_NO_ERROR
Choices
RCODE_NO_ERROR, RCODE_ANYTHING

response_string

Type
string
Category
optional
Description
The resource record of the queried DNS server's response for the Request Name must include the IP address defined in this field.

References

Tenant

Sub Objects