Collector Type: Agent

Category: Application Monitors

Application Name: HAProxy

Global Template Name: LINUX HAProxy Template

Introduction

HAProxy is a free open source software that provides high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers. It is written in C and has a reputation for being fast and efficient.

Prerequisites:

The stats module needs to be enabled in HAProxy. Below is the sample block to be placed at the end f haproxy.cfg file

listen stats bind *:8080 stats enable stats realm Haproxy\ Statistics stats uri /

  1. Add the following to the file path /etc/haproxy/haproxy.cfg :
listen stats
    bind *:9000
    mode http
    stats enable 
    stats hide-version 
    stats show-node
    stats realm Haproxy\ Statistics 
    stats uri /haproxy_stats
 
  1. For Virtual Machines, install the Linux Agent.

Parameters

NameDefault Value
Protocol

The protocol to be used.
http
Host IP Address

The host on which haproxy is running.
127.0.0.1
Host IP Address

The host on which haproxy is running.
127.0.0.1
Port

The port on which Lighttpd is running.
8080
URI

The Uri for getting stats of haproxy.
haproxy?stats
User Name

The username of the server, if authentication is enabled.
NA
Password

The password of the server, if authentication is enabled.
NA

Note: All field attributes are mandatory, use default values wherever applicable.

Collected Metrics

Metric NameDisplay Name
haproxy.status

Checks the status of the backend servers(UP/DOWN).
HAProxy-Status
haproxy.requests_queue

Number of requests in the server queue.
HAProxy-QueuedRequests
haproxy.session_current

Current number of concurrent connections.
HAProxy-SessionsActive
haproxy.session_rate

Number of sessions per second.
HAProxy-Sessions
hadoop.jobtracker.reduce.slots.used

The rate at which the data is received per server in MB.
HAProxy-DataReceived
haproxy.mbytes_out_rate

The rate at which the data is sent per server in MB.
HAProxy-DataSent
haproxy.denied_req_rate

The rate of denied requests.
HAProxy-DeniedRequests
haproxy.denied_resp_rate

The rate of denied responses.
HAProxy-DeniedResponses
haproxy.errors_req_rate

The rate of request errors.
HAProxy-RequestErrors
haproxy.errors_rate_conn

The rate of connection errors.
HAProxy-ConnectionErrors
haproxy.errors_rate_resp

The rate of response errors.
HAProxy-ResponseErrors
haproxy.warning.retr_rate

The rate of retries (warning).
HAProxy-WarnRetries
haproxy.warning.redis_rate

The rate of dispatches (warning).
HAProxy-WarnRedispatches
haproxy.requests_rate

The rate of received HTTP requests.
HAProxy-Requests
haproxy.lastchk_time

Time taken in ms to finish the last health check.
HAProxy-LastHealthCheckTime
haproxy.servers_active

Number of current active servers (backend). Validates against total active servers.
HAProxy-ActiveServers
haproxy.servers_backup

Number of current backup servers (backend). Validates against total backup servers.
HAProxy-BackupServers

Note: For HAProxy-ActiveServers, and HAProxy-BackupServers, alerts are triggered when below scenarios occur:

  • Critical alert: All configured backend servers are down (critical alert).

  • Warning alert: Few configured backend servers are down.

  • Info alert: Change in total configured servers count.

  • Ok alert: All configured servers are up (if previously in different states).