Refactoring: Changed all check parameters starting with a 'g' or 'h' to new rulespec...
[check_mk.git] / pnp-templates / check_mk-ibm_svc_nodestats.iops.php
blobb2820ff6ecb39e3b46d924840a346ec3221b069a
1 <?php
2 # +------------------------------------------------------------------+
3 # | ____ _ _ __ __ _ __ |
4 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
5 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
6 # | | |___| | | | __/ (__| < | | | | . \ |
7 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
8 # | |
9 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
10 # +------------------------------------------------------------------+
12 # This file is part of Check_MK.
13 # The official homepage is at http://mathias-kettner.de/check_mk.
15 # check_mk is free software; you can redistribute it and/or modify it
16 # under the terms of the GNU General Public License as published by
17 # the Free Software Foundation in version 2. check_mk is distributed
18 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
19 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
20 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
21 # tails. You should have received a copy of the GNU General Public
22 # License along with GNU Make; see the file COPYING. If not, write
23 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
24 # Boston, MA 02110-1301 USA.
26 if (isset($DS[2])) {
28 // Make data sources available via names
29 $RRD = array();
30 foreach ($NAME as $i => $n) {
31 $RRD[$n] = "$RRDFILE[$i]:$DS[$i]:MAX";
32 $WARN[$n] = $WARN[$i];
33 $CRIT[$n] = $CRIT[$i];
34 $MIN[$n] = $MIN[$i];
35 $MAX[$n] = $MAX[$i];
38 $parts = explode("_", $servicedesc);
39 $disk = $parts[2];
41 $opt[1] = "--vertical-label 'IO/s' -X0 --title \"$hostname / $servicedesc\" ";
43 $def[1] =
44 "HRULE:0#a0a0a0 ".
45 # read
46 "DEF:read=$RRD[read] ".
47 "AREA:read#40c080:\"Read \" ".
48 "GPRINT:read:LAST:\"%8.0lf IO/s last\" ".
49 "GPRINT:read:AVERAGE:\"%6.0lf IO/s avg\" ".
50 "GPRINT:read:MAX:\"%6.0lf IO/s max\\n\" ";
52 # read average as line in the same graph
53 if (isset($RRD["read.avg"])) {
54 $def[1] .=
55 "DEF:read_avg=${RRD['read.avg']} ".
56 "LINE:read_avg#202020 ";
59 # write
60 $def[1] .=
61 "DEF:write=$RRD[write] ".
62 "CDEF:write_neg=write,-1,* ".
63 "AREA:write_neg#4080c0:\"Write \" ".
64 "GPRINT:write:LAST:\"%6.0lf IO/s last\" ".
65 "GPRINT:write:AVERAGE:\"%6.0lf IO/s avg\" ".
66 "GPRINT:write:MAX:\"%6.0lf IO/s max\\n\" ".
67 "";
69 # show levels for read
70 if ($WARN['read']) {
71 $def[1] .= "HRULE:$WARN[read]#ffd000:\"Warning for read at " . sprintf("%6.1f", $WARN[1]) . " IO/s \" ";
72 $def[1] .= "HRULE:$CRIT[read]#ff0000:\"Critical for read at " . sprintf("%6.1f", $CRIT[1]) . " IO/s\\n\" ";
75 # show levels for write
76 if ($WARN['write']) {
77 $def[1] .= "HRULE:-$WARN[write]#ffd000:\"Warning for write at " . sprintf("%6.1f", $WARN[2]) . " IO/s \" ";
78 $def[1] .= "HRULE:-$CRIT[write]#ff0000:\"Critical for write at " . sprintf("%6.1f", $CRIT[2]) . " IO/s\\n\" ";