This project has been archived by its maintainers, and is no longer receiving any updates.
Python MK Livestatus parser
- Author:
Michael Fladischer
- Version:
0.4
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.
Usage
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>>> q.call() [{'name': 'example.com', '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(('192.168.1.1', 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.
Metadata
Release files for python-mk-livestatus 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-mk-livestatus-0.4.tar.gz | 3.7 kB | Without provenance | Details for python-mk-livestatus-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_mk_livestatus-0.4-py3-none-any.whl | Python 3 | none | any | Details for python_mk_livestatus-0.4-py3-none-any.whl |
Total release size: 8.8 kB
Release files / python-mk-livestatus-0.4.tar.gz
| Download URL | python-mk-livestatus-0.4.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad8bda17f152eca73a273e93309c03190214588ff81095cd4f920be6d08356d9
|
|
BLAKE2b-256 checksum How to use checksums |
cec65bcb137f44e1346b0247554763bb525ce4a8b7c9d70d5109b5bfdf09ad69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / python_mk_livestatus-0.4-py3-none-any.whl
| Download URL | python_mk_livestatus-0.4-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e48959c0f01205db2faa93ab8f76e35de7aff5cd65cbc2d79dea23a3d7bfcfae
|
|
BLAKE2b-256 checksum How to use checksums |
5a8498f51eca0f571d1ec025faacc686b61b910cab0b09f342508fcf95a3ee40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for python-mk-livestatus 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.