本文整理汇总了PHP中rrd::gradient方法的典型用法代码示例。如果您正苦于以下问题:PHP rrd::gradient方法的具体用法?PHP rrd::gradient怎么用?PHP rrd::gradient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rrd
的用法示例。
在下文中一共展示了rrd::gradient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Copyright
<?php
#
# Copyright (c) 2006-2012 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_jmx4perl
# Dataset: connector_nr_requests
# Perfdata: nr_requests=152.8;900;1000
#
$opt[1] = "-X0 --vertical-label \"Requets\" --title \"Requests {$hostname} / {$servicedesc}\" ";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::gradient('var1', '#F5F5F5', '#C0C0C0');
$def[1] .= rrd::line1("var1", "#B80000", $LABEL[1]);
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%.0lf");
if ($WARN[1] != "") {
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning\\n");
}
if ($CRIT[1] != "") {
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical");
}
$def[1] .= rrd::comment("jolokia.org");
示例2: array
#
#
#
$def[1] = "DEF:var1={$RRDFILE['1']}:{$DS['1']}:AVERAGE ";
if ($WARN[1] != "") {
$def[1] .= "HRULE:{$WARN['1']}#FFFF00 ";
}
if ($CRIT[1] != "") {
$def[1] .= "HRULE:{$CRIT['1']}#FF0000 ";
}
#$def[1] .= "AREA:var1#EACC00:\"$NAME[1] \" " ;
$def[1] .= rrd::gradient("var1", "66CCFF", "0000ff", "{$NAME['1']}");
$def[1] .= "LINE1:var1#666666 ";
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%6.2lf {$UNIT['1']}");
#
# Filesize
#
$opt[2] = "--vertical-label \"{$UNIT['2']}\" --title \"Size {$hostname} / {$servicedesc}\" ";
#
#
#
$def[2] = "DEF:var1={$RRDFILE['2']}:{$DS['2']}:AVERAGE ";
if ($WARN[2] != "") {
$def[2] .= "HRULE:{$WARN['2']}#FFFF00 ";
}
if ($CRIT[2] != "") {
$def[2] .= "HRULE:{$CRIT['2']}#FF0000 ";
}
$def[2] .= rrd::gradient("var1", "66CCFF", "0000ff", "{$NAME['2']}");
$def[2] .= "LINE1:var1#333333 ";
$def[2] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%6.2lf {$UNIT['1']}");
示例3: array
$def[1] .= rrd::def("var6", $ds['free']['RRDFILE'], $ds['free']['DS']);
$def[1] .= rrd::def("var7", $ds['swap_total']['RRDFILE'], $ds['swap_total']['DS']);
$def[1] .= rrd::def("var8", $ds['swap_free']['RRDFILE'], $ds['swap_free']['DS']);
$def[1] .= rrd::cdef("v_real_used", "var1,{$divis},/");
$def[1] .= rrd::cdef("v_total", "var2,{$divis},/");
$def[1] .= rrd::cdef("v_shared", "var3,{$divis},/");
$def[1] .= rrd::cdef("v_buffered", "var4,{$divis},/");
$def[1] .= rrd::cdef("v_cached", "var5,{$divis},/");
$def[1] .= rrd::cdef("v_used", "var2,var6,-,{$divis},/");
// total - used / $divis
$def[1] .= rrd::cdef("v_free", "var6,{$divis},/");
$def[1] .= rrd::cdef("v_swtotal", "var7,{$divis},/");
$def[1] .= rrd::cdef("v_swfree", "var8,{$divis},/");
$def[1] .= rrd::cdef("v_swused", "var7,var8,-,{$divis},/");
// Stacking all other values (used, cached, buffered, cached
$def[1] .= rrd::gradient("v_real_used", "#FF9900", "#FF5555", "Real used");
$def[1] .= rrd::line1("v_real_used", "#00000000");
// Invisible to be able to stack with gradient
#$def[1] .= rrd::area("v_real_used", "#FF9900", "Real used");
$def[1] .= rrd::gprint("v_real_used", array("AVERAGE", "MIN", "MAX", "LAST"), "{$fmt}{$unit_scale}");
$def[1] .= rrd::area("v_cached", "#FFAAFF", "Cached", true);
$def[1] .= rrd::gprint("v_cached", "LAST", "{$fmt}{$unit_scale}\\n");
$def[1] .= rrd::area("v_shared", "#0000FF", "Shared", true);
$def[1] .= rrd::gprint("v_shared", "LAST", "{$fmt}{$unit_scale}\\n");
$def[1] .= rrd::area("v_buffered", "#AAFFFF", "Buffered", true);
$def[1] .= rrd::gprint("v_buffered", "LAST", "{$fmt}{$unit_scale}\\n");
$def[1] .= rrd::area("v_free", "#FAFAAA", "Free", true);
$def[1] .= rrd::gprint("v_free", "LAST", "{$fmt}{$unit_scale}\\n");
// Stack swap on the same graph
$def[1] .= rrd::area("v_swused", "#3D3D3D", "Swap used", true);
$def[1] .= rrd::gprint("v_swused", array("AVERAGE", "MAX", "LAST"), "{$fmt}{$unit_scale}");
示例4: Copyright
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_iostat.php
#
#
$ds_name[1] = "check iostat";
$opt[1] = "--lower-limit 0 --vertical-label \"check iostat\" --title \"check iostat\" ";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::gradient("var1", "ff5c00", "ffdc00", "check iostat", 10);
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%.0lf {$UNIT['1']}");
$def[1] .= rrd::line1("var1", "#000000");
if ($WARN[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning " . $WARN[1] . $UNIT[1] . "\\n");
}
if ($CRIT[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical " . $CRIT[1] . $UNIT[1] . "\\n");
}
示例5: array
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//$fp = fopen('/tmp/test', 'a');
//ob_start();
$DS_in = $this->DS[0];
$DS_out = $this->DS[1];
$unit = 'B';
$fmt = "%6.2lf";
$max_in = pnp::adjust_unit($DS_in['ACT'] . $unit, 1024, $fmt);
$max_out = pnp::adjust_unit($DS_out['ACT'] . $unit, 1024, $fmt);
$max = $max_in;
$opt[1] = "--slope-mode --vertical-label \"bytes/s\" -u {$max['1']} -l0 --title \"Interface traffic / {$hostname}\"";
$divis = $max[3];
$def[1] = rrd::def("var1", $DS_in['RRDFILE'], $DS_in['DS'], "AVERAGE");
$def[1] .= rrd::def("var2", $DS_out['RRDFILE'], $DS_out['DS'], "AVERAGE");
$def[1] .= rrd::cdef("v_in", "var1,-1,*");
$def[1] .= rrd::cdef("v_out", "var2,1,*");
$def[1] .= rrd::cdef("v_in_f", "var1,1024,/");
// KiB
$def[1] .= rrd::cdef("v_out_f", "var2,1024,/");
// KiB
$def[1] .= rrd::gradient("v_out", "#33CCFF", "#0000FF", $DS_out['NAME']);
$def[1] .= rrd::gprint("v_out_f", array("LAST", "AVERAGE", "MAX"), "{$fmt} KiB/s");
$def[1] .= rrd::gradient("v_in", "#FFCC66", "#FF0000", $DS_in['NAME']);
$def[1] .= rrd::gprint("v_in_f", array("LAST", "AVERAGE", "MAX"), "{$fmt} KiB/s");
// Debug
//$content = ob_get_clean();
//fwrite($fp, "$content\n");
//fclose($fp);
示例6: Copyright
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_lvs.php
#
#
$ds_name[1] = "Check LVS";
$opt[1] = "--lower-limit 0 --vertical-label \"Check LVS\" --title \"Check LVS\" ";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::gradient("var1", "ff5c00", "ffdc00", "Check LVS", 10);
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%.0lf {$UNIT['1']}");
$def[1] .= rrd::line1("var1", "#000000");
if ($WARN[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning " . $WARN[1] . $UNIT[1] . "\\n");
}
if ($CRIT[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical " . $CRIT[1] . $UNIT[1] . "\\n");
}
示例7: array
$minimum = $VAL['MIN'];
}
if ($VAL['MAX'] != "" && is_numeric($VAL['MAX'])) {
$maximum = $VAL['MAX'];
}
if ($VAL['UNIT'] == "%%") {
$vlabel = "%";
$upper = " --upper=101 ";
$lower = " --lower=0 ";
} else {
$vlabel = $VAL['UNIT'];
}
$opt[$KEY] = '--vertical-label "' . $vlabel . '" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . '"' . $upper . $lower;
$ds_name[$KEY] = $VAL['LABEL'];
$def[$KEY] = rrd::def("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::gradient("var1", "3152A5", "BDC6DE", rrd::cut($VAL['NAME'], 16), 20);
$def[$KEY] .= rrd::line1("var1", $_LINE);
$def[$KEY] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.4lf %S" . $VAL['UNIT']);
if ($warning != "") {
$def[$KEY] .= rrd::hrule($warning, $_WARNRULE, "Warning {$warning} \\n");
}
if ($warn_min != "") {
$def[$KEY] .= rrd::hrule($warn_min, $_WARNRULE, "Warning (min) {$warn_min} \\n");
}
if ($warn_max != "") {
$def[$KEY] .= rrd::hrule($warn_max, $_WARNRULE, "Warning (max) {$warn_max} \\n");
}
if ($critical != "") {
$def[$KEY] .= rrd::hrule($critical, $_CRITRULE, "Critical {$critical} \\n");
}
if ($crit_min != "") {
示例8: array
<?php
#
# Plugin for check_uptime adapted from template for check_icmp
#
$ds_name[1] = "Uptime";
$opt[1] = "--vertical-label \"days\" --title \"Uptime for {$hostname}\" --slope-mode ";
$def[1] = rrd::def("minutes", $RRDFILE[2], $DS[2], "AVERAGE");
$def[1] .= rrd::cdef("days", "minutes,60,/,24,/");
#$def[1] .= rrd::gradient("days", "228b22", "adff2f", "Uptime", 20) ;
$def[1] .= rrd::gradient("days", "00ff2f", "00ffff", "Uptime", 20);
$def[1] .= rrd::gprint("days", array("LAST", "AVERAGE", "MAX"), "%6.2lf Days");
$def[1] .= rrd::line1("days", "#000000");
示例9: Copyright
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Default Template used if no other template is found.
# Don`t delete this file !
#
# Define some colors ..
#
$_AREA = '#256aef';
$_LINE = '#000000';
$_start_color = array("808005", "000080", "000000");
$_end_color = array("C0C0C0", "BDC6DE", "BDC6DE");
foreach ($this->DS as $KEY => $VAL) {
$vlabel = " ";
$lower = "";
$upper = "";
if ($VAL['UNIT'] == "%%") {
$vlabel = "%";
$upper = " --upper=101 ";
$lower = " --lower=0 ";
} else {
$vlabel = $VAL['UNIT'];
}
$opt[$KEY] = '--vertical-label "' . $vlabel . '" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . '"' . $upper . $lower;
$ds_name[$KEY] = $VAL['LABEL'];
$def[$KEY] = rrd::def("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::gradient("var1", $_start_color[$KEY], $_end_color[$KEY], rrd::cut($VAL['NAME'], 16), 20);
$def[$KEY] .= rrd::line1("var1", $_LINE);
$def[$KEY] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.2lf %S" . $VAL['UNIT']);
}
示例10: array
(at your option) any later version.
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/>.
*/
$DS_threads = $this->DS[0];
$DS_questions = $this->DS[1];
$DS_slowq = $this->DS[2];
$DS_opentables = $this->DS[3];
$DS_status = $this->DS[4];
$opt[1] = "-l0 --title \"{$hostname} / Mysql Activity\" ";
$def[1] = rrd::def("var1", $DS_threads['RRDFILE'], $DS_threads['DS']);
$def[1] .= rrd::def("var2", $DS_questions['RRDFILE'], $DS_questions['DS']);
$def[1] .= rrd::def("var3", $DS_slowq['RRDFILE'], $DS_slowq['DS']);
$def[1] .= rrd::def("var4", $DS_opentables['RRDFILE'], $DS_opentables['DS']);
$def[1] .= rrd::def("var5", $DS_status['RRDFILE'], $DS_status['DS']);
$def[1] .= rrd::line2("var1", "#00FFFF", "Threads");
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MIN", "MAX"), "%4.2lfT");
$def[1] .= rrd::gradient("var2", "#00FF0099", "#00880099", "Query");
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MIN", "MAX"), "%4.2lfq/s");
$def[1] .= rrd::line2("var3", "#FF0000", "Slow Query");
$def[1] .= rrd::gprint("var3", array("LAST", "AVERAGE", "MAX"), "%4.2lfq/s");
#$def[1] .= rrd::line1("var4", "#0000FF", "Open Tables");
#$def[1] .= rrd::gprint("var3", array("LAST", "AVERAGE", "MAX"), "%4.2lfc");
$def[1] .= rrd::ticker("var1", $DS_threads['WARN'], $DS_threads['CRIT'], -0.05, "ff", "#00ff00", "#ff8c00", "#ff0000");
$def[1] .= rrd::ticker("var5", 2, 1, -0.05, "ff", "#00ff00", "#ff8c00", "#ff0000");
示例11: array
$unit = $DS_mem['UNIT'];
$max = pnp::adjust_unit($DS_mem['MAX'] . $unit, 1024, $fmt);
$upper = "-u {$max['1']}";
# set graph labels
$opt[1] = "--vertical-label {$unit} -l 0 {$upper} --title \"JVM " . $DS_mem['NAME'] . "\" ";
# Graph Definitions
$def[1] = rrd::def("var1", $DS_mem['RRDFILE'], $DS_mem['DS']);
$def[1] .= rrd::def("var2", $DS_pool['RRDFILE'], $DS_pool['DS']);
# "normalize" graph values
$divis = $max[3];
$def[1] .= rrd::cdef("v_n", "var1,{$divis},/");
$def[1] .= rrd::cdef("v_pool", "var2,{$divis},/");
$def[1] .= rrd::gradient("v_n", "00FF33", "339900", $DS_mem['NAME']);
$def[1] .= rrd::line1("v_n", "#003300");
$def[1] .= rrd::gprint("v_n", array("LAST", "MAX", "AVERAGE"), "{$fmt} {$unit}");
$def[1] .= rrd::gradient("v_pool", "00FFDD", "3399DD", $DS_pool['NAME']);
$def[1] .= rrd::line1("v_pool", "#003300");
$def[1] .= rrd::gprint("v_pool", "LAST", "{$fmt} {$unit}\\n");
# create max line and legend
//$def[1] .= rrd::gprint("v_n", "MAX", "$fmt $unit max used \\n");
$def[1] .= rrd::hrule($max[1], "#003300", "Max size ({$max['0']}) \\n");
# create warning line and legend
$warn = pnp::adjust_unit($DS_mem['WARN'] . $unit, 1024, $fmt);
$def[1] .= rrd::hrule($warn[1], "#ffff00", "Warning ({$warn['0']}) \\n");
# create critical line and legend
$crit = pnp::adjust_unit($DS_mem['CRIT'] . $unit, 1024, $fmt);
$def[1] .= rrd::hrule($crit[1], "#ff0000", "Critical ({$crit['0']})\\n");
# Create pool line and legend
## Legend header
#$def[1] .= rrd::gprint("v_n", "MAX", "Max used \: $fmt $unit\\t");
#$def[1] .= rrd::gprint("v_n", "AVERAGE", "Average used \: $fmt $unit\\n");
示例12: Copyright
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_cpu_utilization.php
#
#
$ds_name[1] = "CPU utilization";
$opt[1] = "--lower-limit 0 --vertical-label \"CPU utilization\" --title \"CPU utilization\" ";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::gradient("var1", "ff5c00", "ffdc00", "CPU utilization", 10);
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.0lf {$UNIT['1']}");
$def[1] .= rrd::line1("var1", "#000000");
if ($WARN[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning " . $WARN[1] . $UNIT[1] . "\\n");
}
if ($CRIT[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical " . $CRIT[1] . $UNIT[1] . "\\n");
}
示例13: foreach
#
# $Id$
#
foreach ($this->DS as $KEY => $VAL) {
list($type, $name) = explode('_', $VAL['NAME']);
$unit = $VAL['UNIT'];
if ($type == 'temp') {
$unit = "°{$unit}";
$ds_name[$KEY] = "Temperatur {$name}";
$opt[$KEY] = "--vertical-label \"Temperatur in {$unit}\" --title \"Temperatur {$hostname} / {$name}\" ";
$def[$KEY] = rrd::def("temp", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::gradient("temp", "A55231", "DEC6BD", rrd::cut($name, 16), 20);
$def[$KEY] .= rrd::gprint("temp", array("LAST", "MAX", "AVERAGE"), "%5.1lf {$unit}");
$def[$KEY] .= rrd::line1("temp", "#000000");
} else {
if ($type == 'hum') {
$unit = "%";
$ds_name[$KEY] = "Humidity {$name}";
$opt[$KEY] = "--vertical-label \"Humidity in %\" --title \"Humidity {$hostname} / {$name}\" ";
$def[$KEY] = rrd::def("hum", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::gradient("hum", "3152A5", "BDC6DE", rrd::cut($name, 16), 20);
$def[$KEY] .= rrd::gprint("hum", array("LAST", "MAX", "AVERAGE"), "%5.1lf%%");
$def[$KEY] .= rrd::line1("hum", "#000000");
}
}
$def[$KEY] .= rrd::hrule($VAL['WARN_MIN'], "#FFFF00", "Warning lower\\: " . $VAL['WARN_MIN'] . "{$unit} upper\\: " . $VAL['WARN_MAX'] . "{$unit} \\n");
$def[$KEY] .= rrd::hrule($VAL['WARN_MAX'], "#FFFF00");
$def[$KEY] .= rrd::hrule($VAL['CRIT_MIN'], "#FF0000", "Critical lower\\: " . $VAL['CRIT_MIN'] . "{$unit} upper\\: " . $VAL['CRIT_MAX'] . "{$unit} \\n");
$def[$KEY] .= rrd::hrule($VAL['CRIT_MIN'], "#FF0000");
}
# vim: set ts=4 sw=4 et syn=php :
示例14: Copyright
<?php
/*
adminutils - Scripts and resources for admins
Copyright (C) 2012 nmaupu_at_gmail_dot_com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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/>.
*/
$DS_time = $this->DS[0];
$opt[1] = "--vertical-label \"Response time\" -l0 --title \"HTTP response time for {$hostname} / {$servicedesc}\" ";
$def[1] = rrd::def("var1", $DS_time['RRDFILE'], $DS_time['DS']);
$def[1] .= rrd::cdef("v_n", "var1,1000,*");
// display in ms
$def[1] .= rrd::gradient("v_n", "#33CCFF", "#3300FF", "time");
$def[1] .= rrd::line1("v_n", "#000000");
$def[1] .= rrd::gprint("v_n", array("LAST", "AVERAGE", "MIN", "MAX"), "%6.3lfms");
示例15: array
}
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning " . $WARN[1] . $UNIT[1] . "\\n");
}
if ($CRIT[1] != "") {
if ($UNIT[1] == "%%") {
$UNIT[1] = "%";
}
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Critical " . $CRIT[1] . $UNIT[1] . "\\n");
}
#
# Packets Lost
$ds_name[2] = "Packets Lost";
$opt[2] = "--vertical-label \"Packets lost\" -l0 -u105 --title \"Packets lost\" ";
$opt[2] .= rrd::darkteint();
$def[2] = rrd::def("var1", $RRDFILE[2], $DS[2], "AVERAGE");
$def[2] .= rrd::gradient("var1", "ff5c00", "ffdc00", "Packets Lost", 20);
$def[2] .= rrd::ticker("var1", $WARN[2], $CRIT[2]);
$def[2] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.0lf {$UNIT['2']}");
$def[2] .= rrd::line1("var1", "#000000");
$def[2] .= rrd::hrule("100", "#0000ff");
if ($WARN[2] != "") {
if ($UNIT[2] == "%%") {
$UNIT[2] = "%";
}
$def[2] .= rrd::hrule($WARN[2], "#FFFF00", "Warning " . $WARN[2] . $UNIT[2] . "\\n");
}
if ($CRIT[2] != "") {
if ($UNIT[2] == "%%") {
$UNIT[2] = "%";
}
$def[2] .= rrd::hrule($CRIT[2], "#FF0000", "Critical " . $CRIT[2] . $UNIT[2] . "\\n");