Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / check_mk-netapp_fcpio.php
blob3a900385c581e12cd6a5535c8c4adcedcf84362f
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 // new version of diskstat
27 if (isset($DS[2])) {
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);
40 $opt[1] = "--vertical-label 'Throughput (MB/s)' -X0 --title \"FC Port throughput on $hostname\" ";
42 $def[1] =
43 "HRULE:0#a0a0a0 ".
44 # read
45 "DEF:read=$RRD[read] ".
46 "CDEF:read_mb=read,1048576,/ ".
47 "AREA:read_mb#40c080:\"Read \" ".
48 "GPRINT:read_mb:LAST:\"%8.1lf MB/s last\" ".
49 "GPRINT:read_mb:AVERAGE:\"%6.1lf MB/s avg\" ".
50 "GPRINT:read_mb:MAX:\"%6.1lf MB/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 "CDEF:read_avg_mb=read_avg,1048576,/ ".
57 "LINE:read_avg_mb#202020 ";
60 # write
61 $def[1] .=
62 "DEF:write=$RRD[write] ".
63 "CDEF:write_mb=write,1048576,/ ".
64 "CDEF:write_mb_neg=write_mb,-1,* ".
65 "AREA:write_mb_neg#4080c0:\"Write \" ".
66 "GPRINT:write_mb:LAST:\"%6.1lf MB/s last\" ".
67 "GPRINT:write_mb:AVERAGE:\"%6.1lf MB/s avg\" ".
68 "GPRINT:write_mb:MAX:\"%6.1lf MB/s max\\n\" ".
69 "";
71 # show levels for read
72 if ($WARN['read']) {
73 $def[1] .= "HRULE:$WARN[read]#ffd000:\"Warning for read at " . sprintf("%6.1f", $WARN[1]) . " MB/s \" ";
74 $def[1] .= "HRULE:$CRIT[read]#ff0000:\"Critical for read at " . sprintf("%6.1f", $CRIT[1]) . " MB/s\\n\" ";
77 # show levels for write
78 if ($WARN['write']) {
79 $def[1] .= "HRULE:-$WARN[write]#ffd000:\"Warning for write at " . sprintf("%6.1f", $WARN[2]) . " MB/s \" ";
80 $def[1] .= "HRULE:-$CRIT[write]#ff0000:\"Critical for write at " . sprintf("%6.1f", $CRIT[2]) . " MB/s\\n\" ";