Debian Codegraph @

check_ipmi_sensor/contrib/default-combinedgraph.template

raw
1 <?php
2 /*
3 License: GPL
4 Author: Andy Spiegl <[email protected]>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 Probably requires:
19 pnp4nagios 0.4.14+
20 */
21
22 # Template to combine all data sets of an RRD into one single graph
23 # useful for e.g. hardware sensors with many values
24
25 $opt[1] = "-T 55 -l 0 --vertical-label \"Combined Graph\" --title \"Combined Graph " . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . "\" ";
26 $def[1] = "";
27
28 foreach ($this->DS as $KEY=>$VAL) {
29
30 $def[1] .= rrd::def ("var$KEY", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
31 $def[1] .= rrd::line2 ("var$KEY", rrd::color($KEY, 80) , rrd::cut($VAL['NAME'],16) );
32 $def[1] .= rrd::gprint ("var$KEY", array("LAST","MIN","MAX","AVERAGE"), "%3.4lf %S".$VAL['UNIT']);
33 }
34 $def[1] .= rrd::comment("Default Combined Graph Template\\r");
35 $def[1] .= rrd::comment("Command " . $VAL['TEMPLATE'] . "\\r");
36
37 ?>