]> granicus.if.org Git - icinga2/commitdiff
Fix check_disk default thresholds and document the change of unit
authorLouis Sautier <sautier.louis@gmail.com>
Tue, 10 Mar 2015 17:46:27 +0000 (18:46 +0100)
committerMichael Friedrich <michael.friedrich@gmail.com>
Tue, 10 Mar 2015 22:49:23 +0000 (23:49 +0100)
fixes #8673

Signed-off-by: Michael Friedrich <michael.friedrich@gmail.com>
doc/3-monitoring-basics.md
doc/7-icinga-template-library.md
itl/command-plugins.conf
test/config/8063.conf

index 86c2137f3767c01f8659ebc0b91f9f0ea49f7e5e..bb52e26a731432b628679a8411e39af4cd21dd0b 100644 (file)
@@ -1058,16 +1058,38 @@ can also be inherited from a parent template using additive inheritance (`+=`).
       command = [ PluginDir + "/check_disk" ]
 
       arguments = {
-        "-w" = "$disk_wfree$%"
-        "-c" = "$disk_cfree$%"
-        "-W" = "$disk_inode_wfree$%"
-        "-K" = "$disk_inode_cfree$%"
-        "-p" = "$disk_partitions$"
-        "-x" = "$disk_partitions_excluded$"
+        "-w" = {
+          value = "$disk_wfree$"
+          description = "Exit with WARNING status if less than INTEGER units of disk are free or Exit with WARNING status if less than PERCENT of disk space is free"
+          required = true
+        }
+        "-c" = {
+          value = "$disk_cfree$"
+          description = "Exit with CRITICAL status if less than INTEGER units of disk are free or Exit with CRITCAL status if less than PERCENT of disk space is free"
+          required = true
+        }
+        "-W" = {
+          value = "$disk_inode_wfree$"
+          description = "Exit with WARNING status if less than PERCENT of inode space is free"
+        }
+        "-K" = {
+          value = "$disk_inode_cfree$"
+          description = "Exit with CRITICAL status if less than PERCENT of inode space is free"
+        }
+        "-p" = {
+          value = "$disk_partitions$"
+          description = "Path or partition (may be repeated)"
+          repeat_key = true
+          order = 1
+        }
+        "-x" = {
+          value = "$disk_partitions_excluded$"
+          description = "Ignore device (only works if -p unspecified)"
+        }
       }
 
-      vars.disk_wfree = 20
-      vars.disk_cfree = 10
+      vars.disk_wfree = "20%"
+      vars.disk_cfree = "10%"
     }
 
 > **Note**
@@ -1098,8 +1120,8 @@ string values for passing multiple partitions to the `check_disk` check plugin.
 
       vars += config
 
-      vars.disk_wfree = 10
-      vars.disk_cfree = 5
+      vars.disk_wfree = "10%"
+      vars.disk_cfree = "5%"
     }
 
 
index a9714df96695a32b7b5fa70e08eb954e309f62ba..029842015b5a6fc3dcf8e5ad21d7ac2c56bef54b 100644 (file)
@@ -129,12 +129,17 @@ dig_lookup           | **Optional.** The address that should be looked up.
 
 Check command object for the `check_disk` plugin.
 
+> **Note**
+>
+> `disk_wfree` and `disk_cfree` require the percent sign compared to older versions.
+> If omitted, disk units can be used. This has been changed in **2.3.0**.
+
 Custom Attributes:
 
 Name                   | Description
 ------------------------|------------------------
-disk_wfree             | **Optional.** The free space warning threshold in %. Defaults to 20.
-disk_cfree             | **Optional.** The free space critical threshold in %. Defaults to 10.
+disk_wfree             | **Optional.** The free space warning threshold. Defaults to "20%". If the percent sign is omitted, units from `disk_units` are used.
+disk_cfree             | **Optional.** The free space critical threshold. Defaults to "10%". If the percent sign is omitted, units from `disk_units` are used.
 disk_inode_wfree       | **Optional.** The free inode warning threshold.
 disk_inode_cfree       | **Optional.** The free inode critical threshold.
 disk_partition         | **Optional.** The partition. **Deprecated in 2.3.**
index 5f345c25cbd7e8c8e69fc59a07df76a408e2b108..1f4262d7412b2f568d2c06e2d032e4aa425abfe9 100644 (file)
@@ -603,8 +603,8 @@ object CheckCommand "disk" {
                }
        }
 
-       vars.disk_wfree = 20
-       vars.disk_cfree = 10
+       vars.disk_wfree = "20%"
+       vars.disk_cfree = "10%"
        vars.disk_megabytes = true
        vars.disk_exclude_type = ["none", "tmpfs", "sysfs", "proc", "devtmpfs", "devfs", "mtmfs"]
 }
index fe3bcc7876565fc812e1a9602be13727a6e7bd90..991372c4643bd01b1383026dc70fd09f5b6aa6b9 100644 (file)
@@ -4,16 +4,38 @@ object CheckCommand "8063-my-disk" {
   command = [ PluginDir + "/check_disk" ]
 
   arguments = {
-    "-w" = "$disk_wfree$%"
-    "-c" = "$disk_cfree$%"
-    "-W" = "$disk_inode_wfree$%"
-    "-K" = "$disk_inode_cfree$%"
-    "-p" = "$disk_partitions$"
-    "-x" = "$disk_partitions_excluded$"
+    "-w" = {
+      value = "$disk_wfree$"
+      description = "Exit with WARNING status if less than INTEGER units of disk are free or Exit with WARNING status if less than PERCENT of disk space is free"
+      required = true
+    }
+    "-c" = {
+      value = "$disk_cfree$"
+      description = "Exit with CRITICAL status if less than INTEGER units of disk are free or Exit with CRITCAL status if less than PERCENT of disk space is free"
+      required = true
+    }
+    "-W" = {
+      value = "$disk_inode_wfree$"
+      description = "Exit with WARNING status if less than PERCENT of inode space is free"
+    }
+    "-K" = {
+      value = "$disk_inode_cfree$"
+      description = "Exit with CRITICAL status if less than PERCENT of inode space is free"
+    }
+    "-p" = {
+      value = "$disk_partitions$"
+      description = "Path or partition (may be repeated)"
+      repeat_key = true
+      order = 1
+    }
+    "-x" = {
+      value = "$disk_partitions_excluded$"
+      description = "Ignore device (only works if -p unspecified)"
+    }
   }
 
-  vars.disk_wfree = 20
-  vars.disk_cfree = 10
+  vars.disk_wfree = "20%"
+  vars.disk_cfree = "10%"
 }
 
 object Host "8063-my-server" {
@@ -37,8 +59,8 @@ apply Service "8063-" for (disk => config in host.vars.local_disks) {
 
   vars += config
 
-  vars.disk_wfree = 10
-  vars.disk_cfree = 5
+  vars.disk_wfree = "10%"
+  vars.disk_cfree = "5%"
 
   assign where host.vars.local_disks
 }