---
title: "Host Template: Application - Haproxy"
description: ""
url: "https://docs.itrsgroup.com/docs/opsview/6.11.7/opspacks/application-haproxy-opspack/application-haproxy-host-template/index.html"
---
## Overview

Monitor your HAProxy server with a variety of checks, including Proxy Status, Connection Time, Bytes, Queue Size/Time and Request Rate/Time. Also includes information on denied and error requests and responses, as well as sessions and warnings.

This Host Template includes the following Service Checks:

| Service&nbsp;Check&nbsp;Name    | Description                                                                   | Default&nbsp;Thresholds (Metric:&nbsp;Warning,&nbsp;Critical) | UOM     |
|:--------------------------------|:------------------------------------------------------------------------------|:-------------------------------------------------------------:|:-------:|
| Haproxy - Bytes                 | Checks the bytes in and bytes out.                                            | Bytes_In: &#8203;`1000000`,`2000000`
Bytes_Out: &#8203;`1000000`,`2000000` | B       |
| Haproxy - Connect Time          | The time in ms for a session to connect.                                      | Connect_Time: &#8203;`1000`,`2000`                                       | ms      |
| Haproxy - Currrent Queue        | The current number in the queue.                                              | Current_Queue: &#8203;`200`,`300`                                        | count   |
| Haproxy - Denied Connection     | **HAProxy 1.7 only**
The number of denied connections made to the system. | Denied_Connection: &#8203;`10`,`15`                                      | count   |
| Haproxy - Denied Requests       | The number of denied requests made to the system.                             | Denied_Request: &#8203;`10`,`15`                                         | count   |
| Haproxy - Denied Response       | The number of denied responses made to the system.                            | Denied_Response: &#8203;`10`,`15`                                        | count   |
| Haproxy - Denied Sessions       | **HAProxy 1.7 only**
The number of denied sessions made to the system. | Denied_Response: &#8203;`10`,`15`                                        | count   |
| Haproxy - Error Connections     | The number of error connections.                                              | Error_Connection: &#8203;`10`,`15`                                       | count   |
| Haproxy - Error Requests        | The number of error requests.                                                 | Error_Request: &#8203;`10`,`15`                                          | count   |
| Haproxy - Error Response        | The number of error responses.                                                | Error_Response: &#8203;`10`,`15`                                         | count   |
| Haproxy - Intercepted Requests  | **HAProxy 1.7 only**
The number of intercepted requests. | Intercepted_Requests: &#8203;`900`,`1000`                                | count   |
| Haproxy - Queue Time            | The time in ms of the queue session.                                          | Queue_Time: &#8203;`1000`,`2000`                                         | ms      |
| Haproxy - Request Rate          | The number of requests per second.                                            | Request_Rate: &#8203;`1000`,`2000`                                       | count/s |
| Haproxy - Request Time          | The time in ms of the session request.                                        | Request_Time: &#8203;`1000`,`2000`                                       | ms      |
| Haproxy - Response Codes        | The number of code responses of each type.                                    | Code_4xx: &#8203;`300`,`450`
Code_5xx: &#8203;`300`,`450`
Code_Other: &#8203;`300`,`450` | count   |
| Haproxy - Session Rate          | The number of sessions per second.                                            | Session_Rate: &#8203;`1000`,`2000`                                       | count/s |
| Haproxy - Sessions Used         | The percentage of used sessions.                                              | Sessions_Used: &#8203;`70`,`90`                                          | %       |
| Haproxy - Status                | Checks the status of the proxy.                                               | N/A                                                          | N/A     |
| Haproxy - Warnings Redispatched | The number of redispatched warnings.                                          | Warnings_Redispatched: &#8203;`10`,`15`                                  | count   |
| Haproxy - Warnings Retried      | The number of retried warnings.                                               | Warnings_Retried: &#8203;`10`,`15`                                       | count   |

## Usage Instructions

Please review the overall [Application - Haproxy](https://docs.itrsgroup.com/docs/opsview/6.11.7/opspacks/application-haproxy-opspack/application-haproxy-opspack/index.html) documentation for details on prerequisites, known issues, and other necessary configurations that apply to all Host Templates in the Opspack.

**NOTE:** If you are running HAProxy version 1.5 or 1.6 three service checks will need to be deactivated as the metrics are not available for those versions:

- Haproxy - Denied Connection
- Haproxy - Denied Sessions
- Haproxy - Intercepted Requests

### Add this Host Template

Add the **Application - Haproxy** Host Template to your Opsview Monitor host.
If the resource you're monitoring has no hostname or public IP, then open the **Advanced** settings pane and change **Host Check Command** to **Always assumed to be UP**.


**Note**


For more information, refer to the documentation on [Adding Host Templates to Hosts](https://docs.itrsgroup.com/docs/opsview/6.11.7/host/index.html#host-templates).



### Add and configure variables required for this Host Template

The Service Checks in this Host Template use the following variables, and they will be added to your Opsview Monitor instance alongside the Opspack:

#### HAPROXY

| Parameter | Position&nbsp;in Variable | Name       | Description                                                                  | &nbsp;&nbsp;Default&nbsp;Value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|:---------:|:-------------------------:|:-----------|:-----------------------------------------------------------------------------|:------------------------------------------------------------:|
|   `-u`    |           Arg1            | Username   | HAProxy Username. Override with the same value as your `haproxy.cfg` file.   |                                                              |
|   `-p`    |           Arg2            | Password   | HAProxy Password. Override with the same value as your `haproxy.cfg` file.   |                                                              |
|   `-P`    |           Arg3            | Port       | HAProxy Port. Override with the same value as your `haproxy.cfg` file.       |                              80                              |
|   `-s`    |           Arg4            | Stats Path | HAProxy Stats Path. Override with the same value as your `haproxy.cfg` file. |                       `haproxy?stats`                        |

#### HAPROXY_PROXY

You can add multiple variables to check the status of each proxy individually.

| Parameter | Position&nbsp;in Variable | Name         | Description                              |
|:---------:|:-------------------------:|:-------------|:-----------------------------------------|
|  **-n**   |           Value           | HAProxy Name | Name of the HAProxy you want to monitor. |


**Note**


For more information, refer to the documentation on [Adding Variables to Hosts](https://docs.itrsgroup.com/docs/opsview/6.11.7/adding-a-new-variable/index.html#adding-a-variable-to-a-host).



#### HAPROXY_CERTIFICATES

Additionally, you can use the following optional variable to pass in your TLS certificates for use when connecting to the service provider to gather metrics. Ensure that the port given in the **HAPROXY** variable matches the desired endpoint.

|      Parameter      | Position&nbsp;in Variable | Name                    | Description                                                                                                                                       |
|:-------------------:|:-------------------------:|:------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------|
|    `--ca-path`    |           Arg1            | CA Certificate Path     | Optional path to the CA Certificate (TLS automatically used).                                                                                     |
|  `--client-cert`  |           Arg2            | Client Certificate Path | Optional path to the Client Certificate (TLS automatically used).                                                                                 |
|  `--client-key`   |           Arg3            | Client Key Path         | Optional path to the Client Key (TLS automatically used).                                                                                         |
| (See Description) |           Arg4            | Additional Arguments    | Optional extra flags to pass to the plugin script. Flags:
- `-S` - Use TLS.
- `-k` - Ignore server certificate verification. |

### Apply Changes

Apply Changes and the system will then be monitored:

![View Output](https://docscdn.itrsgroup.com/opsview/images/opspacks-application-haproxy-output.png)


