Module: check_mk
Branch: master
Commit: 2fbda338b2e6167bef7cfb57f1af7294faaa67db
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2fbda338b2e616…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Feb 27 13:42:43 2011 +0100
FIX: replaced filesystem_trend_perfdata with parameter "trend_perfdata"
---
ChangeLog | 2 ++
checkman/df | 17 +++++++++++------
checks/df.include | 12 ++++--------
3 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d797888..e8e5aff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,8 @@
0% due to integer division)
* FIX: fixed manual of df (magic_norm -> magic_normsize)
* Added Perf-O-Meter for non-df filesystem checks (e.g. netapp)
+ * FIX: removed filesystem_trend_perfdata. It didn't work. Use
+ now df-parameter "trend_perfdata" (see new man page of df)
1.1.9i9:
diff --git a/checkman/df b/checkman/df
index 0445723..93b270b 100644
--- a/checkman/df
+++ b/checkman/df
@@ -48,11 +48,15 @@ examples:
"trend_mb" : (10, 20), # MB of change during trend_range
"trend_perc" : (1, 2), # Percent change during trend_range
"trend_timeleft" : (72, 48) # run time left in hours until full
+ "trend_perfdata" : False # no performance data for trends
}
# alternative[2]: Just change the default partially
filesystem_default_levels["magic"] = 0.8
+ # Make df output trend performance data (beware of exsting RRDs)
+ filesystem_default_levels["trend_perfdata"] = True
+
# Override warning/critical levels for all checks where
# levels are "filesystem_default_levels"
@@ -81,13 +85,13 @@ examples:
perfdata:
One or three values: The first value is the used space of the filesystem
in MB. Also the minimum (0 MB), maximum (size of the filesystem) and the warning and
critical
- levels in MB are provided. If you set {filesystem_trend_perfdata = True}, then
+ levels in MB are provided. If you set the parameter {"trend_perfdata" : True},
then
two additional values are output: the change of the usage in MB per range
since the last check (e.g. in MB per 24 hours) and the averaged change (so called
trend),
- also in MB per range.
+ also in MB per range. This can done globally in {main.mk} by
{filesystem_default_levels["trend_perfdata"] = True}.
Please note, that - until you use the storage type {MULTIPLE} in PNP4Nagios -
- changing the setting of {filesystem_trend_perfdata} will stop all updates to
+ changing the parameter {"trend_perfdata"} will stop all updates to
your existing filesystem RRDs. You need either to delete or convert your RRDs
if you want to change.
@@ -141,6 +145,10 @@ parameters (dict): This check supports two types of parameters. The
the disk is full is 48 hours or less. It will get critical if only
24 hours are assumed to be left.
+ {"trend_perfdata"}: If this is set to {True}, then the check will
+ output two further performance data values: the current growth
+ and the trend.
+
It is still possible to specify a pair or triple of numbers
{instead} of a dictionary:
@@ -161,6 +169,3 @@ inventory_df_exclude_mountpoints (list of strings): List of mount
points to excl
filesystem_default_levels: Default levels for filesystem detected by inventory.
This variable is preset to {{ "levels" : (80, 90), "magic_normsize"
: 20,
"levels_low" : (50, 60), "trend_range" : 24 }}
-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.
diff --git a/checks/df.include b/checks/df.include
index b8e60bc..6baec92 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -53,16 +53,12 @@ filesystem_default_levels = {
"levels" : (80, 90), # warn/crit in percent
"magic_normsize" : 20, # Standard size if 20 GB
"levels_low" : (50, 60), # Never move warn level below 50% due to
magic factor
- "trend_range" : 24
+ "trend_range" : 24,
+ "trend_perfdata" : False, # do not send performance data for trends
}
# Users might have set filesystem_default_levels to old format like (80, 90)
-# Turn off trend perfdata per default in order to keep
-# compatible to existing RRDs
-filesystem_trend_perfdata = False
-
-
# needed by df, df_netapp and vms_df and maybe others in future:
# compute warning and critical levels. Takes into account the size of
# the filesystem and the magic number. Since the size is only known at
@@ -164,7 +160,7 @@ def df_check_filesystem(hostname, mountpoint, size_mb, avail_mb,
params):
this_time = time.time()
# rate in MB/s, allow negative
timdif, rate = get_counter("df.%s.delta" % mountpoint, this_time,
used_mb, True)
- if filesystem_trend_perfdata:
+ if levels.get("trend_perfdata"):
perfdata.append(("growth", rate * range_sec))
# average trend, initialize with zero
timedif, rate_avg = get_average("df.%s.trend" % mountpoint,
this_time, rate, range_sec, True)
@@ -202,7 +198,7 @@ def df_check_filesystem(hostname, mountpoint, size_mb, avail_mb,
params):
status = 2
problems[-1] += "!"
- if filesystem_trend_perfdata:
+ if levels.get("trend_perfdata"):
perfdata.append(("trend", trend, wa, cr, 0, size_mb / range))
# compute time until filesystem is full (only for positive trend, of course)