Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / check_mk-statgrab_mem.php
blobe96402f9d866cb6351775770cb53e3c56418113f
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(MB)' --upper-limit " . ($MAX[1] * 120 / 100) . " -l0 --title \"Memory usage $hostname\" ";
28 $maxgb = sprintf("%.1f", $MAX[1] / 1024.0);
30 $def[1] = "DEF:ram=$RRDFILE[1]:$DS[1]:AVERAGE " ;
31 $def[1] .= "DEF:swap=$RRDFILE[2]:$DS[2]:AVERAGE " ;
32 $def[1] .= "DEF:virt=$RRDFILE[3]:$DS[3]:AVERAGE " ;
33 $def[1] .= "HRULE:$MAX[3]#000080:\"RAM+SWAP installed\" ";
34 $def[1] .= "HRULE:$MAX[1]#2040d0:\"$maxgb GB RAM installed\" ";
35 $def[1] .= "HRULE:$WARN[3]#FFFF00:\"Warning\" ";
36 $def[1] .= "HRULE:$CRIT[3]#FF0000:\"Critical\\n\" ";
38 $def[1] .= "'COMMENT:\\n' " ;
39 $def[1] .= "AREA:ram#80ff40:\"RAM used \" " ;
40 $def[1] .= "GPRINT:ram:LAST:\"%6.0lf MB last\" " ;
41 $def[1] .= "GPRINT:ram:AVERAGE:\"%6.0lf MB avg\" " ;
42 $def[1] .= "GPRINT:ram:MAX:\"%6.0lf MB max\\n\" ";
44 $def[1] .= "AREA:swap#008030:\"SWAP used \":STACK " ;
45 $def[1] .= "GPRINT:swap:LAST:\"%6.0lf MB last\" " ;
46 $def[1] .= "GPRINT:swap:AVERAGE:\"%6.0lf MB avg\" " ;
47 $def[1] .= "GPRINT:swap:MAX:\"%6.0lf MB max\\n\" " ;
49 $def[1] .= "LINE:virt#000000:\"RAM+SWAP used\" " ;
50 $def[1] .= "GPRINT:virt:LAST:\"%6.0lf MB last\" " ;
51 $def[1] .= "GPRINT:virt:AVERAGE:\"%6.0lf MB avg\" " ;
52 $def[1] .= "GPRINT:virt:MAX:\"%6.0lf MB max\\n\" " ;