Giter Site home page Giter Site logo

python-haproxy's Introduction

python-haproxy

Read haproxy stats using socket.

Install

There are a few different ways you can install pyechonest:

  • Use setuptools: easy_install -U python-haproxy
  • Checkout the source: git clone https://github.com/nl5887/python-haproxy.git and install it yourself.

based on [http://www.gefira.pl/blog/2011/07/01/accessing-haproxy-statistics-with-python/] (http://www.gefira.pl/blog/2011/07/01/accessing-haproxy-statistics-with-python)

Examples

from haproxy import haproxy
stats = haproxy.HAProxyStats('/tmp/haproxy.sock')
stats.execute('show info')
[u'Name: HAProxy', u'Version: 1.4.18', u'Release_date: 2011/09/16', u'Nbproc: 1', u'Process_num: 1', u'Pid: 19234', u'Uptime: 0d 6h18m11s', u'Uptime_sec: 22691', u'Memmax_MB: 0', u'Ulimit-n: 8210', u'Maxsock: 8210', u'Maxconn: 4096', u'Maxpipes: 0', u'CurrConns: 1', u'PipesUsed: 0', u'PipesFree: 0', u'Tasks: 7', u'Run_queue: 1', u'node: ip-10-0-0-45', u'description: ', u'']

Options

clear counters : clear max statistics counters (add 'all' for all counters)
help           : this message
prompt         : toggle interactive mode with prompt
quit           : disconnect
show info      : report information about the running process
show stat      : report counters for each proxy and server
show errors    : report last request and response errors for each proxy
show sess [id] : report the list of current sessions or dump this session
get weight     : report a server's current weight
set weight     : change a server's weight  
set timeout    : change a timeout setting
disable server : set a server in maintenance mode
enable server  : re-enable a server that was previously in maintenance mode

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.