Skip to main content

A library for interacting/scrapping Icinga 1 CGI endpoints

Project description

License PyPI Downloads PyPI Version Build Status Coverage Status

A library for interacting/scrapping Icinga 1 CGI endpoints.

Full Documentation can be found at:

How to setup the client:

>>> from icingapy import IcingaClient
icinga = IcingaClient('', 'admin', 'Ch@ng3m3!')

Icinga Client currently support three methods. summary, status, downtime

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 and port 22: Connection refused'},
'Total Processes': {'service': 'Total Processes', 'status': 'OK', 'info': 'PROCS OK: 12 processes'}}
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'}
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'))

Project details

Download files

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

Files for icingapy, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size icingapy-0.1.2-py3-none-any.whl (8.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size icingapy-0.1.2.tar.gz (33.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page