0

我在查找更改 Icinga2 主节点上 check_load 插件阈值的位置时遇到问题。

4

1 回答 1

1

最好的方法是通过将以下内容添加到 conf.d 目录中的 commands.conf 文件来重新定义该命令。添加以下替换<load>为您要调用该命令的任何内容:

object CheckCommand "<load>" {
    import "plugin-check-command"
    command = [ PluginDir + "/check_load" ]
    timeout = 1m
    arguments += {
        "-c" = {
            description = "Exit with CRITICAL status if load average exceed CLOADn; the load average format is the same used by 'uptime' and 'w'"
            value = "$load_cload1$,$load_cload5$,$load_cload15$"
        }
        "-r" = {
            description = "Divide the load averages by the number of CPUs (when possible)"
            set_if = "$load_percpu$"
        }
        "-w" = {
            description = "Exit with WARNING status if load average exceeds WLOADn"
            value = "$load_wload1$,$load_wload5$,$load_wload15$"
        }
    }
    vars.load_cload1 = 10
    vars.load_cload15 = 4
    vars.load_cload5 = 6
    vars.load_percpu = false
    vars.load_wload1 = 5
    vars.load_wload15 = 3
    vars.load_wload5 = 4
}

您要更改的值是 vars.load_cload1-15 和 vars.wload1-15 或将它们设置为您可以在服务定义中使用 设置的变量$variablename$

然后在 services.conf 中使用您的检查命令的新名称。

于 2017-09-07T13:29:25.903 回答