【问题标题】:check_mk downtime scheduled downtimecheck_mk 停机时间 计划停机时间
【发布时间】:2019-03-31 07:27:14
【问题描述】:

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

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

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

【问题讨论】:

    标签: schedule downtime check-mk


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      有一个停机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-11-24
        • 1970-01-01
        • 2023-03-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多