【问题标题】:Icinga2: How to monitor scheduled tasks via check_tasksched and ignore currently running tasks?Icinga2:如何通过 check_tasksched 监控计划任务并忽略当前正在运行的任务?
【发布时间】:2015-12-17 12:48:51
【问题描述】:

尝试了几种方法,使用默认的 check_tasksched 可以正常工作,并且默认情况下只检查启用的那些(过滤器)。

现在我的问题是:正在运行的任务在运行时会收到“警告”通知。

【问题讨论】:

    标签: scheduled-tasks nrpe icinga


    【解决方案1】:

    现在经过几次尝试......找到了解决方案:

    使用过滤器:

    • “启用 eq 1 AND not exit_code eq 267009”

    因为 267009 似乎是“运行”的代码。

    这是命令模板:

    object CheckCommand "check_tasksched" {
      import "plugin-check-command"
      command = [
        PluginDir + "/check_nrpe",
        "-H", "$address$",
        "-c", "check_tasksched",
        "-a", "filter=$filter$"
      ]
      vars = {
        "filter" = "enabled eq 1 AND not exit_code eq 267009"
        }
    }
    

    不要忘记在 nsclient.ini 中设置 CheckTaskSched = 1。

    该命令的更多信息: http://docs.nsclient.org/reference/windows/CheckTaskSched/#check_tasksched_filter_keys

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-18
      • 2015-08-08
      • 1970-01-01
      相关资源
      最近更新 更多