Module: check_mk
Branch: master
Commit: 90be5c7de87d5b93e104b5eee5f58115f307438e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90be5c7de87d5b…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Apr 23 17:53:43 2014 +0200
optimizing/unifying outputs
---
checks/df.include | 9 +++++++--
pnp-templates/check_mk-ibm_svc_nodestats.iops.php | 22 ++++++++++-----------
web/plugins/perfometer/check_mk.py | 4 ++--
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/checks/df.include b/checks/df.include
index d4f804b..91b5093 100644
--- a/checks/df.include
+++ b/checks/df.include
@@ -304,8 +304,13 @@ def df_check_filesystem_single(hostname, mountpoint, size_mb,
avail_mb, inodes_t
# TODO: In some future version use a fixed name as perf variable
perf_var = mountpoint.replace(" ", "_")
perfdata = [(perf_var, str(used_mb) + 'MB', warn_mb, crit_mb, 0, size_mb)]
- infotext = "%.1f %% used (%.2f of %.1f GB), %s" % \
- (used_perc, used_mb / 1024.0, size_gb, levels["levels_text"])
+
+ if size_gb < 10240:
+ infotext = "%.1f %% used (%.2f of %.2f GB), %s" % \
+ (used_perc, used_mb / 1024.0, size_gb,
levels["levels_text"])
+ else:
+ infotext = "%.1f %% used (%.2f of %.2f TB), %s" % \
+ (used_perc, used_mb / 1024.0 / 1024.0, size_gb / 1024.0,
levels["levels_text"])
# Trends. The trends are computed in two steps. In the first step we
# compute the delta to the last check, using a normal check_mk counter.
diff --git a/pnp-templates/check_mk-ibm_svc_nodestats.iops.php
b/pnp-templates/check_mk-ibm_svc_nodestats.iops.php
index 2a39a76..7c35b2b 100644
--- a/pnp-templates/check_mk-ibm_svc_nodestats.iops.php
+++ b/pnp-templates/check_mk-ibm_svc_nodestats.iops.php
@@ -38,16 +38,16 @@ if (isset($DS[2])) {
$parts = explode("_", $servicedesc);
$disk = $parts[2];
- $opt[1] = "--vertical-label 'IOs/sec' -X0 --title \"$hostname /
$servicedesc\" ";
+ $opt[1] = "--vertical-label 'IO/s' -X0 --title \"$hostname /
$servicedesc\" ";
$def[1] =
"HRULE:0#a0a0a0 ".
# read
"DEF:read=$RRD[read] ".
"AREA:read#40c080:\"Read \" ".
- "GPRINT:read:LAST:\"%8.0lf IOs/sec last\" ".
- "GPRINT:read:AVERAGE:\"%6.0lf IOs/sec avg\" ".
- "GPRINT:read:MAX:\"%6.0lf IOs/sec max\\n\" ";
+ "GPRINT:read:LAST:\"%8.0lf IO/s last\" ".
+ "GPRINT:read:AVERAGE:\"%6.0lf IO/s avg\" ".
+ "GPRINT:read:MAX:\"%6.0lf IO/s max\\n\" ";
# read average as line in the same graph
if (isset($RRD["read.avg"])) {
@@ -61,21 +61,21 @@ if (isset($DS[2])) {
"DEF:write=$RRD[write] ".
"CDEF:write_neg=write,-1,* ".
"AREA:write_neg#4080c0:\"Write \" ".
- "GPRINT:write:LAST:\"%6.0lf IOs/sec last\" ".
- "GPRINT:write:AVERAGE:\"%6.0lf IOs/sec avg\" ".
- "GPRINT:write:MAX:\"%6.0lf IOs/sec max\\n\" ".
+ "GPRINT:write:LAST:\"%6.0lf IO/s last\" ".
+ "GPRINT:write:AVERAGE:\"%6.0lf IO/s avg\" ".
+ "GPRINT:write:MAX:\"%6.0lf IO/s max\\n\" ".
"";
# show levels for read
if ($WARN['read']) {
- $def[1] .= "HRULE:$WARN[read]#ffd000:\"Warning for read at " .
sprintf("%6.1f", $WARN[1]) . " IOs/sec \" ";
- $def[1] .= "HRULE:$CRIT[read]#ff0000:\"Critical for read at " .
sprintf("%6.1f", $CRIT[1]) . " IOs/sec\\n\" ";
+ $def[1] .= "HRULE:$WARN[read]#ffd000:\"Warning for read at " .
sprintf("%6.1f", $WARN[1]) . " IO/s \" ";
+ $def[1] .= "HRULE:$CRIT[read]#ff0000:\"Critical for read at " .
sprintf("%6.1f", $CRIT[1]) . " IO/s\\n\" ";
}
# show levels for write
if ($WARN['write']) {
- $def[1] .= "HRULE:-$WARN[write]#ffd000:\"Warning for write at " .
sprintf("%6.1f", $WARN[2]) . " IOs/sec \" ";
- $def[1] .= "HRULE:-$CRIT[write]#ff0000:\"Critical for write at " .
sprintf("%6.1f", $CRIT[2]) . " IOs/sec\\n\" ";
+ $def[1] .= "HRULE:-$WARN[write]#ffd000:\"Warning for write at " .
sprintf("%6.1f", $WARN[2]) . " IO/s \" ";
+ $def[1] .= "HRULE:-$CRIT[write]#ff0000:\"Critical for write at " .
sprintf("%6.1f", $CRIT[2]) . " IO/s\\n\" ";
}
}
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 4b42e35..9e77b8c 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -543,7 +543,7 @@ perfometers["check_mk-ibm_svc_systemstats.diskio"] =
perfometer_check_mk_disksta
def perfometer_check_mk_iops_r_w(row, check_command, perf_data):
iops_r = int(perf_data[0][1])
iops_w = int(perf_data[1][1])
- text = "%d IO/s / %s IO/s" % (iops_r, iops_w)
+ text = "%d IO/s %s IO/s" % (iops_r, iops_w)
return text, perfometer_logarithmic_dual(
iops_r, "#60e0a0", iops_w, "#60a0e0", 100000, 10)
@@ -553,7 +553,7 @@ perfometers["check_mk-ibm_svc_systemstats.iops"] =
perfometer_check_mk_iops_r_w
def perfometer_check_mk_disk_latency_r_w(row, check_command, perf_data):
latency_r = int(perf_data[0][1])
latency_w = int(perf_data[1][1])
- text = "%d ms / %s ms" % (latency_r, latency_w)
+ text = "%d ms %s ms" % (latency_r, latency_w)
return text, perfometer_logarithmic_dual(
latency_r, "#60e0a0", latency_w, "#60a0e0", 20, 10)