主节点上的 Icinga2 check_load 阈值

Icinga2 check_load threshold on master node

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

最好的方法是通过将以下内容添加到 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$.[=13 设置的变量=]

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