From bda2f877592e5c5172251255c8975edfb2cac650 Mon Sep 17 00:00:00 2001 From: Blerim Sheqa Date: Fri, 30 Jan 2015 11:06:48 +0100 Subject: [PATCH] Add missing arguments for the "disk" check command fixes #8316 Signed-off-by: Gunnar Beutner --- doc/6-icinga-template-library.md | 17 ++++ itl/command-plugins.conf | 132 +++++++++++++++++++++++++++++-- 2 files changed, 143 insertions(+), 6 deletions(-) diff --git a/doc/6-icinga-template-library.md b/doc/6-icinga-template-library.md index 1af7a036d..a6a6acba3 100644 --- a/doc/6-icinga-template-library.md +++ b/doc/6-icinga-template-library.md @@ -375,6 +375,23 @@ disk_partition | **Optional.** The partition. **Deprecated in 2.3.** disk_partition_excluded | **Optional.** The excluded partition. **Deprecated in 2.3.** disk_partitions | **Optional.** The partition(s). Multiple partitions must be defined as array. disk_partitions_excluded | **Optional.** The excluded partition(s). Multiple partitions must be defined as array. +disk_clear | **Optional.** Clear thresholds. +disk_exact_match | **Optional.** For paths or partitions specified with -p, only check for exact paths. +disk_errors_only | **Optional.** Display only devices/mountpoints with errors. May be true or false. +disk_group | **Optional.** Group paths. Thresholds apply to (free-)space of all partitions together +disk_kilobytes | **Optional.** Same as --units kB. May be true or false. +disk_local | **Optional.** Only check local filesystems. May be true or false. +disk_stat_remote_fs | **Optional.** Only check local filesystems against thresholds. Yet call stat on remote filesystems to test if they are accessible (e.g. to detect Stale NFS Handles). Myy be true or false +disk_mountpoint | **Optional.** Display the mountpoint instead of the partition. May be true or false. +disk_megabytes | **Optional.** Same as --units MB. May be true or false. +disk_all | **Optional.** Explicitly select all paths. This is equivalent to -R '.*'. May be true or false. +disk_eregi_path | **Optional.** Case insensitive regular expression for path/partition (may be repeated). +disk_ereg_path | **Optional.** Regular expression for path or partition (may be repeated). +disk_ignore_eregi_path | **Optional.** Regular expression to ignore selected path/partition (case insensitive) (may be repeated). +disk_ignore_ereg_path | **Optional.** Regular expression to ignore selected path or partition (may be repeated). +disk_timeout | **Optional.** Seconds before connection times out (default: 10). +disk_units | **Optional.** Choose bytes, kB, MB, GB, TB (default: MB). +disk_exclude_type | **Optional.** Ignore all filesystems of indicated type (may be repeated). ### users diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index f8703ecfb..35aa34cfc 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -409,24 +409,144 @@ object CheckCommand "disk" { command = [ PluginDir + "/check_disk" ] arguments = { - "-w" = "$disk_wfree$%" - "-c" = "$disk_cfree$%" - "-W" = "$disk_inode_wfree$%" - "-K" = "$disk_inode_cfree$%" - "-p" = "$disk_partitions$" + "-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_partition$" + description = "Path or partition (may be repeated)" + repeat_key = true + } + "-p_old" = { key = "-p" value = "$disk_partition$" } - "-x" = "$disk_partitions_excluded$" + + "-x" = { + value = "$disk_partitions_excluded$" + description = "Ignore device (only works if -p unspecified)" + } + "-x_old" = { key = "-x" value = "$disk_partition_excluded$" } + + "-C" = { + set_if = "$disk_clear$" + description = "Clear thresholds" + } + + "-E" = { + set_if = "$disk_exact_match$" + description = "For paths or partitions specified with -p, only check for exact paths" + } + + "-e" = { + set_if = "$disk_errors_only$" + description = "Display only devices/mountpoints with errors" + } + + "-g" = { + value = "$disk_group$" + description = "Group paths. Thresholds apply to (free-)space of all partitions together" + } + + "-k" = { + set_if = "$disk_kilobytes$" + description = "Same as --units kB" + } + + "-l" = { + set_if = "$disk_local$" + description = " Only check local filesystems" + } + + "-L" = { + set_if = "$disk_stat_remote_fs$" + description = "Only check local filesystems against thresholds. Yet call stat on remote filesystems to test if they are accessible (e.g. to detect Stale NFS Handles)" + } + + "-M" = { + set_if = "$disk_mountpoint$" + description = "Display the mountpoint instead of the partition" + } + + "-m" = { + set_if = "$disk_megabytes$" + description = "Same as --units MB" + } + + "-A" = { + set_if = "$disk_all$" + description = "Explicitly select all paths. This is equivalent to -R .*" + } + + "-R" = { + value = "$disk_eregi_path$" + description = "Case insensitive regular expression for path/partition (may be repeated)" + repeat_key = true + } + + "-r" = { + value = "$disk_ereg_path$" + description = "Regular expression for path or partition (may be repeated)" + repeat_key = true + } + + "-I" = { + value = "$disk_ignore_eregi_path$" + description = "Regular expression to ignore selected path/partition (case insensitive) (may be repeated)" + repeat_key = true + } + + "-i" = { + value = "$disk_ignore_ereg_path$" + description = "Regular expression to ignore selected path or partition (may be repeated)" + repeat_key = true + } + + "-t" = { + value = "$disk_timeout$" + description = "Seconds before connection times out (default: 10)" + } + + "-u" = { + value = "$disk_units$" + description = "Choose bytes, kB, MB, GB, TB (default: MB)" + } + + "-X" = { + value = "$disk_exclude_type$" + description = "Ignore all filesystems of indicated type (may be repeated)" + repeat_key = true + } } vars.disk_wfree = 20 vars.disk_cfree = 10 + vars.disk_megabytes = true + vars.disk_exclude_type = ["none", "tmpfs", "sysfs", "proc", "devtmpfs"] } object CheckCommand "users" {