Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / check_mk-esx_vsphere_hostsystem.mem_usage.php
blob2352545c8c1ad98750e496985baa250c035d04e4
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 $opt[1] = "--vertical-label 'Memory (Bytes)' --upper-limit " . $MAX[1] . " -l0 --title \"Memory usage of $hostname\" ";
28 $total_gb = $MAX[1] / 1073741824.0;
29 $total_text = sprintf("%.2fGB", $total_gb);
31 $def[1] = "DEF:used=$RRDFILE[1]:$DS[1]:MAX "
32 . "CDEF:usedgb=used,1073741824,/ "
33 . "HRULE:$MAX[1]#000080:\"Total memory\: $total_text\" ";
34 if ($WARN[1]) {
35 $def[1] .= "HRULE:$WARN[1]#FFFF00:\"Warning (used)\" "
36 . "HRULE:$CRIT[1]#FF0000:\"Critical (used)\" ";
39 $def[1] .= "'COMMENT:\\n' "
40 . "AREA:used#20cf80:\"Used main memory \" "
41 . "GPRINT:usedgb:LAST:\"%6.2lf GB last\" "
42 . "GPRINT:usedgb:AVERAGE:\"%6.2lf GB avg\" "
43 . "GPRINT:usedgb:MAX:\"%6.2lf GB max\\n\" "
47 $def[1] .= "LINE:used#00af60:\"\" " ;