本文整理汇总了PHP中rrd::line1方法的典型用法代码示例。如果您正苦于以下问题:PHP rrd::line1方法的具体用法?PHP rrd::line1怎么用?PHP rrd::line1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rrd
的用法示例。
在下文中一共展示了rrd::line1方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
#third graph - open slots count
$ds_name[3] = "Open slots";
$opt[3] = " --vertical-label \"Workers\" --title \"Apache open slots on {$hostname} / {$servicedesc}\" ";
$opt[3] .= " --slope-mode ";
$def[3] = rrd::def("var1", $RRDFILE[1], $DS[11], "AVERAGE");
$def[3] .= rrd::area("var1", "#e0e0e0", "open slots");
$def[3] .= rrd::line1("var1", "#858585");
$def[3] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%7.0lf");
#fourth graph - server's traffic total and per request
$ds_name[4] = "Apache Traffic";
$opt[4] = " --vertical-label \"Traffic\" -b 1024 --title \"Apache Traffic for {$hostname} / {$servicedesc}\" ";
$opt[4] .= " --slope-mode ";
$def[4] = rrd::def("var1", $RRDFILE[1], $DS[13], "AVERAGE");
$def[4] .= rrd::cdef("trbytes", "var1,1024,*");
$def[4] .= rrd::def("var2", $RRDFILE[1], $DS[14], "AVERAGE");
$def[4] .= rrd::cdef("negperreq", "var2,-1,*");
$def[4] .= "VDEF:totalbytes=trbytes,TOTAL ";
$def[4] .= rrd::area("trbytes", "#b0c0fb", "throughput");
$def[4] .= rrd::line1("trbytes", "#3c63ff");
$def[4] .= rrd::gprint("trbytes", array("LAST", "MAX", "AVERAGE"), "%7.2lf %sB/sec");
$def[4] .= rrd::line2("negperreq", "#00ff00", "kB/request");
$def[4] .= rrd::gprint("var2", array("LAST", "MAX", "AVERAGE"), "%7.2lf %s{$UNIT['14']}");
$def[4] .= "GPRINT:totalbytes:\"%3.0lf %sB total\\n\" ";
#fifth graph - requests per sec ( rate is calculated by apache, time smoothed, very averaged, shouldn't be believed)
$ds_name[5] = "Apache requests";
$opt[5] = " --vertical-label \"Request/sec\" --title \"Apache request/sec for {$hostname} / {$servicedesc}\" ";
$opt[5] .= " --slope-mode ";
$def[5] = rrd::def("var1", $RRDFILE[1], $DS[12], "AVERAGE");
$def[5] .= rrd::area("var1", "#b7ff9e", "Requests / sec");
$def[5] .= rrd::line1("var1", "#2eae00");
$def[5] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%7.2lf %s");
示例2:
$vindex_memorypeak = $VAR['used_memory_peak'];
$vindex_memoryrss = $VAR['used_memory_rss'];
$vindex_fragmentation = $VAR['mem_fragmentation_ratio'];
$vindex_utilization = $VAR['memory_utilization'];
$ds_name[$gindex] = "Redis Memory";
$opt[$gindex] = "--lower-limit=0 --vertical-label \"MB\" --title \"{$servicedesc} Memory Use on {$hostname}\" ";
$def[$gindex] = rrd::def("bytes", $RRDFILE[$vindex_usedmemory], $DS[$vindex_usedmemory], "AVERAGE");
$def[$gindex] .= rrd::def("maxbytes", $RRDFILE[$vindex_memorypeak], $DS[$vindex_memorypeak], "AVERAGE");
$def[$gindex] .= rrd::cdef("use_mb", "bytes,1024,/,1024,/");
$def[$gindex] .= rrd::cdef("maxuse_mb", "maxbytes,1024,/,1024,/");
$def[$gindex] .= rrd::cdef("mfree_mb", "maxbytes,bytes,-,1024,/,1024,/");
$def[$gindex] .= rrd::area("use_mb", "#00FFFF", "Used Memory ");
$def[$gindex] .= "GPRINT:use_mb:LAST:\"%6.1lfMB Last \" ";
$def[$gindex] .= "GPRINT:use_mb:MAX:\"%6.1lfMB Max \" ";
$def[$gindex] .= "GPRINT:use_mb:AVERAGE:\"%6.1lfMB Avg \\n\" ";
$def[$gindex] .= rrd::line1("maxuse_mb", "#0000FF", "Max Used Memory ");
$def[$gindex] .= "GPRINT:maxuse_mb:LAST:\"%6.1lfMB Last \" ";
$def[$gindex] .= "GPRINT:maxuse_mb:MAX:\"%6.1lfMB Max \" ";
$def[$gindex] .= "GPRINT:maxuse_mb:AVERAGE:\"%6.1lfMB Avg \\n\" ";
if ($vindex_memoryrss != -1) {
$def[$gindex] .= rrd::def("memoryrss", $RRDFILE[$vindex_memoryrss], $DS[$vindex_memoryrss], "AVERAGE");
$def[$gindex] .= rrd::cdef("memrss_mb", "memoryrss,1024,/,1024,/");
$def[$gindex] .= rrd::cdef("fragmented_mb", "memrss_mb,use_mb,-");
$def[$gindex] .= rrd::area("fragmented_mb", "#FFD700", "Allocated Memory", "STACK");
if ($vindex_utilization != -1) {
$def[$gindex] .= rrd::def("use_perc", $RRDFILE[$vindex_utilization], $DS[$vindex_utilization], "AVERAGE");
$def[$gindex] .= rrd::cdef("free_perc", "100,use_perc,-");
$def[$gindex] .= rrd::cdef("total_mb", "memrss_mb,use_perc,/,100,*");
$def[$gindex] .= rrd::cdef("free_mb", "total_mb,memrss_mb,-");
$def[$gindex] .= "GPRINT:memrss_mb:LAST:\"%6.1lfMB \\g\" ";
$def[$gindex] .= "GPRINT:use_perc:LAST:\" (%2.1lf%%) Last\" ";
示例3: alerter_gr
public static function alerter_gr($vname = FALSE, $label = FALSE, $warning = FALSE, $critical = FALSE, $opacity = 'ff', $unit, $color_green = '#00ff00', $color_btw = '#ffff00', $color_red = '#ff0000', $line_col = '#0000ff', $start_color = "#ffffff")
{
if ($vname === FALSE) {
throw new Kohana_exception("rrd::" . __FUNCTION__ . "() First Parameter 'vname' is missing");
}
if ($label === FALSE) {
throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Second Parameter 'label' is missing");
}
if ($warning === FALSE) {
throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Third Parameter 'warning' is missing");
}
if ($critical === FALSE) {
throw new Kohana_exception("rrd::" . __FUNCTION__ . "() Fourth Parameter 'critical' is missing");
}
$line = "";
$green_vname = "var" . substr(sha1(rand()), 1, 4);
$btw_vname = "var" . substr(sha1(rand()), 1, 4);
$blue_vname = "var" . substr(sha1(rand()), 1, 4);
$red_vname = "var" . substr(sha1(rand()), 1, 4);
$line = "";
if ($warning < $critical) {
$line .= "CDEF:" . $green_vname . "=" . $vname . "," . $warning . ",LT," . $vname . ",UNKN,IF ";
$line .= "CDEF:" . $btw_vname . "=" . $vname . "," . $critical . ",LT," . $vname . ",UNKN,IF ";
$line .= "CDEF:" . $blue_vname . "=" . $btw_vname . "," . $warning . ",GE," . $btw_vname . ",UNKN,IF ";
$line .= "CDEF:" . $red_vname . "=" . $vname . "," . $critical . ",GE," . $vname . ",UNKN,IF ";
} else {
$line .= "CDEF:" . $green_vname . "=" . $vname . "," . $warning . ",GT," . $vname . ",UNKN,IF ";
$line .= "CDEF:" . $btw_vname . "=" . $vname . "," . $critical . ",GE," . $vname . ",UNKN,IF ";
$line .= "CDEF:" . $blue_vname . "=" . $btw_vname . "," . $warning . ",LE," . $btw_vname . ",UNKN,IF ";
$line .= "CDEF:" . $red_vname . "=" . $vname . "," . $critical . ",LT," . $vname . ",UNKN,IF ";
}
$line .= rrd::gradient($green_vname, $start_color, $color_green . $opacity);
$line .= rrd::gradient($blue_vname, $start_color, $color_btw . $opacity);
$line .= rrd::gradient($red_vname, $start_color, $color_red . $opacity);
$line .= rrd::line1($vname, $line_col, $label);
return $line;
}
示例4: foreach
$def[$casecount_int] .= rrd::line1("case_diff{$casecount}", $col_case_runtime_line, "", 1);
} else {
# no steps, no stacks
$def[$casecount_int] .= rrd::area("case{$casecount}", $col_case_runtime_area, $casename);
$def[$casecount_int] .= rrd::line1("case{$casecount}", $col_case_runtime_line, "");
}
$def[$casecount_int] .= rrd::gprint("case{$casecount}", "LAST", "%3.2lf s LAST");
$def[$casecount_int] .= rrd::gprint("case{$casecount}", "MAX", "%3.2lf s MAX ");
$def[$casecount_int] .= rrd::gprint("case{$casecount}", "AVERAGE", "%3.2lf s AVG \\j");
$def[0] .= rrd::comment(" \\n");
# Case graph, Warn/Crit LINE ##########################################################
foreach ($this->DS as $k => $v) {
if (preg_match('/^c_' . $casecount . '__(warning|critical)/', $v['LABEL'], $matches)) {
$threshold = $matches[1];
$def[$casecount_int] .= rrd::def("case_" . $casecount . "__" . $threshold, $v["RRDFILE"], $v["DS"], "AVERAGE");
$def[$casecount_int] .= rrd::line1("case_" . $casecount . "__" . $threshold, ${"col_" . $threshold}, $threshold . " at \\g", 0);
$def[$casecount_int] .= rrd::gprint("case_" . $casecount . "__" . $threshold, "LAST", "%3.0lf s ");
}
}
$def[$casecount_int] .= rrd::comment(" \\n");
$def[$casecount_int] .= rrd::comment(" \\n");
#######################
# TICKS for case state
#######################
$def[$casecount_int] .= rrd::comment("State ticker legend\\:");
$def[$casecount_int] .= rrd::comment(" \\n");
# TICKS for incomplete data ("data" = step/case LINE) ######################################################
# - complete data --> case_unknown_total == 0 --> no TICK (resp. warn/crit TICK)
# - incomplete data --> 0 < case_unknown_total < case_data_count --> orange TICK (overwrites evt warn/crit TICKS)
# - no data at all --> case_unknown_total == case_data_count --> no TICK
# see comments in case tick
示例5: array
$def[1] .= rrd::line1("var{$KEY}", rrd::color($i), rrd::cut($label, 10));
$def[1] .= rrd::gprint("var{$KEY}", array("LAST", "MAX", "AVERAGE"), "%8.2lf");
}
}
$opt[2] = '--title "Host Stats"';
$ds_name[2] = "Host Stats";
$def[2] = "";
$i = 0;
foreach ($this->DS as $KEY => $VAL) {
if (preg_match('/^NUMHST(.*)$/', $VAL['NAME'], $matches)) {
$i++;
$label = ucfirst(strtolower($matches[1]));
$def[2] .= rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[2] .= rrd::line1("var{$KEY}", rrd::color($i), rrd::cut($label, 10));
$def[2] .= rrd::gprint("var{$KEY}", array("LAST", "MAX", "AVERAGE"), "%8.2lf");
}
}
$opt[3] = '--title "Check Execution Time"';
$ds_name[3] = "Execution Time";
$def[3] = "";
$i = 0;
foreach ($this->DS as $KEY => $VAL) {
if (preg_match('/(.*)EXT$/', $VAL['NAME'], $matches)) {
$i++;
$label = ucfirst(strtolower($matches[1]));
$def[3] .= rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[3] .= rrd::cdef("var_sec{$KEY}", "var{$KEY},1000,/");
$def[3] .= rrd::line1("var_sec{$KEY}", rrd::color($i), rrd::cut($label, 10));
$def[3] .= rrd::gprint("var_sec{$KEY}", array("LAST", "MAX", "AVERAGE"), "%8.2lf");
}
}
示例6: Copyright
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/>.
*/
$opt[1] = "--slope-mode --vertical-label Load -l0 --title \"CPU Load for {$hostname} / {$servicedesc}\" ";
$DS_1 = $this->DS[0];
$DS_5 = $this->DS[1];
$DS_15 = $this->DS[2];
$C15 = '#FF0000';
$C5 = '#0000FF';
$C1 = '#EACC00';
$def[1] = rrd::def("var1", $DS_1['RRDFILE'], $DS_1['DS']);
$def[1] .= rrd::def("var2", $DS_5['RRDFILE'], $DS_5['DS']);
$def[1] .= rrd::def("var3", $DS_15['RRDFILE'], $DS_15['DS']);
$def[1] .= rrd::area("var1", $C1, "Load 1");
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::line1("var2", $C5, "Load 5");
$def[1] .= rrd::gprint("var2", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
$def[1] .= rrd::line1("var3", $C15, "Load 15");
$def[1] .= rrd::gprint("var3", array("LAST", "AVERAGE", "MAX"), "%6.2lf");
示例7: foreach
# http://labs.consol.de/nagios/mod-gearman
#
$i = 0;
$color['waiting'] = '#F46312';
$color['running'] = '#0354E4';
$color['worker'] = '#00C600';
foreach ($this->DS as $KEY => $VAL) {
if (preg_match('/(.*)_([^_].*)$/', $VAL['LABEL'], $matches)) {
$queue = $matches[1];
$state = $matches[2];
if ($state == "waiting") {
$i++;
$opt[$i] = '';
$def[$i] = '';
}
$opt[$i] = "-l0 --title \"Gearman Queue '{$queue}'\" ";
#
$ds_name[$i] = "{$queue}";
$def[$i] .= rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$i] .= rrd::line1("var{$KEY}", $color[$state], rrd::cut($state, 16));
$def[$i] .= rrd::gprint("var{$KEY}", array('LAST', 'MAX', 'AVERAGE'), "%6.2lf" . $VAL['UNIT']);
} else {
$i++;
$opt[$i] = "-l0 --title \"Gearman Statistics\" ";
#
$ds_name[$i] = $VAL['NAME'];
$def[$i] = rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$i] .= rrd::line1("var{$KEY}", '#00C600', rrd::cut($VAL['NAME'], 16));
$def[$i] .= rrd::gprint("var{$KEY}", array('LAST', 'MAX', 'AVERAGE'), "%6.2lf");
}
}
示例8: Copyright
# Copyright (c) 2012 Anders Håål Ingenjörsbyn, based on check_load
# Plugin: check_bischeck
#
#
#
#
$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;
}
}
?>
示例9: array
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# $Id$
#
$ds_name[1] = "Memory Usage";
$opt[1] = "-l0 --title \"Memory Usage for {$hostname}\" ";
$def[1] = rrd::def("tot", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::def("slab", $RRDFILE[1], $DS[2], "AVERAGE");
$def[1] .= rrd::def("swapcached", $RRDFILE[1], $DS[3], "AVERAGE");
$def[1] .= rrd::def("pagetables", $RRDFILE[1], $DS[4], "AVERAGE");
$def[1] .= rrd::def("apps", $RRDFILE[1], $DS[5], "AVERAGE");
$def[1] .= rrd::def("memfree", $RRDFILE[1], $DS[6], "AVERAGE");
$def[1] .= rrd::def("buffers", $RRDFILE[1], $DS[7], "AVERAGE");
$def[1] .= rrd::def("cached", $RRDFILE[1], $DS[8], "AVERAGE");
$def[1] .= rrd::def("swap", $RRDFILE[1], $DS[9], "AVERAGE");
$def[1] .= rrd::line1("tot", "#000000", "Total memory");
$def[1] .= rrd::gprint("tot", array("LAST"), "%6.2lf%s");
$def[1] .= rrd::area("apps", "#FF0000", "Applications");
$def[1] .= rrd::gprint("apps", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("pagetables", "#0000FF", "Page Table ", true);
$def[1] .= rrd::gprint("pagetables", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("slab", "#00FFFF", "Slab ", true);
$def[1] .= rrd::gprint("slab", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("swapcached", "#FF8000", "Swap Cache ", true);
$def[1] .= rrd::gprint("swapcached", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("cached", "#FFFF00", "Cache ", true);
$def[1] .= rrd::gprint("cached", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("buffers", "#80FF00", "Buffer ", true);
$def[1] .= rrd::gprint("buffers", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
$def[1] .= rrd::area("memfree", "#00FF00", "Free ", true);
$def[1] .= rrd::gprint("memfree", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
示例10: array
#
#
#$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] = '';
for ($i = 2; $i <= sizeof($DS); $i++) {
$def[2] .= rrd::def("var{$i}", $RRDFILE[$i], $DS[$i], "AVERAGE");
$def[2] .= rrd::line1("var{$i}", rrd::color($i), rrd::cut(ucfirst($LABEL[$i]), 12));
$def[2] .= rrd::gprint("var{$i}", array('LAST', 'MAX', 'AVERAGE'), "%4.0lf{$UNIT[$i]}");
}
示例11: Copyright
<?php
#
# Copyright (c) 2006-2012 Joerg Linge (http://www.pnp4nagios.org)
# Plugin: check_jmx4perl
# Dataset: connector_errors
# Perfdata: errors=0;90;100
#
$opt[1] = "--force-rules-legend -X0 --vertical-label \"Errors\" --title \"Connector Errors {$hostname} / {$servicedesc}\" ";
$def[1] = rrd::def("var1", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::area("var1", "#D9D9D9");
$def[1] .= rrd::line1("var1", "#B10026", $LABEL[1]);
if ($WARN[1] != "") {
$def[1] .= "HRULE:{$WARN['1']}#FFFF00 ";
}
if ($CRIT[1] != "") {
$def[1] .= "HRULE:{$CRIT['1']}#FF0000 ";
}
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%.0lf");
$def[1] .= rrd::comment("jolokia.org\\r");
示例12: 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, see <http://www.gnu.org/licenses/>.
*/
//$fp = fopen('/tmp/test', 'a');
//ob_start();
//print_r($this->DS);
$DS_gc1_count = $this->DS[0];
$DS_gc2_count = $this->DS[1];
$DS_gc1_time = $this->DS[2];
$DS_gc2_time = $this->DS[3];
$opt[1] = "--vertical-label \"GC usage\" -l 0 --title \"{$hostname} - GC usage\" ";
$def[1] = rrd::def("var1", $DS_gc1_count['RRDFILE'], $DS_gc1_count['DS']);
$def[1] .= rrd::def("var2", $DS_gc2_count['RRDFILE'], $DS_gc2_count['DS']);
$def[1] .= rrd::def("var3", $DS_gc1_time['RRDFILE'], $DS_gc1_time['DS']);
$def[1] .= rrd::def("var4", $DS_gc2_time['RRDFILE'], $DS_gc2_time['DS']);
$def[1] .= rrd::line1("var1", "#00FF00", $DS_gc1_count['NAME']);
$def[1] .= rrd::gprint("var1", array("LAST", "MAX", "AVERAGE"), "%3.2lfcount/s");
$def[1] .= rrd::line1("var2", "#0000FF", $DS_gc2_count['NAME']);
$def[1] .= rrd::gprint("var2", array("LAST", "MAX", "AVERAGE"), "%3.2lfcount/s");
$def[1] .= rrd::line2("var3", "#FFFF00", $DS_gc1_time['NAME']);
$def[1] .= rrd::gprint("var3", array("LAST", "MAX", "AVERAGE"), "%3.2lfms/s");
$def[1] .= rrd::line2("var4", "#FF00FF", $DS_gc2_time['NAME']);
$def[1] .= rrd::gprint("var4", array("LAST", "MAX", "AVERAGE"), "%3.2lfms/s");
// Debug
//$content = ob_get_clean();
//fwrite($fp, "$content\n");
//fclose($fp);
示例13: array
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* This file is part of the nagios-puppet bundle that can be found
* at https://github.com/jasonhancock/nagios-memory
*/
$alpha = 'CC';
$colors = array('#00FF00' . $alpha, '#000066' . $alpha, '#25345C' . $alpha, '#88008A' . $alpha, '#4F7774' . $alpha);
$opt[1] = sprintf('-T 55 -l 0 --vertical-label "Bytes" --title "%s / Network Traffic"', $hostname);
$def[1] = '';
$count = 0;
foreach ($DS as $i) {
$def[1] .= rrd::def("var{$i}", $rrdfile, $DS[$i], 'AVERAGE');
if ($i == '1') {
$def[1] .= rrd::area("var{$i}", $colors[$count], rrd::cut(ucfirst($NAME[$i]), 15));
} else {
$def[1] .= rrd::line1("var{$i}", $colors[$count], rrd::cut(ucfirst($NAME[$i]), 15), 'STACK');
}
$def[1] .= rrd::gprint("var{$i}", array('LAST', 'MAX', 'AVERAGE'), "%4.2lf %s\t");
$count++;
}
示例14: 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");
示例15: asort
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
$VALUE_COUNT = 4;
$name = $NAME;
asort($name);
$c = count($name);
if ($c % $VALUE_COUNT != 0) {
exit;
}
$interface_count = $c / $VALUE_COUNT;
for ($i = 0; $i < $interface_count; $i++) {
$index = $i * $VALUE_COUNT + 1;
list($interface, $data_type) = explode(".", $name[$index + 2]);
$interface = str_replace(";", "", $interface);
$opt[$index + 1] = "--vertical-label \"Speed in Gbps\" -X 0 -l 0 -u 1 --title \"Network Interface Load for {$hostname} / {$interface}\" ";
$ds_name[$index + 1] = "{$interface}:: Receiving and ";
$def[$index + 1] = rrd::def("value1", $RRDFILE[$index + 2], $DS[$index + 2], "AVERAGE");
$def[$index + 1] .= rrd::cdef("value2", "value1,125000,/");
$def[$index + 1] .= rrd::line1("value2", "#008000", "Receiving ");
$def[$index + 1] .= rrd::gprint("value2", array("LAST", "AVERAGE", "MAX"), "%6.4lf Gbps");
list($interface, $data_type) = explode(".", $name[$index + 3]);
$interface = str_replace(";", "", $interface);
$ds_name[$index + 1] .= "Transmission speed";
$def[$index + 1] .= rrd::def("value3", $RRDFILE[$index + 3], $DS[$index + 3], "AVERAGE");
$def[$index + 1] .= rrd::cdef("value4", "value3,125000,/");
$def[$index + 1] .= rrd::line1("value4", "#0000ff", "Transmission ");
$def[$index + 1] .= rrd::gprint("value4", array("LAST", "AVERAGE", "MAX"), "%6.4lf Gbps");
$def[$index + 1] .= rrd::comment(" \\n");
$def[$index + 1] .= rrd::comment(" \\n");
$def[$index + 1] .= rrd::comment(" \\n");
}