check_mk停机时间计划的停机时间

时间:2018-10-26 13:56:09

标签: schedule downtime check-mk

是否有适当的方法在check_mk中设置停机时间?我的意思是,如果我必须重新启动主机。我应该如何安排预定的停机时间?它应该适用于主机吗?它应该适用于所有服务吗?我应该同时申请:主机和所有服务?

我错误地认为,当我将预定的停机时间应用于主机时,与其关联的所有服务都将继承此预定的停机时间,但这种方式无法正常工作。

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

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分: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