> For the complete documentation index, see [llms.txt](https://docs.glesys.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.glesys.com/products/connectivity/load-balancer/how-tos/understand-the-targets-health-checks.md).

# Understand the targets' health checks

***

## Understanding HTTP targets' health checks

If the targets are HTTP servers, a health check is performed for all targets by sending a `OPTIONS` request to them. For a target to be marked as green, it must respond with either a 20X or 30X status code.

If the targets are marked as red, you can test whether they are responding with the correct HTTP status code using `curl`. In the example below, 203.0.118.89 is the IP address of one of the targets.

{% code title="Command" %}

```terminal
curl -v -X OPTIONS http://203.0.118.89
```

{% endcode %}

{% code title="Output" %}

```
* processing: http://203.0.118.89
*   Trying 203.0.118.89:80...
* Connected to 203.0.118.89 (203.0.118.89) port 80
> OPTIONS / HTTP/1.1
> Host: 203.0.118.89 
> User-Agent: curl/8.2.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 14 Nov 2023 17:52:04 GMT
< Server: Apache/2.4.57 (Debian)
< Allow: GET,POST,OPTIONS,HEAD
< Content-Length: 0
< Content-Type: text/html
```

{% endcode %}

Here, you received `HTTP/1.1 200 OK` from the server, which means the target will be marked as functional with a green dot.

## Understanding TCP targets' health checks

If the targets are TCP services, a simple TCP check will be performed as a health check.

You can manually try to connect your target's port with netcat (`nc`). This allows you to make sure the target is responding on the port. Let's assume the target's IP address is 203.0.113.57 and the port the service is running on is 9090. Run the command:

{% code title="Command" %}

```
nc -zv 203.0.113.57 9090
```

{% endcode %}

If the service is running on port 9090 and responding, you should get an output similar to this:

{% code title="Output" %}

```
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: Connected to 203.0.113.57:9090.
Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.
```

{% endcode %}

However, if the service is not responding on port 9090, you'll instead see an output like this:

{% code title="Output" %}

```
Ncat: Version 7.92 ( https://nmap.org/ncat )
Ncat: Connection refused.
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.glesys.com/products/connectivity/load-balancer/how-tos/understand-the-targets-health-checks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
