本文整理汇总了PHP中rrd::hrule方法的典型用法代码示例。如果您正苦于以下问题:PHP rrd::hrule方法的具体用法?PHP rrd::hrule怎么用?PHP rrd::hrule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rrd
的用法示例。
在下文中一共展示了rrd::hrule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
# 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, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# $Id$
#
$opt[1] = "--vertical-label \"bits per second\" --title \"Traffic {$hostname} / {$servicedesc}\" ";
$opt[2] = "--vertical-label \"errors per second\" --title \"Error {$hostname} / {$servicedesc}\" ";
$ds_name[1] = "Traffic";
$ds_name[2] = "Error";
$def[1] = rrd::def("ifInOctets", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::def("ifOutOctets", $RRDFILE[3], $DS[3], "AVERAGE");
$def[1] .= rrd::def("ifSpeed", $RRDFILE[5], $DS[5], "AVERAGE");
$def[1] .= rrd::vdef('ifSpeedLast', 'ifSpeed,LAST');
$def[2] = rrd::def("ifInErrors", $RRDFILE[2], $DS[2], "AVERAGE");
$def[2] .= rrd::def("ifOutErrors", $RRDFILE[4], $DS[4], "AVERAGE");
$def[1] .= rrd::hrule("ifSpeedLast", "#000000", rrd::cut("Speed", 10));
$def[1] .= rrd::gprint("ifSpeed", array("LAST"), "%6.2lf%sbit/s");
$def[1] .= rrd::area("ifInOctets", "#00FF00", rrd::cut("Inbound", 10));
$def[1] .= rrd::gprint("ifInOctets", array("LAST", "MAX", "AVERAGE"), "%6.2lf%sbit/s");
$def[1] .= rrd::line1("ifOutOctets", "#0000FF", rrd::cut("Outbound", 10));
$def[1] .= rrd::gprint("ifOutOctets", array("LAST", "MAX", "AVERAGE"), "%6.2lf%sbit/s");
$def[2] .= rrd::area("ifInErrors", "#800000", rrd::cut("Inbound", 10));
$def[2] .= rrd::gprint("ifInErrors", array("LAST", "MAX", "AVERAGE"), "%4.2lf%s errors/s");
$def[2] .= rrd::area("ifOutErrors", "#FF0000", rrd::cut("Outbound", 10), true);
$def[2] .= rrd::gprint("ifOutErrors", array("LAST", "MAX", "AVERAGE"), "%4.2lf%s errors/s");
# vim: set ts=4 sw=4 et syn=php :
示例2: array
} 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 != "") {
$def[$KEY] .= rrd::hrule($crit_min, $_CRITRULE, "Critical (min) {$crit_min} \\n");
}
if ($crit_max != "") {
$def[$KEY] .= rrd::hrule($crit_max, $_CRITRULE, "Critical (max) {$crit_max} \\n");
}
$def[$KEY] .= rrd::comment("Default Template\\r");
$def[$KEY] .= rrd::comment("Command " . $VAL['TEMPLATE'] . "\\r");
}
}
示例3: 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");
}
示例4: preg_replace
if (preg_match('/^(.*?)_usage_in/', $NAME[$i])) {
$interface = preg_replace('/_.*$/', '', $LABEL[$i]);
$ds_name[$num] = $interface . ' usage';
$opt[$num] = "--vertical-label \"Usage\" -l 0 -u 100 --title \"Interface Usage for {$hostname} - " . $interface . "\" ";
$def[$num] = "DEF:percin={$RRDFILE[$i]}:{$DS[$i]}:AVERAGE ";
$def[$num] .= "DEF:percout=" . $RRDFILE[$i + 1] . ":" . $DS[$i + 1] . ":AVERAGE ";
$def[$num] .= "LINE2:percin#00e060:\"in\t\" ";
$def[$num] .= "GPRINT:percin:LAST:\"%10.1lf %% last\" ";
$def[$num] .= "GPRINT:percin:AVERAGE:\"%7.1lf %% avg\" ";
$def[$num] .= "GPRINT:percin:MAX:\"%7.1lf %% max\\n\" ";
$def[$num] .= "LINE2:percout#0080e0:\"out\t\" ";
$def[$num] .= "GPRINT:percout:LAST:\"%10.1lf %% last\" ";
$def[$num] .= "GPRINT:percout:AVERAGE:\"%7.1lf %% avg\" ";
$def[$num] .= "GPRINT:percout:MAX:\"%7.1lf %% max\"\\n ";
$def[$num] .= rrd::hrule($WARN[$i], $_WARNRULE);
$def[$num] .= rrd::hrule($CRIT[$i], $_CRITRULE);
$num++;
}
# eth0_traffic_in / out
# GigabitEthernet 0/0_traffic_in / out
if (preg_match('/^(.*?)_traffic_in/', $NAME[$i])) {
$interface = preg_replace('/_.*$/', '', $LABEL[$i]);
$ds_name[$num] = $interface . ' traffic';
$opt[$num] = "--vertical-label \"Traffic\" -b 1024 --title \"Interface Traffic for {$hostname} - {$interface}\" ";
$def[$num] = "DEF:bitsin={$RRDFILE[$i]}:{$DS[$i]}:AVERAGE ";
$def[$num] .= "DEF:bitsout=" . $RRDFILE[$i + 1] . ":" . $DS[$i + 1] . ":AVERAGE ";
$def[$num] .= "AREA:bitsin#00e060:\"in\t\" ";
$def[$num] .= "GPRINT:bitsin:LAST:\"%10.1lf %Sb/s last\" ";
$def[$num] .= "GPRINT:bitsin:AVERAGE:\"%7.1lf %Sb/s avg\" ";
$def[$num] .= "GPRINT:bitsin:MAX:\"%7.1lf %Sb/s max\\n\" ";
$def[$num] .= "CDEF:bitsminusout=0,bitsout,- ";
示例5: 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");
示例6: foreach
#
#
#
#
$index = 1;
foreach ($DS as $i => $VAL) {
if (!isset($def[$index])) {
$def[$index] = "";
}
$def[$index] .= "DEF:var{$i}={$RRDFILE[$i]}:{$DS[$i]}:AVERAGE ";
if (!preg_match('/^threshold$/', $NAME[$i], $matches)) {
$opt[$index] = "--title \"{$hostname} / {$servicedesc} / {$NAME[$i]} \" ";
$def[$index] .= rrd::gradient("var{$i}", "ff5c00", "ffdc00", "{$NAME[$i]}", 20);
$def[$index] .= rrd::line1("var{$i}", "#000000");
$def[$index] .= rrd::gprint("var{$i}", "LAST", "%6.0lf \\n");
} else {
$def[$index] .= rrd::line2("var{$i}", "#555210", "{$NAME[$i]}");
$def[$index] .= rrd::gprint("var{$i}", "LAST", "%6.0lf \\n");
$val = $i - 1;
if ($WARN[$val] != "") {
$def[$index] .= rrd::hrule($WARN[$val], "#FFFF00", "Warning " . $WARN[$val] . $UNIT[$val] . "\\n");
}
if ($CRIT[$val] != "") {
$def[$index] .= rrd::hrule($CRIT[$val], "#FF0000", "Critical " . $CRIT[$val] . $UNIT[$val] . "\\n");
}
$index = $index + 1;
}
}
?>
示例7: str_replace
$divis = $max[3];
$return = '';
}
$ds_name[$KEY] = str_replace("_", "/", $VAL['NAME']);
# set graph labels
$opt[$KEY] = "--vertical-label {$label} -l 0 {$upper} --title \"Filesystem {$ds_name[$KEY]}\" ";
# Graph Definitions
$def[$KEY] = rrd::def("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
# "normalize" graph values
$def[$KEY] .= rrd::cdef("v_n", "var1,{$divis},/");
$def[$KEY] .= rrd::area("v_n", "#c6c6c6", $ds_name[$KEY]);
$def[$KEY] .= rrd::line1("v_n", "#003300");
# show values in legend
$def[$KEY] .= rrd::gprint("v_n", "LAST", "{$fmt} {$label}{$pct} {$maximum} ");
$def[$KEY] .= rrd::gprint("v_n", "AVERAGE", "{$fmt} {$label}{$pct} avg used {$return}");
# create max line and legend
if ($VAL['MAX'] != "") {
$def[$KEY] .= rrd::gprint("v_n", "MAX", "{$fmt} {$label}{$pct} max used \\n");
$def[$KEY] .= rrd::hrule($max[1], "#003300", "Size of FS {$max['0']} \\n");
}
# create warning line and legend
if ($VAL['WARN'] != "") {
$warn = pnp::adjust_unit($VAL['WARN'] . $unit, 1024, $fmt);
$def[$KEY] .= rrd::hrule($warn[1], "#ffff00", "Warning on {$warn['0']} \\n");
}
# create critical line and legend
if ($VAL['CRIT'] != "") {
$crit = pnp::adjust_unit($VAL['CRIT'] . $unit, 1024, $fmt);
$def[$KEY] .= rrd::hrule($crit[1], "#ff0000", "Critical on {$crit['0']}\\n");
}
}
示例8: array
#
# Runtime
#
$opt[1] = "--vertical-label \"{$UNIT['1']}\" --title \"Runtime of process_perfdata.pl\" ";
#
#
#
#$s=$this->STRUCT['TIMERANGE']['end'];
$ds_name[1] = "Runtime";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::cdef("t_var1", "var1,14400,TREND");
if ($WARN[1] != "") {
$def[1] .= rrd::hrule($WARN[1], "#FFFF00");
}
if ($CRIT[1] != "") {
$def[1] .= rrd::hrule($CRIT[1], "#FF0000");
}
$def[1] .= rrd::gradient("var1", "ffffff", "#33cccc", rrd::cut("Runtime", 10));
$def[1] .= rrd::line1("var1", "#339999");
$def[1] .= rrd::gprint("var1", array('LAST', 'MAX', 'AVERAGE'), "%6.2lf{$UNIT['1']}");
$def[1] .= rrd::line1("t_var1", "#ff9999", rrd::cut("4h trend", 10));
$def[1] .= rrd::gprint("t_var1", array('LAST', 'MAX', 'AVERAGE'), "%6.2lf{$UNIT['1']}");
#
# Lines processed and RRD errors
#
$opt[2] = "--vertical-label \"Counter\" --title \"Number of updates\" ";
#
#
#
$ds_name[2] = "Errors and updates";
$def[2] = '';
示例9: Copyright
<?php
#
# Copyright (c) 2011 Anders Håål, based on check_load
# Plugin: check_bischeck
#
$opt[1] = "--title \"{$hostname} / {$servicedesc}\" ";
#
#
#
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::def("var2", $RRDFILE[1], $DS[2], "AVERAGE");
$def[1] .= rrd::area("var1", "#EACC00", "Measured ");
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::area("var2", "#EA8F00", "Threshold ");
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
if ($WARN[1] != "") {
$def[1] .= rrd::hrule($WARN[1], "#FFFF00", "Warning " . $WARN[1] . $UNIT[1] . "\\n");
}
if ($CRIT[1] != "") {
$def[1] .= rrd::hrule($CRIT[1], "#FF0000", "Warning " . $CRIT[1] . $UNIT[1] . "\\n");
}
示例10: array
# 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");
//print_r($def[1]);
// Debug
//$content = ob_get_clean();
//fwrite($fp, "$content\n");
//fclose($fp);
示例11: array
$ds_name[$KEY] = $VAL['LABEL'];
// Graph Opt
$opt[$KEY] = '--vertical-label "' . $vlabel . '" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $VAL['LABEL'] . '"';
if ($unit == "%") {
$opt[$KEY] .= " --lower=0 --upper=101 ";
}
// Draw
$def[$KEY] = rrd::def("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::gradient("var1", $_AREA, $_AREA2, rrd::cut($VAL['NAME'], 16), 20);
$def[$KEY] .= rrd::line1("var1", $_LINE);
$def[$KEY] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.4lf%S{$unit}");
// Warning Lines
if ($VAL['WARN'] != "") {
$def[$KEY] .= rrd::hrule($VAL['WARN'], $_WARNRULE, "Warning " . $VAL['WARN'] . "{$unit} \\n");
} else {
if ($VAL['WARN_MIN'] != "" && $VAL['WARN_MAX'] != "") {
$def[$KEY] .= rrd::hrule($VAL['WARN_MIN'], $_WARNRULE, "Warning (min\\: " . $VAL['WARN_MIN'] . "{$unit} min\\: " . $VAL['WARN_MAX'] . "{$unit})\\n");
$def[$KEY] .= rrd::hrule($VAL['WARN_MAX'], $_WARNRULE);
}
}
// Critical Lines
if ($VAL['CRIT'] != "") {
$def[$KEY] .= rrd::hrule($VAL['CRIT'], $_CRITRULE, "Warning " . $VAL['CRIT'] . "{$unit} \\n");
} else {
if ($VAL['CRIT_MIN'] != "" && $VAL['CRIT_MAX'] != "") {
$def[$KEY] .= rrd::hrule($VAL['CRIT_MIN'], $_CRITRULE, "Warning (min\\: " . $VAL['CRIT_MIN'] . "{$unit} min\\: " . $VAL['CRIT_MAX'] . "{$unit})\\n");
$def[$KEY] .= rrd::hrule($VAL['CRIT_MAX'], $_CRITRULE);
}
}
}
# vim: set ts=4 sw=4 et syn=php :
示例12: Copyright
<?php
#
# Copyright (c) 2006-2010 Joerg Linge (http://www.pnp4nagios.org)
# Template for check_disk
#
# RRDtool Options
foreach ($this->DS as $KEY => $VAL) {
$ds_name[$KEY] = str_replace("_", "/", $VAL['NAME']);
$opt[$KEY] = "--vertical-label MB -l 0 -u " . $VAL['MAX'] . " --title \"Filesystem " . $ds_name[$KEY] . "\" ";
# Graph Definitions
$def[$KEY] = rrd::def("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$KEY] .= rrd::area("var1", "#c6c6c6", $ds_name[$KEY]);
$def[$KEY] .= rrd::line1("var1", "#003300");
$def[$KEY] .= rrd::hrule($VAL['MAX'], "#003300", "Size " . $VAL['MAX'] . " MB \\n");
$def[$KEY] .= rrd::gprint("var1", "LAST", "%6.2lf MB of " . $VAL['MAX'] . " MB used");
$def[$KEY] .= rrd::gprint("var1", "MAX", "%6.2lf MB max used");
$def[$KEY] .= rrd::gprint("var1", "AVERAGE", "%6.2lf MB avg used \\n");
if ($VAL['WARN'] != "") {
$def[$KEY] .= rrd::hrule($VAL['WARN'], "#ffff00", "Warning on " . $VAL['WARN'] . " MB \\n");
}
if ($VAL['CRIT'] != "") {
$def[$KEY] .= rrd::hrule($VAL['CRIT'], "#ff0000", "Critical on " . $VAL['CRIT'] . " MB \\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: array
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_threads = $this->DS[0];
$ds_daemon = $this->DS[1];
$ds_peak = $this->DS[2];
$ds_total = $this->DS[3];
$unit = $ds_threads['UNIT'];
$max = $ds_threads['ACT'] > $ds_threads['CRIT'] ? $ds_threads['ACT'] : $ds_threads['CRIT'];
$opt[1] = "--vertical-label Load -l0 -u {$max} --title \"JVM threads for {$hostname}\" ";
$def[1] = rrd::def("var1", $ds_threads['RRDFILE'], $ds_threads['DS']);
$def[1] .= rrd::def("var2", $ds_daemon['RRDFILE'], $ds_daemon['DS']);
$def[1] .= rrd::def("var3", $ds_peak['RRDFILE'], $ds_peak['DS']);
$def[1] .= rrd::def("var4", $ds_total['RRDFILE'], $ds_total['DS']);
$def[1] .= rrd::line2("var1", "#66ccff", "Live threads");
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MIN", "MAX"), "%.0lf{$unit}");
$def[1] .= rrd::line1("var2", "#CCCC33", "Daemon threads");
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MIN", "MAX"), "%.0lf{$unit}");
$def[1] .= rrd::hrule($ds_threads['WARN'], "#FFFF00", "Warning (" . $ds_threads['WARN'] . ") \\n");
$def[1] .= rrd::hrule($ds_threads['CRIT'], "#FF0000", "Critical (" . $ds_threads['CRIT'] . ") \\n");
$def[1] .= rrd::gprint("var3", "LAST", "Last peak \\: %.0lf{$unit}");
示例15: array
$critical = $VAL['CRIT'];
}
if ($VAL['MIN'] != "") {
$lower = " --lower=" . $VAL['MIN'];
$minimum = $VAL['MIN'];
}
if ($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", "BDC6DE", "3152A5", 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 ($critical != "") {
$def[$KEY] .= rrd::hrule($critical, $_CRITRULE, "Critical {$critical} \\n");
}
$def[$KEY] .= rrd::comment("Default Template\\r");
$def[$KEY] .= rrd::comment("Command " . $VAL['TEMPLATE'] . "\\r");
}