From ba35e6cace337664409b69030c67dc9ff1145208 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Mon, 24 Jul 2017 10:14:15 +0200 Subject: [PATCH] Add ITL and documentation for new parameter --- doc/10-icinga-template-library.md | 20 ++++++++++---------- itl/command-plugins-windows.conf | 5 ++++- plugins/check_disk.cpp | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index fc32a34b3..ac90f743a 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -1440,8 +1440,8 @@ Threshold | Meaning ### disk-windows Check command object for the `check_disk.exe` plugin. -Aggregates the free disk space of all volumes and mount points it can find, or the ones defined in `disk_win_path`. Ignores removable storage like fash drives and discs (CD, DVD etc.). -The data collection is instant and free disk space is used for threshold computation. +Aggregates the disk space of all volumes and mount points it can find, or the ones defined in `disk_win_path`. Ignores removable storage like fash drives and discs (CD, DVD etc.). +The data collection is instant and free disk space (default, see `disk_win_show_used`) is used for threshold computation. > **Note** > @@ -1450,13 +1450,14 @@ The data collection is instant and free disk space is used for threshold computa Custom attributes: -Name | Description -:-------------------|:------------ -disk\_win\_warn | **Optional**. The warning threshold. -disk\_win\_crit | **Optional**. The critical threshold. -disk\_win\_path | **Optional**. Check only these paths, default checks all. -disk\_win\_unit | **Optional**. Use this unit to display disk space, thresholds are interpreted in this unit. Defaults to "mb", possible values are: b, kb, mb, gb and tb. -disk\_win\_exclude | **Optional**. Exclude these drives from check. +Name | Description +:---------------------|:------------ +disk\_win\_warn | **Optional**. The warning threshold. +disk\_win\_crit | **Optional**. The critical threshold. +disk\_win\_path | **Optional**. Check only these paths, default checks all. +disk\_win\_unit | **Optional**. Use this unit to display disk space, thresholds are interpreted in this unit. Defaults to "mb", possible values are: b, kb, mb, gb and tb. +disk\_win\_exclude | **Optional**. Exclude these drives from check. +disk\_win\_show\_used | **Optional**. Use used instead of free space. ### load-windows @@ -5057,4 +5058,3 @@ webinject_no_output | **Optional.** Suppresses all output to STDOUT except t webinject_timeout | **Optional.** The value [given in seconds] will be compared to the global time elapsed to run all the tests. If the tests have all been successful, but have taken more time than the 'globaltimeout' value, a warning message is sent back to Icinga. webinject_report_type | **Optional.** This setting is used to enable output formatting that is compatible for use with specific external programs. The available values you can set this to are: nagios, mrtg, external and standard. webinject_testcase_file | **Optional.** When you launch WebInject in console mode, you can optionally supply an argument for a testcase file to run. It will look for this file in the directory that webinject.pl resides in. If no filename is passed from the command line, it will look in config.xml for testcasefile declarations. If no files are specified, it will look for a default file named 'testcases.xml' in the current [webinject] directory. If none of these are found, the engine will stop and give you an error. - diff --git a/itl/command-plugins-windows.conf b/itl/command-plugins-windows.conf index 626c7ec93..66e3f6af6 100644 --- a/itl/command-plugins-windows.conf +++ b/itl/command-plugins-windows.conf @@ -42,8 +42,11 @@ object CheckCommand "disk-windows" { value = "$disk_win_exclude$" description = "Exclude these drives from check" } + "-U" = { + set_if = "$disk_win_show_used$" + description = "Work with used instead of free space" + } } - vars.disk_win_unit = "mb" //The default } diff --git a/plugins/check_disk.cpp b/plugins/check_disk.cpp index 9cfe80b4c..7e4fa35d0 100644 --- a/plugins/check_disk.cpp +++ b/plugins/check_disk.cpp @@ -108,7 +108,7 @@ static INT parseArguments(INT ac, WCHAR **av, po::variables_map& vm, printInfoSt if (vm.count("help")) { std::wcout << progName << " Help\n\tVersion: " << VERSION << '\n'; wprintf( - L"%s is a simple program to check a machines free disk space.\n" + L"%s is a simple program to check a machines disk space usage.\n" L"You can use the following options to define its behaviour:\n\n", progName); std::cout << desc; wprintf(