Module: check_mk
Branch: master
Commit: 1e2311db556d506f598e81aa4afdea9db8b87ed8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e2311db556d50…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 27 13:12:41 2011 +0100
df: use levels_low instaed of df_lowest_...
---
ChangeLog | 2 +-
checkman/df | 2 --
checks/df.include | 14 +++++++-------
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 529e16d..309aa11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,7 @@
* FIX: repaired apc_symmetra (was broken due to new option -Ot
for SNMP)
* FIX: df, hr_fs and other filesystem checks: fix bug if using
- magic number.
+ magic number. levels_low is now honored.
* FIX: scan function avoids hr_cpu and ucd_cpu_utilization
at the same time
* FIX: HP-UX agent: fixed output of df for long mount points
diff --git a/checkman/df b/checkman/df
index a38630b..0445723 100644
--- a/checkman/df
+++ b/checkman/df
@@ -164,5 +164,3 @@ filesystem_default_levels: Default levels for filesystem detected by inventory.
filesystem_trend_perfdata (boolean): Whether or not to output trend performance data. This is
preset to {False} so that no trend performance data is output. If you change this setting you
need to convert or delete all RRD databases of filesystems.
-df_lowest_warning_level(int): The magic factor will never lower the warning level for filesystems below this percentage. The default is {50}.
-df_lowest_critical_level(int): This is the minimum critical level when using the magic factor. This is preset to {60} (percent).
diff --git a/checks/df.include b/checks/df.include
index 5fbb42d..b8e60bc 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -28,9 +28,8 @@
# OBSOLETE:
# df_magicnumber_normsize = 20 # Standard size if 20 GB
-
-df_lowest_warning_level = 50 # Never move warn level below 50% due to magic factor
-df_lowest_critical_level = 60 # Never move crit level below 60% due to magic factor
+# df_lowest_warning_level = 50 # Never move warn level below 50% due to magic factor
+# df_lowest_critical_level = 60 # Never move crit level below 60% due to magic factor
# Settings for filesystem checks (df, df_vms, df_netapp and maybe others)
filesystem_levels = [] # obsolete. Just here to check config and warn if changed
@@ -103,10 +102,11 @@ def get_filesystem_levels(host, mountpoint, size_gb, params):
crit_scaled = 100 - (( 100 - crit ) * scale)
# Make sure, levels do never get too low due to magic factor
- if warn_scaled < df_lowest_warning_level:
- warn_scaled = df_lowest_warning_level
- if crit_scaled < df_lowest_critical_level:
- crit_scaled = df_lowest_critical_level
+ lowest_warning_level, lowest_critical_level = levels["levels_low"]
+ if warn_scaled < lowest_warning_level:
+ warn_scaled = lowest_warning_level
+ if crit_scaled < lowest_critical_level:
+ crit_scaled = lowest_critical_level
else:
warn_scaled = warn
crit_scaled = crit
Module: check_mk
Branch: master
Commit: 7fbcd746b446cb3776808aab8e9e70fd1e39aacf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7fbcd746b446cb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 27 12:45:13 2011 +0100
FIX: precompile: include files before checks
---
ChangeLog | 2 ++
modules/check_mk.py | 22 +++++++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index decec2f..94d9768 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
Core, Setup, etc.:
* FIX: do not assume 127.0.0.1 as IP address for usewalk_hosts if
they are not SNMP hosts.
+ * FIX: precompile: make sure check includes are added before actual
+ checks
Checks & Agents:
* FIX: drbd now handles output of older version without an ep field
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 6685637..51ececb 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2015,20 +2015,25 @@ no_inventory_possible = None
# check info table
# We need to include all those plugins that are referenced in the host's
# check table
- filenames = set([])
+ filenames = []
for checktype in needed_types:
+ # Add library files needed by check (also look in local)
+ for lib in check_includes.get(checktype, []):
+ if local_checks_dir and os.path.exists(local_checks_dir + "/" + lib):
+ to_add = local_checks_dir + "/" + lib
+ else:
+ to_add = checks_dir + "/" + lib
+ if to_add not in filenames:
+ filenames.append(to_add)
+
+ # Now add check file itself
path = find_check_plugin(checktype)
if not path:
raise MKGeneralException("Cannot find plugin for check type %s (missing file %s/%s)\n" % \
(checktype, checks_dir, checktype))
- filenames.add(path)
+ if path not in filenames:
+ filenames.append(path)
- # Add library files needed by check (also look in local)
- for lib in check_includes.get(checktype, []):
- if local_checks_dir and os.path.exists(local_checks_dir + "/" + lib):
- filenames.add(local_checks_dir + "/" + lib)
- else:
- filenames.add(checks_dir + "/" + lib)
output.write("check_info = {}\n" +
"check_includes = {}\n" +
@@ -2038,7 +2043,6 @@ no_inventory_possible = None
"snmp_info_single = {}\n" +
"snmp_scan_functions = {}\n")
-
for filename in filenames:
output.write("# %s\n" % filename)
output.write(stripped_python_file(filename))
Module: check_mk
Branch: master
Commit: c03bfc8b5c13b10bba0191ca998afa97742b3830
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c03bfc8b5c13b1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 27 12:36:06 2011 +0100
Updated bug entries
---
.bugs/159 | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/.bugs/159 b/.bugs/159
new file mode 100644
index 0000000..67832a3
--- /dev/null
+++ b/.bugs/159
@@ -0,0 +1,18 @@
+Title: Make PING timeouts configurable via main.mk
+Component: core
+Benefit: 3
+State: open
+Cost: 2
+Date: 2011-02-27 12:33:39
+Class: feature
+
+The proposed way via extra_host_conf["check_command"] is possible
+but difficult for many.
+
+Better would be:
+
+ping_levels = [ ( 200, 500, 40, 80 ), [ "wan" ], ALL_HOSTS ]
+
+Wie would need to make the check-host-alive and check-mk-ping commands
+take an argument $ARG1$ that would be appended to the command line
+and would the infuse options like -w and -c there.