Module: check_mk
Branch: master
Commit: fe3e337f3f8371ef19d6a70b139b56f24930ec21
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe3e337f3f8371…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 17 08:18:41 2010 +0100
finally removed filesystem_levels
---
ChangeLog | 1 +
LIESMICH.zutun | 7 +++----
checks/df | 1 -
checks/df_netapp | 1 -
checks/df_netapp32 | 1 -
checks/vms_df | 1 -
modules/check_mk.py | 26 ++++++--------------------
modules/check_mk_base.py | 7 -------
8 files changed, 10 insertions(+), 35 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bf4873c..ca6645f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* You need a current version of Livestatus for Multisite to work!
* Multisite: removed (undocumented) view parameters show_buttons and show_controls.
Please use display_options instead.
+ * Finally removed deprecated filesystem_levels. Please use check_parameters instead.
Core, Setup, etc.:
* Create alias 'cmk' for check_mk in bin/ (easier typing)
diff --git a/LIESMICH.zutun b/LIESMICH.zutun
index 7bba7c7..3dac633 100644
--- a/LIESMICH.zutun
+++ b/LIESMICH.zutun
@@ -112,13 +112,12 @@ versuchen und wenn das nicht geht auf v1 umschalten. Falls das nicht
geht, dann
kann man eben kein SNMP machen.
--------------------------------------------------------------------------------
-ab 1.1.11i1
+AUFRAUMEN bis 1.2.0:
-filesystem_levels wirklich rausnehmen. Hinweis, dass check_parameters verwendet
-werden soll.
+Gemeinsamen Code von df-Checks in df.include auslagern (get_filesystem_levels,
+filesystem_default_levels, etc.)
--------------------------------------------------------------------------------
---------------------------------------------------------------------------------
UNSCHOENHEITEN
--------------------------------------------------------------------------------
diff --git a/checks/df b/checks/df
index e8f1190..a809e35 100644
--- a/checks/df
+++ b/checks/df
@@ -101,4 +101,3 @@ def inventory_df(checkname, info):
return inventory
check_info['df'] = (check_df, "fs_%s", 1, inventory_df)
-precompile_params['df'] = precompile_filesystem_levels
diff --git a/checks/df_netapp b/checks/df_netapp
index 201a413..cad4a3f 100644
--- a/checks/df_netapp
+++ b/checks/df_netapp
@@ -68,4 +68,3 @@ def inventory_df_netapp(checkname, info):
check_info['df_netapp'] = (check_df_netapp, "fs_%s", 1,
inventory_df_netapp)
snmp_info['df_netapp'] = ("1.3.6.1.4.1.789.1.5.4.1", [ 2, 29,
30 ] )
-precompile_params['df_netapp'] = precompile_filesystem_levels
diff --git a/checks/df_netapp32 b/checks/df_netapp32
index 1a6ef8c..d933a2f 100644
--- a/checks/df_netapp32
+++ b/checks/df_netapp32
@@ -82,4 +82,3 @@ def inventory_df_netapp32(checkname, info):
check_info['df_netapp32'] = (check_df_netapp32, "fs_%s", 1,
inventory_df_netapp32)
snmp_info['df_netapp32'] = ("1.3.6.1.4.1.789.1.5.4.1", [ 2, 3,
4 ] )
-precompile_params['df_netapp32'] = precompile_filesystem_levels
diff --git a/checks/vms_df b/checks/vms_df
index 9ecbc63..4caf99a 100644
--- a/checks/vms_df
+++ b/checks/vms_df
@@ -66,4 +66,3 @@ def check_vms_df(item, params, info):
return (3, "Disk %s not found" % (item,))
check_info['vms_df'] = ( check_vms_df, "fs_%s", 1,
inventory_vms_df )
-precompile_params['vms_df'] = precompile_filesystem_levels
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 9598889..0066d6a 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -343,19 +343,6 @@ def no_inventory_possible(checkname, info):
sys.stderr.write("Sorry. No inventory possible for check type %s.\n" %
checkname)
sys.exit(3)
-def lookup_filesystem_levels(host, mountpoint):
- levels = service_extra_conf(host, mountpoint, filesystem_levels)
- # may return 0, 1 or more answers
- if len(levels) == 0:
- return filesystem_default_levels
- else:
- return levels[0]
-
-def precompile_filesystem_levels(host, item, params):
- if params is filesystem_default_levels:
- params = lookup_filesystem_levels(host, item)
- return params
-
# +----------------------------------------------------------------------+
# | _ _ _ _ |
@@ -1180,6 +1167,12 @@ def create_nagios_config(outfile = sys.stdout, hostnames = None):
if summary_service_notification_periods != []:
raise MKGeneralException("summary_service_notification_periods is not longer
supported. Please use extra_summary_service_conf['notification_period']
instead.")
+ if filesystem_levels != []:
+ raise MKGeneralException("filesystem_levels is not longer
supported.\n"
+ "Please use check_parameters instead.\n"
+ "Please refer to documentation:\n"
+ " -->
http://mathias-kettner.de/checkmk_check_parameters.html\n")
+
output_conf_header(outfile)
if hostnames == None:
hostnames = all_hosts_untagged + all_active_clusters()
@@ -1988,8 +1981,6 @@ opt_debug = False
# make sure these names are defined (even if never needed)
no_inventory_possible = None
-precompile_filesystem_levels = None
-filesystem_default_levels = None
""")
# Compile in all neccessary global variables
@@ -3841,11 +3832,6 @@ for name in vars_after_config:
errors += 1
# Special handling for certain deprecated variables
-if filesystem_levels != []:
- sys.stderr.write("WARNING: filesystem_levels is deprecated and will be
removed\n"
- "any decade now. Please use check_parameters instead! Details can
be\n"
- "found at
http://mathias-kettner.de/checkmk_check_parameters.html.\n")
-
if type(snmp_communities) == dict:
sys.stderr.write("ERROR: snmp_communities cannot be a dict any more.\n")
errors += 1
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 2207999..7a296a4 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -956,13 +956,6 @@ def nodes_of(hostname):
# the filesystem and the magic number. Since the size is only known at
# check time this function's result cannot be precompiled.
def get_filesystem_levels(host, mountpoint, size_gb, params):
- # If no explicit levels are set, we take the configuration variable
- # 'filesystem_levels' into account. This can *never* happen when
- # we are running precompiled since the levels are then always
- # explicit.
- if params is filesystem_default_levels:
- params = lookup_filesystem_levels(g_hostname, mountpoint)
-
# If no magic factor is given, we use the neutral factor 1.0
if len(params) < 3:
params = (params[0], params[1], 1.0)