Module: check_mk
Branch: master
Commit: 7b2d46d2a716fdcebf10a5c4963f9e4112d512ad
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b2d46d2a716fd…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Oct 10 15:33:41 2013 +0200
pnp template brocade_fcport: fixed incorrect display of avg values
---
ChangeLog | 1 +
pnp-templates/check_mk-brocade_fcport.php | 31 +++++++++++++++++------------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index acfed14..2384586 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,7 @@
* Filtering in views by Hostalias is possible now too
(however the filter is not displayed in any standard view - user needs
to enable it by customizing the needed views himself)
+ * FIX: brocade_fcport pnp-template: fixed incorrect display of average values
Livestatus-Proxy:
* FIX: fix exception when printing error message
diff --git a/pnp-templates/check_mk-brocade_fcport.php
b/pnp-templates/check_mk-brocade_fcport.php
index bb86618..4de80a4 100644
--- a/pnp-templates/check_mk-brocade_fcport.php
+++ b/pnp-templates/check_mk-brocade_fcport.php
@@ -29,11 +29,12 @@
# than with numbers.
$RRD = array();
foreach ($NAME as $i => $n) {
- $RRD[$n] = "$RRDFILE[$i]:$DS[$i]:MAX";
- $WARN[$n] = $WARN[$i];
- $CRIT[$n] = $CRIT[$i];
- $MIN[$n] = $MIN[$i];
- $MAX[$n] = $MAX[$i];
+ $RRD[$n] = "$RRDFILE[$i]:$DS[$i]:MAX";
+ $RRDAVG[$n] = "$RRDFILE[$i]:$DS[$i]:AVERAGE";
+ $WARN[$n] = $WARN[$i];
+ $CRIT[$n] = $CRIT[$i];
+ $MIN[$n] = $MIN[$i];
+ $MAX[$n] = $MAX[$i];
}
@@ -45,18 +46,22 @@ $opt[1] = "--vertical-label \"MByte/sec\" -X0 -b 1024
--title \"Traffic for $ho
$def[1] = ""
. "HRULE:0#c0c0c0 "
. "DEF:in=$RRD[in] "
+ . "DEF:inavg=$RRDAVG[in] "
+ . "DEF:outavg=$RRDAVG[out] "
. "DEF:out=$RRD[out] "
. "CDEF:inmb=in,1048576,/ "
+ . "CDEF:inmbavg=inavg,1048576,/ "
+ . "CDEF:outmbavg=outavg,1048576,/ "
. "CDEF:outmb=out,1048576,/ "
. "AREA:inmb#60a020:\"in \" "
- . "GPRINT:inmb:LAST:\"%5.1lf MB/s last\" "
- . "GPRINT:inmb:AVERAGE:\"%5.1lf MB/s avg\" "
- . "GPRINT:inmb:MAX:\"%5.1lf MB/s max\\n\" "
+ . "GPRINT:inmb:LAST:\"%5.3lf MB/s last\" "
+ . "GPRINT:inmbavg:AVERAGE:\"%5.3lf MB/s avg\" "
+ . "GPRINT:inmb:MAX:\"%5.3lf MB/s max\\n\" "
. "CDEF:out_draw=outmb,-1,* "
. "AREA:out_draw#2060a0:\"out \" "
- . "GPRINT:outmb:LAST:\"%5.1lf MB/s last\" "
- . "GPRINT:outmb:AVERAGE:\"%5.1lf MB/s avg\" "
- . "GPRINT:outmb:MAX:\"%5.1lf MB/s max\\n\" "
+ . "GPRINT:outmb:LAST:\"%5.3lf MB/s last\" "
+ . "GPRINT:outmbavg:AVERAGE:\"%5.3lf MB/s avg\" "
+ . "GPRINT:outmb:MAX:\"%5.3lf MB/s max\\n\" "
;
if (isset($RRD['in_avg'])) {
@@ -98,8 +103,8 @@ $ds_name[2] = 'Frames';
$opt[2] = "--vertical-label \"Frames/sec\" -b 1024 --title \"Frames
per second\" ";
$def[2] = ""
. "HRULE:0#c0c0c0 "
- . "DEF:in=$RRD[rxframes] "
- . "DEF:out=$RRD[txframes] "
+ . "DEF:in=$RRDAVG[rxframes] "
+ . "DEF:out=$RRDAVG[txframes] "
. "AREA:in#a0d040:\"in \" "
. "GPRINT:in:LAST:\"%5.1lf/s last\" "
. "GPRINT:in:AVERAGE:\"%5.1lf/s avg\" "