We need you: Evolution of the Downtime Module

Good people of the Checkmk forum! I call upon you once again with a query for aid:

Our very own @lars.getwan is currently refactoring the checkmk.general.downtime module and we want to make sure it lands well. This is where y’all come into play: Go ahead and take a look, or even better, try out the current state yourself. :hammer_and_wrench:

You can find the pull request over at GitHub.

If you want to try out the current development state in your lab or test environment, you can do so utilizing a requirements.yml file:

---
collections:
  - name: https://github.com/Checkmk/ansible-collection-checkmk.general.git
    type: git
    version: feature/module-downtime-rework

If you want to help, but do not know how, please do reach out in the thread.
Also, your feedback is valued both in the pull request directly and here in the thread, whichever you prefer. :handshake:

2 Likes

Hi Robin,
Hi Lars,

at the moment I write at some tools to make it easier to make a downtime at the hosts to set a towntime on a host when someone is working on it, for example now + 1h…
My Idea was to use a API-Proxy where a server mus be registered one time so i can execute two commands on a host base instead of a user base where a user have to logon with user/password every time. And so it would be perfect to excute the two api endpoints

/objects/host_config/ (to check if the host exists at Checkmk)

and

/domain-types/downtime/collections/host ( to set a downtime)

with the registration key for the bakery and here only for the registred hostname not all hosts.

also “berear ” as authentication.

In this case i canwrite a small tool (CLI for linux and GUI for windows) which can read the registration key (all users are administrative users) and set a downtime for the host and only for the host the user is allowed for!

The touls would append the logged in User in windows as user who execute the script and root on a linus host (all users are working as root because the linux hosts are all server and we have tu work as root…)

This feature can be switched on in the General settings.

This would make our life so much easier :wink:

Frank

Hi Frank,

typically, you would use an automation user to access the REST API from a monitored host. Why have you decided not to do that?
I also wouldn’t use Ansible and access the REST API directly in that case, as Ansible is rather useful if you manage your Checkmk environment from a control node.

Best regards
Lars

Hi Lars

We use an extended version of the Checkmk downtime script, but ultimately Ansible should be able to provide the similar core functionality:

  • Schedule downtimes for:
    • hosts or host groups
    • services or service groups
    • hosts/services filtered and/or by tags or labels
  • List:
    • all active downtimes
      • filtere and/or by host, service, host group, service group, comment, tag, label
    • all upcoming downtimes
      • filtere and/or by host, service, host group, service group, comment, tag, label
  • Remove:
    • specific downtimes
    • all downtimes for hosts or host groups
    • all downtimes for services or service groups
    • filtering by and/or comment, author, tag, or label
  • Default behaviour for downtime removal:
    • filter by author (ansible) to ensure downtimes created manually via the GUI remain untouched

Regards, Lars