Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check HaProxy Configuration

Rating
0 votes
Favoured:
0
Current Version
1.0
Last Release Date
2018-06-05
Compatible With
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
License
GPL
Hits
7281
Files:
FileDescription
check_haproxy_config.shCheck HaProxy Configuration Syntax
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This plugin checks the haproxy.cfg syntax and dead members. It will also issues either a Warning or Critical alert with performance stats of file size change. A Critical Alert will indicate the HaProxy will NOT startup if a "service haproxy restart" was issued by you.
1. Alerts if someone has made a erroneous modification to the syntax.
2. Alerts if a Load-Balanced member is no longer reachable via DNS name (This was beneficial when identifying dead members before restarting HaProxy)
3. Alerts if the haproxy.cfg file size is above a threshold (in bytes).

Performance data output included by default.

# Syntax:
./check_haproxy_config.sh -x -f -c
-x path to the haproxy binary
-f path to the haproxy configuration
-c critical manageable size for your configuration file (in bytes)

# Example Usage:
/usr/local/nagios/libexec/check_haproxy_config.sh -x /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -c 8000

# How to use it?
Add the following line to the /usr/local/nagios/etc/nrpe.cfg
command[check_haproxy_config]=/usr/local/nagios/libexec/check_haproxy_config.sh -x $ARG1$ -f $ARG2$ -c $ARG3$

Edit the downloaded plugin and make sure these three lines are accurate.
###############
DU="/usr/bin/du"
CUT="/usr/bin/cut"
WC="/usr/bin/wc"