HAProxy monitoring.

Configure HAProxy plugins to ensure proper operation and performance of HAProxy, a TCP/HTTP load balancer.

Ensure optimal operation and performance of HAProxy, a TCP/HTTP load balancer. Learn how the plugin works.

HAProxy performance monitoring metrics:

Request errors

The total number of request errors.

Bytes in

The total number of bytes received by the frontend (last 5 seconds).

Bytes out

The total number of bytes sent by the frontend (last 5 seconds).

Current requests in queue

The total current number of requests unassigned in queue.

Current sessions rate

The total number of sessions created per second.

How it works?

  • Log-in to your Site24x7 account. Sign up here if you don't have one.
  • Download and install the latest version of Site24x7 Linux Agent
  • Install the HAProxy plugin
  • The agent will execute the HAProxy plugin and push the data to the Site24x7 server

Prerequisites:

  • This is a Python based plugin and will support Python version 2.7 and greater.

HAProxy plugin installation:

  • Create a directory with the name "haproxy", under the Site24x7 Linux Agent's plugin directory - /opt/site24x7/monagent/plugins/haproxy
  • Download the file "haproxy.py" from our GitHub repository and place it under the "haproxy" directory
  • Commands to perform the above step:
  • cd /opt/site24x7/monagent/plugins/
    mkdir haproxy
    cd haproxy
    wget https://raw.githubusercontent.com/site24x7/plugins/master/haproxy/haproxy.py

Configure Haproxy to support statistics:

  • Edit your HAProxy configuration file which is located at - /etc/haproxy/haproxy.cfg and add the following code to enable the stats:
  • listen appname 0.0.0.0:80
    mode http
    stats enable
    stats uri /haproxy?stats
    stats realm Strictly\ Private
    stats auth userName:password
  • Save the changes and restart HAProxy using the following command (take caution while restarting in production servers).
  • /etc/init.d/haproxy restart

HAProxy plugin configuration:

  • Make the following changes in the plugin file (/opt/site24x7/monagent/plugins/haproxy/haproxy.py):
    • Replace the shebang character "#!" in your plugin file to the appropriate path for python in your system. Eg: #!/usr/local/bin/python
    • Change the values of url, username, password, and realm to corresponding values as specified while configuring HAProxy for statistics
    • Please make sure you retain the ";csv" prefix at the end of the URL. This is required for the agent to fetch statistics from the URL
  • The agent will now report HAProxy statistics in the plugins tab under the site24x7 portal

Monitoring additional metrics:

  • To monitor additional metrics, edit the "haproxy.py" file and add the new metrics that need monitoring
  • Increment the plugin version value in the file "haproxy.py" to view the newly added metrics ( For e.g. Change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")

Related plugins:

  • Redis plugin - Monitor performance metrics of your Redis databases
  • MongoDB plugin - Monitor performance metrics of your MongoDB databases
  • Memcached plugin - Analyze performance of your Memcached server
  • Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes
Trusted

World's leading companies

Client

Don't have a Site24x7 account? Sign up now!