HTTPS SSH

ipvsadm output parser

parser for ipvsadm -Ln --sort output.

  • convert to python dict(use as library)
  • convert to other text format(with bin/ipvsadm-outputparser)

Requirement

client

  • python 2.4+

Install

shell:

hg clone ...(writing)

Usage

shell:

ipvsadm -Ln --sort | bin/ipvsadm-outputparser --local-address='192\.168\.0\..*' --output-format='redmine'

Data Format

python:

{
    'Protocol'  :'',
    'Address'   :'',
    'Port'      :'',    # if Protocol==FWM, port is unset
    'Scheduler' :'',
    'Childs'    :[
        {
            'Address'   :'',
            'Port'      :'',
            'Forwarding':'',
            'Weight'    :'',
        }, ...
    ],
}

Development

shell:

virtualenv --no-site-packages --python=python2.4 venv
# or
/usr/local/Cellar/python24/2.4.*/bin/virtualenv --no-site-packages --python=python2.4 venv

Note

If you use MacOSX, install python2.4 with homebrew.

shell:

brew tap homebrew/versions
brew install homebrew/versions/python24
curl http://peak.telecommunity.com/dist/ez_setup.py|python2.4
/usr/local/Cellar/python24/2.4.6/bin/easy_install pip
/usr/local/Cellar/python24/2.4.6/bin/pip install virtualenv