]> granicus.if.org Git - icinga2/commitdiff
Add btrfs CheckCommand definition
authorBarbUk <julien.virey@gmail.com>
Tue, 27 Nov 2018 20:04:10 +0000 (00:04 +0400)
committerBarbUk <julien.virey@gmail.com>
Tue, 27 Nov 2018 20:04:10 +0000 (00:04 +0400)
Check a btrfs mountpoint health and disk space allocated

doc/10-icinga-template-library.md
itl/plugins-contrib.d/storage.conf

index 103410d2d98d9be95c65b7f67409d4ffb7aec254..de36703a93fc0a5f28c66a7e29680230acf65f3d 100644 (file)
@@ -3106,6 +3106,22 @@ ceph_client_key  | **Optional.** Ceph client keyring file.
 ceph_whitelist   | **Optional.** Whitelist regexp for ceph health warnings.
 ceph_details     | **Optional.** Run 'ceph health detail'.
 
+#### btrfs <a id="plugins-contrib-command-btrfs"></a>
+
+The [btrfs plugin](https://github.com/knorrie/python-btrfs/)
+is used to check the btrfs storage health on the server.
+
+[monitoring-plugins-btrfs](https://packages.debian.org/monitoring-plugins-btrfs) provide the necessary binary on debian/ubuntu.
+
+Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
+
+Name             | Description
+-----------------|---------------------------------------------------------
+btrfs_awg        | **Optional.** Exit with WARNING status if less than the specified amount of disk space (in GiB) is unallocated
+btrfs_acg        | **Optional.** Exit with CRITICAL status if less than the specified amount of disk space (in GiB) is unallocated
+btrfs_awp        | **Optional.** Exit with WARNING status if more than the specified percent of disk space is allocated
+btrfs_acp        | **Optional.** Exit with CRITICAL status if more than the specified percent of disk space is allocated
+btrfs_mountpoint | **Required.** Path to the BTRFS mountpoint
 
 ### Virtualization <a id="plugin-contrib-virtualization"></a>
 
index 3e413e0ab84a11200858d681c084bd5e73a03f61..3d1286b2e00f1d41e74db6dd75eaef060e34731c 100644 (file)
@@ -102,3 +102,35 @@ object CheckCommand "ceph" {
                }
        }
 }
+
+object CheckCommand "btrfs" {
+    import "plugin-check-command"
+    [ "sudo", PluginDir + "/check_btrfs" ]
+
+    arguments = {
+        "--allocated-warning-gib" = {
+            value = "$btrfs_awg$"
+            description = "Exit with WARNING status if less than the specified amount of disk space (in GiB) is unallocated"
+        }
+        "--allocated-critical-gib" = {
+            value = "$btrfs_acg$"
+            description = "Exit with CRITICAL status if less than the specified amount of disk space (in GiB) is unallocated"
+        }
+        "--allocated-warning-percent" = {
+            value = "$btrfs_awp$"
+            description = "Exit with WARNING status if more than the specified percent of disk space is allocated"
+        }
+        "--allocated-critical-percent" = {
+            value = "$btrfs_acp$"
+            description = "Exit with CRITICAL status if more than the specified percent of disk space is allocated"
+        }
+        "--mountpoint" = {
+            value = "$btrfs_mountpoint$"
+            description = "Path to the BTRFS mountpoint"
+            required = true
+        }
+    }
+    vars.btrfs_awp = 80
+    vars.btrfs_acp = 90
+}
+