Refactoring: Changed all check parameters starting with a 'g' or 'h' to new rulespec...
[check_mk.git] / pnp-templates / check_mk-juniper_screenos_mem.php
blob148548283c54d6a0c1ece3ebc01c279e24a46b99
1 <?php
2 # +------------------------------------------------------------------+
3 # | ____ _ _ __ __ _ __ |
4 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
5 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
6 # | | |___| | | | __/ (__| < | | | | . \ |
7 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
8 # | |
9 # | Copyright Mathias Kettner 2013 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 ($MAX[1]/1024/1024 > 10000) {
27 $scale = 1024 * 1024 * 1024;
28 $unit = 'GB';
30 else {
31 $scale = 1024 * 1024;
32 $unit = 'MB';
35 $total = sprintf("%.2f", $MAX[1] / $scale);
36 $warn = sprintf("%.2f", $WARN[1] / $scale);
37 $crit = sprintf("%.2f", $CRIT[1] / $scale);
39 $opt[1] = "--vertical-label $unit -l 0 --title \"Main Memory (RAM)\" -X0 --upper-limit " . $total;
42 $def[1] = "DEF:used_bytes=$RRDFILE[1]:$DS[1]:AVERAGE " ;
43 $def[1] .= "CDEF:used=used_bytes,$scale,/ ";
44 $def[1] .= "AREA:used#60f020:\"Used\" " ;
45 $def[1] .= "GPRINT:used:MIN:\"Min\: %2.1lf $unit\" " ;
46 $def[1] .= "GPRINT:used:MAX:\"Max\: %2.1lf $unit\" " ;
47 $def[1] .= "GPRINT:used:LAST:\"Last\: %2.1lf $unit\\n\" " ;
48 $def[1] .= "HRULE:$warn#FFFF00:\"Warn\" ";
49 $def[1] .= "HRULE:$crit#FF0000:\"Crit\" ";
50 $def[1] .= "HRULE:$total#000000:\"RAM installed $total $unit\\n\" ";