Search code examples
configuration-filesicinga2

Icinga2 check_load threshold on master node


I'm having an issue locating where to change the thresholds for the check_load plugin on the Icinga2 master node.


Solution

  • The best way is to redefine that command by adding the following to your commands.conf file in your conf.d directory. Add the following replacing <load> with whatever you want to call the command:

    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
    }
    

    The values you'll want to change are vars.load_cload1-15 and vars.wload1-15 or set them to varibles that you can set in the service definition with $variablename$.

    Then in services.conf use the new name of your check command.