Refactoring: Moved check parameters from unsorted.py to dedicated modules (CMK-1393)
[check_mk.git] / pnp-templates / check_mk-netctr.combined.php
blob0c903848cc5ea44dcaeb6b966385c6a43b13e67d
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 # Datensatze:
28 # 1: rx_bytes
29 # 2: tx_bytes
30 # 3: rx_packets
31 # 4: tx_packets
32 # 5: rx_errors
33 # 6: tx_errors
34 # 7: tx_collisions
38 $x = explode("_", $servicedesc);
39 $nic = $x[1];
40 $opt[1] = "--vertical-label 'Bytes/s' -l -1024 -u 1024 --title \"$hostname / NIC $nic\" ";
41 # -l0 -u1048576
44 $def[1] = "DEF:rx_bytes=$RRDFILE[1]:$DS[1]:AVERAGE " ;
45 # $def[1] = "DEF:rx_bytes=/var/lib/nagios/pnp/localhost/NIC_eth0.rrd:rxbytes:AVERAGE " ;
46 $def[1] .= "DEF:tx_bytes=$RRDFILE[2]:$DS[2]:AVERAGE " ;
47 $def[1] .= "CDEF:rx_mb=rx_bytes,1048576.0,/ " ;
48 $def[1] .= "CDEF:tx_mb=tx_bytes,1048576.0,/ " ;
49 $def[1] .= "CDEF:tx_bytes_neg=0,tx_bytes,- ";
50 #$def[1] .= "CDEF:rx_mb=rx_bytes,1.0,/ " ;
51 #$def[1] .= "CDEF:tx_mb=tx_bytes,1.0,/ " ;
52 $def[1] .= "DEF:rx_errors=$RRDFILE[5]:$DS[5]:MAX " ;
53 $def[1] .= "DEF:tx_errors=$RRDFILE[6]:$DS[6]:MAX " ;
54 $def[1] .= "DEF:tx_collisions=$RRDFILE[7]:$DS[7]:MAX " ;
55 $def[1] .= "CDEF:errors=rx_errors,tx_errors,+ ";
56 $def[1] .= "CDEF:problems_x=errors,tx_collisions,+ ";
57 $def[1] .= "CDEF:problems=problems_x,1000000,* "; # Skaliere Probleme hoch, damit man was sieht
59 $def[1] .= "AREA:problems#ff0000:\"Errors \" " ;
60 $def[1] .= "GPRINT:problems:LAST:\"%.0lf/s\" " ;
61 $def[1] .= "AREA:rx_bytes#20a020:\"Receive \" " ;
62 $def[1] .= "GPRINT:rx_mb:LAST:\"%.2lfMB/s\" " ;
63 $def[1] .= "AREA:tx_bytes_neg#0060a0:\"Transmit \" " ;
64 $def[1] .= "HRULE:0#c0c0c0 ";
65 $def[1] .= "GPRINT:tx_mb:LAST:\"%.2lfMB/s\" " ;