]> granicus.if.org Git - icinga2/commitdiff
Add "-r" parameter to the check_load command for dividing the load averages by the...
authorPetr Ruzicka <petr.ruzicka@gmail.com>
Wed, 22 Jul 2015 07:14:48 +0000 (09:14 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 22 Jul 2015 08:05:50 +0000 (10:05 +0200)
New variable "load_percpu" added to use when "-r" should be added for the check_load command.

fixes #9699

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index 80c4bf1ed357819702983e92edd1d8efd34436b5..19f4d123401c28079986fb6f15f23da610d75ece 100644 (file)
@@ -485,6 +485,7 @@ load_wload15    | **Optional.** The 15-minute warning threshold. Defaults to 3.
 load_cload1     | **Optional.** The 1-minute critical threshold. Defaults to 10.
 load_cload5     | **Optional.** The 5-minute critical threshold. Defaults to 6.
 load_cload15    | **Optional.** The 15-minute critical threshold. Defaults to 4.
+load_percpu     | **Optional.** Divide the load averages by the number of CPUs (when possible). Defaults to false.
 
 
 ## <a id="plugin-check-command-nrpe"></a> nrpe
index 21ba2072a7828458f53ebe49d67b59eb8c727c75..74dcb9e8862abc46263507b4730bb4c2972264e9 100644 (file)
@@ -975,8 +975,18 @@ object CheckCommand "load" {
        command = [ PluginDir + "/check_load" ]
 
        arguments = {
-               "-w" = "$load_wload1$,$load_wload5$,$load_wload15$"
-               "-c" = "$load_cload1$,$load_cload5$,$load_cload15$"
+               "-w" = {
+                       value = "$load_wload1$,$load_wload5$,$load_wload15$"
+                       description = "Exit with WARNING status if load average exceeds WLOADn"
+               }
+               "-c" = {
+                       value = "$load_cload1$,$load_cload5$,$load_cload15$"
+                       description = "Exit with CRITICAL status if load average exceed CLOADn; the load average format is the same used by 'uptime' and 'w'"
+               }
+               "-r" = {
+                       set_if = "$load_percpu$"
+                       description = "Divide the load averages by the number of CPUs (when possible)"
+               }
        }
 
        vars.load_wload1 = 5.0
@@ -986,6 +996,8 @@ object CheckCommand "load" {
        vars.load_cload1 = 10.0
        vars.load_cload5 = 6.0
        vars.load_cload15 = 4.0
+
+       vars.load_percpu = false
 }
 
 object CheckCommand "snmp" {