Module: check_mk
Branch: master
Commit: 0a1a9f5a4229a678390a8dff1d970aaaf793d3cf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0a1a9f5a4229a6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Aug 17 14:06:30 2015 +0200
Minor code cleanup
---
checkman/emc_isilon_quota | 5 ++-
checks/emc_isilon_quota | 77 ++++++++++++++++++++++-----------------
web/plugins/metrics/check_mk.py | 16 +++++---
3 files changed, 58 insertions(+), 40 deletions(-)
diff --git a/checkman/emc_isilon_quota b/checkman/emc_isilon_quota
index c6fcf6a..55096d9 100644
--- a/checkman/emc_isilon_quota
+++ b/checkman/emc_isilon_quota
@@ -4,7 +4,10 @@ catalog: hw/storagehw/emc
license: GPL
distribution: check_mk
description:
- Checks the configured quotas in EMC Isilon storage devices.
+ Checks the configured quotas in EMC Isilon storage devices. The logic of
+ the check is identical with filesystem checking. The hard thresholds of
+ the quota is treated as the size. If this is missing, then the soft- or
+ advisory thresholds are being used instead.
item:
The path of the quota
diff --git a/checks/emc_isilon_quota b/checks/emc_isilon_quota
index 5de9a71..ef160d4 100644
--- a/checks/emc_isilon_quota
+++ b/checks/emc_isilon_quota
@@ -24,71 +24,82 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# emc_isilon_quota_types = {
+# 0: "default_user",
+# 1: "user",
+# 2: "default-group",
+# 3: "group",
+# 4: "directory",
+# 5: "special",
+# 6: "max"
+# }
-factory_settings["emc_isilon_quota"] = {}
+def inventory_emc_isilon_quota(info):
+ mount_points = []
-emc_isilon_quota_types = {
- 0: "default_user",
- 1: "user",
- 2: "default-group",
- 3: "group",
- 4: "directory",
- 5: "special",
- 6: "max"
-}
+ for path, hard_threshold, soft_threshold_defined, soft_threshold, \
+ advisory_threshold_defined, advisory_threshold, usage in info:
+ mount_points.append(path)
+ return df_inventory(mount_points)
-def inventory_emc_isilon_quota(info):
- return df_inventory([quota[1] for quota in info])
def check_emc_isilon_quota(item, params, info):
byte_to_mb = float(1024 * 1024)
fslist_blocks = []
- for quota in info:
- mountpoint = quota[1]
- if "patterns" in params or item == mountpoint:
+ for path, hard_threshold, soft_threshold_defined, soft_threshold, \
+ advisory_threshold_defined, advisory_threshold, usage in info:
+
+ if "patterns" in params or item == path:
# note 1: quota type is currently unused
# note 2: even if quotaHardThresholdDefined is 0 the
# quotaHardThreshold is still often set to a reasonable value.
Otherwise,
# use the "hardest" threshold that isn't 0 for the disk
limit
- hard_limit = long(quota[3]) # can't be exceeded
- soft_limit = long(quota[5]) # write-protect after grace period
- advisory_limit = long(quota[7]) # warning only
- limit = hard_limit or soft_limit or advisory_limit
+ hard_threshold = int(hard_threshold) # can't be exceeded
+ soft_threshold = int(soft_threshold) # write-protect after grace
period
+ advisory_threshold = int(advisory_threshold) # warning only
+ assumed_size = hard_threshold or soft_threshold or advisory_threshold
- if "levels" not in params and (quota[4] == '1' or quota[6]
== '1'):
- # if a soft limit is set, it will be used as crit (since the hard_limit
can't be
+ # If the users has not configured levels, we use the soft/advisory threshold
+ if "levels" not in params and (soft_threshold_defined ==
'1' or advisory_threshold_defined == '1'):
+ # if a soft threshold is set, it will be used as crit (since the
hard_threshold can't be
# exceeded anyway)
- crit = soft_limit or (limit * 0.9)
- # if a advisory limit is set, it will be used as warning level
- warn = advisory_limit or (crit * 0.9)
- params["levels"] = (warn * 100.0) / limit, (crit * 100.0) /
float(limit)
+ crit = soft_threshold or (assumed_size * 0.9)
+ # if a advisory threshold is set, it will be used as warning level
+ warn = advisory_threshold or (assumed_size * 0.8)
+
+ params = params.copy()
+ params["levels"] = (warn * 100.0) / assumed_size, (crit *
100.0) / assumed_size
+
+ avail = assumed_size - int(usage)
+ fslist_blocks.append((path, assumed_size / byte_to_mb, avail / byte_to_mb,
0))
- avail = limit - long(quota[8])
- fslist_blocks.append((mountpoint, limit / byte_to_mb, avail / byte_to_mb,
0))
return df_check_filesystem_list(item, params, fslist_blocks)
+
check_info["emc_isilon_quota"] = {
"check_function" : check_emc_isilon_quota,
"inventory_function" : inventory_emc_isilon_quota,
"service_description" : "Quota %s",
+ "has_perfdata" : True,
"snmp_info" : (".1.3.6.1.4.1.12124.1.12.1.1",
- [ 2, # quotaType
+ [
5, # quotaPath
- 6, # quotaHardThresholdDefined
7, # quotaHardThreshold
8, # quotaSoftThresholdDefined
9, # quotaSoftThreshold
10, # quotaAdvisoryThresholdDefined
11, # quotaAdvisoryThreshold
13, # quotaUsage
- 14, # quotaUsageWithOverhead
- 16, # quotaIncludesOverhead
- #12, # quotaGracePeriod
- #15, # quotaInodeUsage # apparently doesn't
provide the total
+ # 2, # quotaType
+ # 6, # quotaHardThresholdDefined
+ # 14, # quotaUsageWithOverhead
+ # 16, # quotaIncludesOverhead
+ # 12, # quotaGracePeriod
+ # 15, # quotaInodeUsage # apparently doesn't
provide the total
# number of inodes, so
this is
# useless to us
]),
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index e2619d3..37b396d 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -711,7 +711,7 @@ metric_info["threads_idle"] = {
}
metric_info["threads_rate"] = {
- "title" : _("Threads per second"),
+ "title" : _("Thread creations per second"),
"unit" : "1/s",
"color" : "44/a",
}
@@ -730,7 +730,7 @@ metric_info["threads_max"] = {
}
metric_info["threads_total"] = {
- "title" : _("Number of threads since starting JVM"),
+ "title" : _("Number of threads"),
"unit" : "count",
"color" : "41/a",
}
@@ -743,14 +743,17 @@ metric_info["threads_busy"] = {
metric_info["vol_context_switches"] = {
"title" : _("Voluntary context switches"),
- "help" : _("A voluntary context switch occurs when a thread blocks
because it requires a resource that is unavailable"),
+ "help" : _("A voluntary context switch occurs when a thread blocks
"
+ "because it requires a resource that is unavailable"),
"unit" : "count",
"color" : "36/a",
}
metric_info["invol_context_switches"] = {
"title" : _("Involuntary context switches"),
- "help" : _("An involuntary context switch takes place when a thread
executes for the duration of its time slice or when the system identifies a
higher-priority thread to run"),
+ "help" : _("An involuntary context switch takes place when a thread
"
+ "executes for the duration of its time slice or when the "
+ "system identifies a higher-priority thread to run"),
"unit" : "count",
"color" : "45/b",
}
@@ -2126,7 +2129,7 @@ metric_info["gc_reclaimed_redundant_memory_areas"] = {
}
# TODO: ? GCs/sec? oder Avg time? Oder was?
-metric_info["gc_reclaimed_redundant_memory_areas_time"] = {
+metric_info["gc_reclaimed_redundant_memory_areas_rate"] = {
"title" : _("Reclaiming redundant memory areas"),
"unit" : "1/s",
"color" : "32/a",
@@ -2532,7 +2535,7 @@ check_metrics["check-mk-host-tcp"] = {
check_metrics["check_mk-jolokia_metrics.gc"] = {
"CollectionCount" : { "name" :
"gc_reclaimed_redundant_memory_areas" },
- "CollectionTime" : { "name" :
"gc_reclaimed_redundant_memory_areas_time", "scale" : 1/60 },
+ "CollectionTime" : { "name" :
"gc_reclaimed_redundant_memory_areas_rate", "scale" : 1 / 60.0 },
}
check_metrics["check_mk-rmon_stats"] = {
@@ -2750,6 +2753,7 @@ check_metrics["check_mk-fast_lta_silent_cubes.capacity"]
= df_translation
check_metrics["check_mk-fast_lta_volumes"] =
df_translation
check_metrics["check_mk-libelle_business_shadow.archive_dir"] =
df_translation
check_metrics["check_mk-netapp_api_volume"] =
df_translation
+check_metrics["check_mk-emc_isilon_quota"] =
df_translation
# in=0;;;0; inucast=0;;;; innucast=0;;;; indisc=0;;;; inerr=0;0.01;0.1;; out=0;;;0;
outucast=0;;;; outnucast=0;;;; outdisc=0;;;; outerr=0;0.01;0.1;; outqlen=0;;;0;
if_translation = {