Merge pull request #6803 from BarbUk/feature/itl-check-btrfs

Add btrfs CheckCommand definition
This commit is contained in:
Michael Friedrich 2019-01-24 11:03:48 +01:00 committed by GitHub
commit ed85d2528c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 0 deletions

View File

@ -3217,6 +3217,34 @@ 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.
The plugin requires `sudo` permissions.
You can add a sudoers file to allow your monitoring user to use the plugin, i.e. edit /etc/sudoers.d/icinga and add:
```
icinga ALL=(root) NOPASSWD:/usr/lib/nagios/plugins/check_btrfs
```
and set the correct permissions:
```bash
chown -c root: /etc/sudoers.d/icinga
chmod -c 0440 /etc/sudoers.d/icinga
```
[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>

View File

@ -102,3 +102,35 @@ object CheckCommand "ceph" {
}
}
}
object CheckCommand "btrfs" {
import "plugin-check-command"
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
}