Module: check_mk
Branch: master
Commit: 1514b256f1b1563145be068a399624ef0b2ace60
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1514b256f1b156…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 17 16:25:01 2016 +0100
3272 oracle_tablespaces: severity of check for autoextension is now configurable
There is now a new check parameter that defines the check state in case that
the current autoextension setting does not match the expected setting. The
expected setting is either determined during discovery (default) or by an
explicit value in the rule.
By setting the state in such a case to OK the checking for autoextension
is effectlivey turned off.
Since the expected autoextension setting and the severity are two different
parameters you can easily create independent rules for the expected setting
and the severity of a mismatch.
---
.werks/3272 | 19 +++++++++
ChangeLog | 1 +
checkman/oracle_tablespaces | 72 ++++------------------------------
checks/oracle_tablespaces | 22 ++++++++---
web/plugins/wato/check_parameters.py | 16 ++++++--
5 files changed, 56 insertions(+), 74 deletions(-)
diff --git a/.werks/3272 b/.werks/3272
new file mode 100644
index 0000000..5959e13
--- /dev/null
+++ b/.werks/3272
@@ -0,0 +1,19 @@
+Title: oracle_tablespaces: severity of check for autoextension is now configurable
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1458228140
+Class: feature
+
+There is now a new check parameter that defines the check state in case that
+the current autoextension setting does not match the expected setting. The
+expected setting is either determined during discovery (default) or by an
+explicit value in the rule.
+
+By setting the state in such a case to OK the checking for autoextension
+is effectlivey turned off.
+
+Since the expected autoextension setting and the severity are two different
+parameters you can easily create independent rules for the expected setting
+and the severity of a mismatch.
diff --git a/ChangeLog b/ChangeLog
index 290a20a..c69076f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 3103 brocade_optical: new check to monitor signal strength of optical network ports
on Brocade switches
* 3303 cisco_fru_module_status: new check which monitors the operational status of
FRU modules of Cisco devices which support the CISCO-ENTITY-FRU-CONTROL-MIB
* 3012 jolokia_metrics.threads: Improved check output, now showing the actual problem
and levels
+ * 3272 oracle_tablespaces: severity of check for autoextension is now
configurable...
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checkman/oracle_tablespaces b/checkman/oracle_tablespaces
index c5b2304..06eb929 100644
--- a/checkman/oracle_tablespaces
+++ b/checkman/oracle_tablespaces
@@ -9,17 +9,13 @@ description:
and the autoextension and optionally the setting of
the increment size.
- {Autoextension}: During inventory the autoextension
- setting is determined and frozen into the check parameter.
- That means that if the auto extension setting changes
- later, the check will get critical. A table space may
- consist of several data files with different settings.
- If at least one data file has auto extension turned on,
- the table space is considered to have auto extension
- turned on. You can turn off auto extension checking
- by setting the first check parameter to {None} rather
- then to {True} or {False}. Inventory will do this for
- you if you set {oracle_tablespaces_check_autoext} to {False}.
+ {Autoextension}: During inventory the autoextension setting is determined
+ and remembered for later. That means that if the auto extension setting
+ changes later, the check will get critical. A table space may consist of
+ several data files with different settings. If at least one data file
+ has auto extension turned on, the table space is considered to have auto
+ extension turned on. The behaviour of autoextension setting can be configured
+ with a check parameter.
{Increment size}: If the configuration parameter
{oracle_tablespaces_check_default_increment} is set to
@@ -50,16 +46,6 @@ item:
A string composited of the SID and the tablespace name,
separated by a dot, for example {"pengt.TEMP"}.
-examples:
- # Set levels for free space to 20% (WARN) and 10% (CRIT)
- # of maximum tablespace size and deactivate check of autoextend
-
-
- oracle_tablespaces_defaults = {
- "levels" : (20.0, 10.0),
- "autoextend" : None
- }
-
perfdata:
Three values in bytes: the current size, the used size of the tablespace
and the maximum size of the table space.
@@ -68,47 +54,3 @@ inventory:
One separate check will be created for each tablespace
which is {ONLINE}.
-[parameters]
-parameters (dict):
-
- {"autoextend"}: Either {True} or {False} - depending on whether auto extension
is
- expected to be on or off
-
- {"levels"}: By default a tuple containing the warn and crit levels for free
space.
- Supported types (int / float). If this is a float, it is considered as
- percentage of the maximum size of the tablespace. If it is an integer,
- it is considered to be MB of free space. If the space drops to this level or below,
- the check will get into warning state. Default is {(10.0, 5.0)}.
- This check also supports some kind of dynamic level definition. Using this you can
- apply thresholds to tablespace checks depending on their size, just like using the
- magic factor, but more simple do configure. To configure thi, you have to set this
- variable to a list of tuples, where the first element is an integer representing
- the minimum tablespace size in bytes to apply these thresholds to and a tuple
- containing the thresholds as described above.
-
- {"magic"}: The magic number, which scales the levels according to the
tablespace size.
- Default is a factor of 1.0, which does no adaptation. A factor less than 1.0 lowers the
- percentual levels for the free space in large tablespaces and raises them for small
ones.
-
- {"magic_normsize"}: Norm size of a tablespace for the magic computation
- The default for this is {1000}. It is measured in {MB}.
-
- {"magic_maxlevels"}: Maximum levels if using magic factor. The warn / crit
levels will go beyond
- these numbers. The preset is set to (60.0, 50.0)
-
-[configuration]
-oracle_tablespaces_check_autoext(bool): This boolean setting determines, whether
- inventory should activate monitoring of the auto extension setting. Per default
- this is set to {True}, so the current state of the auto extension will be
- put into the check parameters as either {True} or {False}. If you set the
- configuration variable to {False}, then inventory will enter {None} as
- check parameter und thus disable the checking of the auto extensible flag
- for newly inventorized table spaces.
-
-oracle_tablespaces_check_default_increment(bool): This setting does not
- control inventory but is used live during the checking und thus affects
- all checks, not only newly inventorized ones. Per default it is set to
- {True}. That way the check will warn if the table space has its increment
- size set to {1} (the ORACLE default value).
-
-oracle_tablespaces_defaults(dict): A dictionary with the optional keys mentioned in
parameters
diff --git a/checks/oracle_tablespaces b/checks/oracle_tablespaces
index 6d07628..c939aa5 100644
--- a/checks/oracle_tablespaces
+++ b/checks/oracle_tablespaces
@@ -45,7 +45,9 @@ factory_settings["oracle_tablespaces_defaults"] = {
"defaultincrement": True,
}
-# Whether to check auto extend settings
+# Whether to check auto extend settings. Note: this setting is not ment to
+# be changed anymore. It cannot be edited via WATO either. There now exists
+# a check parameter, where the behaviour can be configured on a per-service-base.
oracle_tablespaces_check_autoext = True
# this parameter is deprecated and needed for old configurations with
@@ -267,11 +269,21 @@ def check_oracle_tablespaces(item, params, parsed):
# Check autoextend status if parameter not set to None
if autoext != None:
if autoext and num_extensible == 0:
- infotext += ", NO AUTOEXTEND(!!)"
- status = 2
+ autoext_info = "NO AUTOEXTEND"
elif not autoext and num_extensible > 0:
- infotext += ", AUTOTEXTEND(!!)"
- status = 2
+ autoext_info = "AUTOTEXTEND"
+ else:
+ autoext_info = None
+
+ if autoext_info:
+ autoextend_severity = params.get("autoextend_severity", 2)
+ if autoextend_severity == 2 or status == 2:
+ status = 2
+ else:
+ status = max(autoextend_severity, status)
+ infotext += ", " + autoext_info +
state_markers[autoextend_severity]
+
+
elif num_extensible > 0:
infotext += ", autoextend"
else:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 399dd78..bbf30a6 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5694,10 +5694,18 @@ register_check_parameters(
"This rule allows you to define checks on the size of
tablespaces."),
elements = db_levels_common + [
( "autoextend",
- Checkbox(
- title = _("Autoextend"),
- label = _("Autoextension is expected"),
- help = "")),
+ DropdownChoice(
+ title = _("Expected autoextend setting"),
+ choices = [
+ ( True, _("Autoextend is expected to be ON")),
+ ( False, _("Autoextend is expected to be OFF")),
+ ]
+ )),
+ ( "autoextend_severity",
+ MonitoringState(
+ title = _("Severity of invalid autoextend setting"),
+ default_value = 2,
+ )),
( "defaultincrement",
Checkbox(
title = _("Default Increment"),