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