Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / template-cpu_utilization.php
blob3b6ee08478c4f70067064ade28f4fe1e92d9572f
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 'CPU utilization %' -l0 -u 100 --title \"CPU Utilization for $hostname\" ";
28 $def[1] = "DEF:user=$RRDFILE[1]:$DS[1]:AVERAGE " ;
29 $def[1] .= "DEF:system=$RRDFILE[2]:$DS[2]:AVERAGE " ;
30 $def[1] .= "DEF:wait=$RRDFILE[3]:$DS[3]:AVERAGE " ;
31 $def[1] .= "CDEF:us=user,system,+ ";
32 $def[1] .= "CDEF:sum=us,wait,+ ";
33 $def[1] .= "CDEF:idle=100,sum,- ";
35 if ($TEMPLATE[1] == "check_mk-decru_cpu")
36 $thirdname = "IRQs";
37 else
38 $thirdname = "Wait";
41 $def[1] .= ""
42 . "COMMENT:Average\: "
43 . "AREA:system#ff6000:\"System\" "
44 . "GPRINT:system:AVERAGE:\"%4.1lf%% \" "
45 . "AREA:user#60f020:\"User\":STACK "
46 . "GPRINT:user:AVERAGE:\"%4.1lf%% \" "
47 . "AREA:wait#00b0c0:\"$thirdname\":STACK "
48 . "GPRINT:wait:AVERAGE:\"%4.1lf%% \" "
49 . "LINE:sum#004080:\"Total\" "
50 . "GPRINT:sum:AVERAGE:\"%4.1lf%% \\n\" "
52 . "COMMENT:\"Last\: \" "
53 . "AREA:system#ff6000:\"System\" "
54 . "GPRINT:system:LAST:\"%4.1lf%% \" "
55 . "AREA:user#60f020:\"User\":STACK "
56 . "GPRINT:user:LAST:\"%4.1lf%% \" "
57 . "AREA:wait#00b0c0:\"$thirdname\":STACK "
58 . "GPRINT:wait:LAST:\"%4.1lf%% \" "
59 . "LINE:sum#004080:\"Total\" "
60 . "GPRINT:sum:LAST:\"%4.1lf%% \\n\" "
62 ."";