Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / check_mk-vms_df.php
blobd2b80ef596ac2187c8def95e93875fac399fd957
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.
27 $fsname = str_replace("_", "/", substr($servicedesc, 3));
28 $sizegb = sprintf("%.1f", $MAX[1] / 1024.0);
29 $maxgb = $MAX[1] / 1024.0;
30 $warngb = $WARN[1] / 1024.0;
31 $critgb = $CRIT[1] / 1024.0;
32 $warngbtxt = sprintf("%.1f", $warngb);
33 $critgbtxt = sprintf("%.1f", $critgb);
35 # disk utilization
36 $opt[1] = "--vertical-label GB -l 0 -u $maxgb --title \"$hostname: Filesystem $fsname ($sizegb GB)\" ";
38 $def[1] = "DEF:mb=$RRDFILE[1]:$DS[1]:MAX ";
39 $def[1] .= "CDEF:var1=mb,1024,/ ";
40 $def[1] .= "AREA:var1#00ffc6:\"used space on $fsname\\n\" ";
41 $def[1] .= "LINE1:var1#226600: ";
42 $def[1] .= "HRULE:$maxgb#003300:\"Size ($sizegb GB) \" ";
43 $def[1] .= "HRULE:$warngb#ffff00:\"Warning at $warngbtxt GB \" ";
44 $def[1] .= "HRULE:$critgb#ff0000:\"Critical at $critgbtxt GB \\n\" ";
45 $def[1] .= "GPRINT:var1:LAST:\"current\: %6.2lf GB\" ";
46 $def[1] .= "GPRINT:var1:MAX:\"max\: %6.2lf GB \" ";
47 $def[1] .= "GPRINT:var1:AVERAGE:\"avg\: %6.2lf GB\" ";
49 # IO operation per second
50 $opt[2] = "--vertical-label 'IO ops/sec' --title \"$hostname: IO operations / sec\" ";
52 $def[2] = "DEF:iops=$RRDFILE[2]:$DS[2]:MAX " ;
53 $def[2] .= "LINE1:iops#00ff00: ";