Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Helps to query MK livestatus and get results

Project Description
Python MK Livestatus parser

:Author: Michael Fladischer
:Version: 0.4

.. contents::

Access the data returned from MK Livestatus queries as Python lists or dictionaries.
It does this by sending queries to the MK Livestatus UNIX socket and parses the returned rows.
Read/write permission to the UNIX socket are required.

This package is known to be compatible with Python 2.7, 3.3, 34, pypy and pypy3.


Here a simple example to fetch the name and hostgroups for all servers in the UP (0) state:

>>> from mk_livestatus import Socket
>>> s = Socket("/var/lib/icinga/rw/live")
>>> q = s.hosts.columns('name', 'groups').filter('state = 0')
>>> print q
GET hosts
Columns: name groups
Filter: state = 0

[{'name': '', 'groups': ['ssh', 'snmp', 'smtp-server', 'ping-server', 'http-server', 'debian-server', 'apache2']}]

``s.hosts`` returns a Query to the ``hosts`` resources on Nagios. The ``columns`` and ``filter`` methods modify our query and return it, so we can chain the calls. The call to `call` method returns the rows as a list of dictionaries.

If you use xinetd to bind the Unix socket to a TCP socket (like explained `here <>`_), you can create the socket like :

>>> s = Socket(('', 6557))

For more information please visit the `python-mk-livestatus website`_. Information about MK Livestatus and it's query syntax is available at the `mk-livestatus website`_.

.. _python-mk-livestatus website:
.. _mk-livestatus website:
Release History

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
python_mk_livestatus-0.4-py3-none-any.whl (5.1 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Mar 18, 2015
python-mk-livestatus-0.4.tar.gz (3.7 kB) Copy SHA256 Checksum SHA256 Source Mar 18, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting