Module: check_mk
Branch: master
Commit: aa1ed3dfbf1a9f0b128085d38d1188110cd28806
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa1ed3dfbf1a9f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jun 9 10:52:15 2015 +0200
#1256 lvm_vgs: Check now has his own configuration in wato
Before the filesystem rulset was used. If you already created parameters for this check
you have the recreate this parameters in the new rule.
---
.werks/1256 | 10 +++++
ChangeLog | 2 +
checks/lvm_vgs | 2 +-
web/plugins/wato/check_parameters.py | 73 ++++++++++++++++++++++++++++++++++
4 files changed, 86 insertions(+), 1 deletion(-)
diff --git a/.werks/1256 b/.werks/1256
new file mode 100644
index 0000000..833698d
--- /dev/null
+++ b/.werks/1256
@@ -0,0 +1,10 @@
+Title: lvm_vgs: Check now has his own configuration in wato
+Level: 1
+Component: wato
+Compatible: incomp
+Version: 1.2.7i2
+Date: 1433839820
+Class: feature
+
+Before the filesystem rulset was used. If you already created parameters for this check
you have the recreate this parameters in the new rule.
+
diff --git a/ChangeLog b/ChangeLog
index 2a6a890..ab5bef8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,8 @@
WATO:
* 1254 The target address for crash reports can now be configured in wato global
settings
+ * 1256 lvm_vgs: Check now has his own configuration in wato...
+ NOTE: Please refer to the migration notes!
BI:
* 2336 FIX: BI compilation diagnostics are now logged to the generic web.log...
diff --git a/checks/lvm_vgs b/checks/lvm_vgs
index 38c9c67..f2aa383 100644
--- a/checks/lvm_vgs
+++ b/checks/lvm_vgs
@@ -42,6 +42,6 @@ check_info['lvm_vgs'] = {
"inventory_function" : inventory_lvm_vgs,
"service_description" : "LVM VG %s",
"has_perfdata" : True,
- "group" : "filesystem",
+ "group" : "volume_groups",
"default_levels_variable" : "filesystem_default_levels",
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 244dad2..2803fe5 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2604,6 +2604,79 @@ register_check_parameters(
register_check_parameters(
subgroup_storage,
+ "volume_groups",
+ _("Volume Groups (LVM)"),
+ Dictionary(
+ elements = [
+ ("levels",
+ Alternative(
+ title = _("Levels for volume group"),
+ show_alternative_title = True,
+ default_value = (80.0, 90.0),
+ match = match_dual_level_type,
+ elements = [
+ get_free_used_dynamic_valuespec("used",
"volume group"),
+ Transform(
+ get_free_used_dynamic_valuespec("free",
"filesystem", default_value = (20.0, 10.0)),
+ title = _("Levels for free space"),
+ allow_empty = False,
+ forth = transform_filesystem_free,
+ back = transform_filesystem_free
+ )
+ ]
+ )
+ ),
+ # Beware: this is a nasty hack that helps us to detect new-style paramters.
+ # Something hat has todo with float/int conversion and has not been
documented
+ # by the one who implemented this.
+ ( "flex_levels",
+ FixedValue(
+ None,
+ totext = "",
+ title = "",
+ )),
+ ( "show_levels",
+ DropdownChoice(
+ title = _("Display warn/crit levels in check output..."),
+ choices = [
+ ( "onproblem", _("Only if the status is
non-OK")),
+ ( "onmagic", _("If the status is non-OK or a magic
factor is set")),
+ ( "always", _("Always") ),
+ ],
+ default_value = "onmagic",
+ )),
+ ( "magic",
+ Float(
+ title = _("Magic factor (automatic level adaptation for large
volume groups)"),
+ default_value = 0.8,
+ minvalue = 0.1,
+ maxvalue = 1.0)),
+ ( "magic_normsize",
+ Integer(
+ title = _("Reference size for magic factor"),
+ default_value = 20,
+ minvalue = 1,
+ unit = _("GB"))),
+ ( "levels_low",
+ Tuple(
+ title = _("Minimum levels if using magic factor"),
+ help = _("The levels will never fall below these values, when
using "
+ "the magic factor and the volume group is very
small."),
+ elements = [
+ Percentage(title = _("Warning at"), unit = _("%
usage"), allow_int = True, default_value=50),
+ Percentage(title = _("Critical at"), unit = _("%
usage"), allow_int = True, default_value=60)])),
+
+ ],
+ hidden_keys = ["flex_levels"],
+ ),
+ TextAscii(
+ title = _("Volume Group"),
+ allow_empty = False),
+ "dict"
+)
+
+register_check_parameters(
+ subgroup_storage,
"ibm_svc_mdiskgrp",
_("IBM SVC Pool Capacity"),
Dictionary(