Carol
Carol

Reputation: 563

check_mk downtime scheduled downtime

Is there a proper way to setup a downtime in check_mk? I mean, if I have to restart a host. How should I create a scheduled downtime? It should apply to host? it should be applied to all services? I should be applied both: host and all services??

I wrongly thought when I applied a scheduled downtime to a host, all services associated to it would inherit this scheduled downtime, but it doesn't work in this way.

What is the sorter (less steps) and right way to do this if I have to restart a host?

Upvotes: 1

Views: 1130

Answers (2)

Muk-F1
Muk-F1

Reputation: 1

There is a downtime python script in:

/opt/omd/versions/1.6.0p11.cee/share/doc/check_mk/treasures/downtime

Modify the "opt_secret" and the "opt_url" and you should be good to go:

# ./downtime -h
Usage: downtime [-r] [OPTIONS] HOST [SERVICE1] [SERVICE2...]

This program sets and removes downtimes on hosts and services
via command line. If you run this script from within an OMD
site then most options will be guessed automatically. Currently
the script only supports cookie based login - no HTTP basic
authentication.

Before you use this script, please read:
http://mathias-kettner.de/checkmk_multisite_automation.html
You need to create an automation user - best with the name 'automation'
- and make sure that this user either has the admin role or is contact
for all relevant objects.

Options:
  -v, --verbose    Show what's going on (specify twice for more verbose output)
  -s, --set        Set downtime (this is the default and thus optional)
  -r, --remove     Remove all downtimes from that host/service
  -c, --comment    Comment for the downtime (otherwise "Automatic downtime")
  -d, --duration   Duration of the downtime in minutes (default: 120)
  -h, --help       Show this help and exit
  -u, --user       Name of automation user (default: "automation")
  -S, --secret     Automation secret (default: read from user settings)
  -U, --url        Base-URL of Multisite (default: guess local OMD site)
  -a, --all        Include all services when setting/removing host downtime

Upvotes: 0

Carol
Carol

Reputation: 563

I realised I can apply apply a downtime on host and it'll be applied to all services associated to that hosts.

Upvotes: 0

Related Questions