Git Product home page Git Product logo

check-haproxy's Introduction

check-haproxy

About

  • this repository contains a Icinga / Nagios plugin to monitor HAProxy (via the stats socket file)
  • Written for python3
  • No additional python modules required, only uses modules from the Python Standard Library

Compatibility

  • I've tested this plugin with various HAProxy versions from 1.X to 2.X

Documentation

  • This plugin offers two check modes
    • --mode instance (default)
      • Checks the whole HAProxy instance
        • If all backend servers are UP
        • If any of the backend servers is getting close to it's session limit
        • If all frontends are OPEN
        • If any of the frontends is getting close to it's session limit
        • If all backends are UP
        • If any of the backends is getting close to it's session limit
      • instance mode
    • --mode frontend
      • Checks single HAProxy frontend
        • If the specified frontend is OPEN
        • If the specified frontend is getting close to it's session limit
      • frontend mode

Parameters

usage: check_haproxy.py [-h] [--socketfile SOCKETFILE] [--mode {instance,frontend}] [--slimwarn SLIM_WARN] [--slimcrit SLIM_CRIT] [--frontend FRONTEND]

Icinga/Nagios plugin which checks a haproxy load balancer

optional arguments:
  -h, --help            show this help message and exit
  --socketfile SOCKETFILE
                        Location of haproxy stats socket file
  --mode {instance,frontend}
                        Plugin mode

Thresholds:
  --slimwarn SLIM_WARN  Exit WARN if sessions reach <slimwarn>% of session limit
  --slimcrit SLIM_CRIT  Exit CRIT if sessions reach <slimcrit>% of session limit

Mode-specific arguments:
  --frontend FRONTEND   Name of frontend to check (only with "--mode frontend")

Usage examples

# Instance mode
./check_haproxy.py --socketfile "/var/lib/haproxy/stats" \
  --mode instance \
  --slimwarn 80 \
  --slimcrit 90

OK - haproxy running with 13 frontends, 13 backends, 25 servers and 137 sessions -  | 'sessions'=137;;;; 'sessions_total'=6916926;;;; 'frontends'=13;;;; 'backends'=13;;;; 'servers'=25;;;;

instance mode

# Frontend mode
./check_haproxy.py --socketfile "/var/lib/haproxy/stats" \
  --mode frontend --frontend "my-haproxy-frontend" \
  --slimwarn 80 \
  --slimcrit 90

OK - HAProxy frontend my-haproxy-frontend is OPEN, Sessions: 143/10000 | 'sessions'=143;8000.0;9000.0;0;10000 'bytein'=10667774618B;;;; 'byteout'=201081437032B;;;;

frontend mode

check-haproxy's People

Contributors

m-erhardt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.