1
0
Fork
You've already forked py_check_mk_view_wrapper
1
Python library for common operations in the CheckMk monitoring plattform using requests and view.py.
  • Python 98.1%
  • Shell 1.9%
2026年02月19日 19:04:04 +01:00
__init__.py Initial 2025年10月06日 14:50:38 +02:00
make-venv.sh Initial 2025年10月06日 14:50:38 +02:00
py.typed Initial 2025年10月06日 14:50:38 +02:00
py_check_mk_view_wrapper.py Update py_check_mk_view_wrapper.py 2026年02月19日 13:28:28 +01:00
query-checkmk.py use new style gssapi module 2026年02月19日 13:27:40 +01:00
README.md use new style gssapi module 2026年02月19日 13:26:17 +01:00

Python CheckMk Requests library

Provides a library to manage the most common CheckMk requests.

class Connection

Provides common operations on CheckMk.

Usage:

from requests.auth import HTTPBasicAuth
http_auth = HTTPBasicAuth("user", "password")
conn = Connection("URL", auth=http_auth, verify=False)
# or
from requests_gssapi import HTTPKerberosAuth
conn = Connection("URL", auth=HTTPKerberosAuth())
host_info = conn.host_search("HOSTREGEX")
hosts_services_info = conn.collect_host_services_from_regex("HOSTREGEX")
hosts_services_info = conn.collect_host_services_from_list(
 ["HOSTNAME", "HOSTNAME"])
service_info = conn.search_host_service_by_regex("HOSTNAME")
# Args: hostname, downtime duration in minutes, downtime message
conn.set_host_downtime("HOSTNAME", 120, "MESSAGE")
conn.remove_host_downtime("HOSTNAME")
nok_services = conn.host_services("HOSTNAME").filter_nok()
# same for service downtimes
conn.set_service_acks_from_response(nok_services, "MESSAGE")
conn.remove_service_acks_from_response(nok_services)

class Response

Contains data from a CheckMk Connection request.

Usage:

nok_services_info = service_info.filter_nok() # -> Response
for hostname, host_service_data in service_info.items(): # dict iterator
	for service_name, service_data in host_service_data.items():
	 ...
for hostname in service_info: # provides __iter__
 ...
print(service_info) # provides __str__
print([service_info]) # provides __repr__