1

是否有正确的方法在 check_mk 中设置停机时间?我的意思是,如果我必须重新启动主机。我应该如何创建计划的停机时间?它应该适用于主机?它应该适用于所有服务吗?我应该同时应用:主机和所有服务?

我错误地认为,当我将计划停机时间应用于主机时,与其关联的所有服务都会继承此计划停机时间,但它不会以这种方式工作。

如果我必须重新启动主机,那么排序器(更少的步骤)和正确的方法是什么?

4

2 回答 2

0

我意识到我可以在主机上应用停机时间,它将应用于与该主机关联的所有服务。

于 2019-01-24T14:36:02.573 回答
0

有一个停机python脚本:

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

修改“opt_secret”和“opt_url”,你应该很高兴:

# ./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
于 2021-04-07T06:29:54.383 回答