Icingapy
A library for interacting/scrapping Icinga 1 CGI endpoints.
Full Documentation can be found at: https://icingapy.readthedocs.io/
How to setup the client:
>>> from icingapy import IcingaClient
icinga = IcingaClient('icinga.host.com', 'admin', 'Ch@ng3m3!')
Icinga Client currently support three methods. summary, status, downtime
- summary
queries the status.cgi endpoint and parses the table for a list of services, their status and info.
>>> icinga.summary('testhost')
{'Current Load': {'service': 'Current Load', 'status': 'OK', 'info': 'OK - load average: 0.38, 0.33, 0.31'},
'Current Users': {'service': 'Current Users', 'status': 'OK', 'info': 'USERS OK - 0 users currently logged in'},
'Disk Space': {'service': 'Disk Space', 'info': 'DISK CRITICAL - free space: / 1423 MB (10% inode=53%): '},
'HTTP': {'service': 'HTTP', 'status': 'OK', 'info': 'HTTP OK: HTTP/1.1 301 Moved Permanently - 529 bytes in 0.000 second response time'},
'SSH': {'service': 'SSH', 'info': 'connect to address 127.0.0.1 and port 22: Connection refused'},
'Total Processes': {'service': 'Total Processes', 'status': 'OK', 'info': 'PROCS OK: 12 processes'}}
- status
queries the extinfo.cgi endpoint and parses the table to pull the same information (with the addition of last-check) as summary but for a single service
>>> icinga.status('testhost', 'Current Load')
{'service': 'Current Load',
'state': ' OK (for 0d 1h 50m 10s)',
'info': 'OK - load average: 0.38, 0.33, 0.31',
'last-check': '2018-09-29 17:22:07'}
- downtime
queries the cmd.cgi endpoint to post a downtime for a particular host or service host. Returns True/False. service, expire_timedate, and msg are optional. Method defaults to a timedate of 1 hour. expire_timedate expects a dictionary with keys matching datetime.timedelta parameters.
>>> icinga.downtime(host='localhost', service='Disk Space', expire_timedate={'hours': 1}, msg='until logrotate'))
True
Metadata
Release files for icingapy 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| icingapy-0.1.2.tar.gz | 33.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| icingapy-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.4 kB
Release files / icingapy-0.1.2.tar.gz
| Download URL | icingapy-0.1.2.tar.gz |
|---|---|
| Size | 33.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
067805d384043625f8a4c40b97ae424dad737401fde73846374244320b9fdbe8
|
|
BLAKE2b-256 checksum How to use checksums |
a5b49f4c8cb9e828b701c906aa62dcd673a1a21c56b9cfa619d0d9a1c7959dea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
|
Release files / icingapy-0.1.2-py3-none-any.whl
| Download URL | icingapy-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47037fcb1d715207f2fab90ca426cd4ee6cbf4a7a9225eba1b329f206496fb5e
|
|
BLAKE2b-256 checksum How to use checksums |
6b6355c11e8b540d669123e8b4da79a960ef03b411b5c242f0e5408ffe3ffba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3
|