Module: check_mk
Branch: master
Commit: d24ffd2ae524a54539b3b9295f802248f3049505
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d24ffd2ae524a5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 17:35:54 2014 +0100
#1654 FIX statgrab_disk: Fixed scaling of values shown in PNP graphs
Graphs for disk read/write IO for Solaris servers using statgrab
were reporting Mbytes instead of Kbytes in pnp graphs.
---
.werks/1654 | 11 +++++++++++
ChangeLog | 1 +
checks/statgrab_disk | 10 ++++------
pnp-templates/check_mk-statgrab_disk.php | 4 ++--
4 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/.werks/1654 b/.werks/1654
new file mode 100644
index 0000000..674ba59
--- /dev/null
+++ b/.werks/1654
@@ -0,0 +1,11 @@
+Title: statgrab_disk: Fixed scaling of values shown in PNP graphs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417710900
+Class: fix
+
+Graphs for disk read/write IO for Solaris servers using statgrab
+were reporting Mbytes instead of Kbytes in pnp graphs.
+
diff --git a/ChangeLog b/ChangeLog
index 3093406..7dd3850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,7 @@
* 1635 FIX: multipath: fix parsing output of multipath on RedHat6 with space in
alias
* 1652 FIX: kaspersky_av_quarantine: Fixed exception when a file was found in
quarantine
* 1653 FIX: megaraid_pdisks: Resulting states are now hard coded within the check...
+ * 1654 FIX: statgrab_disk: Fixed scaling of values shown in PNP graphs...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/statgrab_disk b/checks/statgrab_disk
index 18152db..a7f0795 100644
--- a/checks/statgrab_disk
+++ b/checks/statgrab_disk
@@ -30,7 +30,7 @@ def inventory_statgrab_disk(info):
return [ ('read', None), ('write', None) ]
return []
-def check_statgrab_disk(item, params, info):
+def check_statgrab_disk(item, _no_params, info):
# item is 'read' or 'write'
if item != 'read' and item != "write":
return (3, "invalid item %s" % (item,))
@@ -41,11 +41,9 @@ def check_statgrab_disk(item, params, info):
this_val += int(value)
this_time = int(time.time())
- timedif, per_sec = get_counter("diskstat." + item, this_time, this_val)
- perfdata = [ (item, per_sec) ]
- return (0, "%s/s (in last %d secs)" % (get_bytes_human_readable(per_sec),
timedif), perfdata)
-
-
+ timedif, bytes_per_sec = get_counter("diskstat." + item, this_time,
this_val)
+ perfdata = [ (item, bytes_per_sec) ]
+ return (0, "%s/s (in last %d secs)" %
(get_bytes_human_readable(bytes_per_sec), timedif), perfdata)
check_info["statgrab_disk"] = {
'check_function': check_statgrab_disk,
diff --git a/pnp-templates/check_mk-statgrab_disk.php
b/pnp-templates/check_mk-statgrab_disk.php
index f54b09f..d9b6b02 100644
--- a/pnp-templates/check_mk-statgrab_disk.php
+++ b/pnp-templates/check_mk-statgrab_disk.php
@@ -25,8 +25,8 @@
$opt[1] = "--vertical-label 'Througput (MByte/s)' -l0 -u 1 --title
\"Disk throughput $hostname / $servicedesc\" ";
-$def[1] = "DEF:kb=$RRDFILE[1]:$DS[1]:AVERAGE " ;
-$def[1] .= "CDEF:mb=kb,1024,/ " ;
+$def[1] = "DEF:bytes=$RRDFILE[1]:$DS[1]:AVERAGE " ;
+$def[1] .= "CDEF:mb=bytes,1048576,/ " ;
$def[1] .= "AREA:mb#40c080 " ;
$def[1] .= "GPRINT:mb:LAST:\"%6.1lf MByte/s last\" " ;
$def[1] .= "GPRINT:mb:AVERAGE:\"%6.1lf MByte/s avg\" " ;