本文整理汇总了PHP中rrd::area方法的典型用法代码示例。如果您正苦于以下问题:PHP rrd::area方法的具体用法?PHP rrd::area怎么用?PHP rrd::area使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rrd
的用法示例。
在下文中一共展示了rrd::area方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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++;
}
示例2: 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 :
示例3: foreach
$ds_name[$i] = "Slots";
$regex = '/^Slots$/';
$color = '#ff0000';
foreach ($this->DS as $KEY => $VAL) {
if (preg_match($regex, $VAL['NAME'])) {
$def[$i] .= rrd::def("var" . $KEY, $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$i] .= rrd::area("var" . $KEY, $color, rrd::cut($VAL['NAME'], 12));
$def[$i] .= rrd::gprint("var" . $KEY, array("LAST", "MAX", "AVERAGE"), "%6.0lf");
}
}
$regex = '/^OpenSlots$/';
$color = '#00ff00';
foreach ($this->DS as $KEY => $VAL) {
if (preg_match($regex, $VAL['NAME'])) {
$def[$i] .= rrd::def("var" . $KEY, $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[$i] .= rrd::area("var" . $KEY, $color, rrd::cut($VAL['NAME'], 12));
$def[$i] .= rrd::gprint("var" . $KEY, array("LAST", "MAX", "AVERAGE"), "%6.0lf");
}
}
#
# Requests per Second
#
$i++;
$def[$i] = "";
$opt[$i] = " --title Requests/s";
$ds_name[$i] = "Requests/s";
$regex = '/ReqPerSec/';
$color = '#000000';
foreach ($this->DS as $KEY => $VAL) {
if (preg_match($regex, $VAL['NAME'])) {
$def[$i] .= rrd::def("var" . $KEY, $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
示例4: preg_replace
$VAL['NAME'] = preg_replace('/^p(\\d+)a$/', 'Amperage Probe $1', $VAL['NAME']);
if ($visited_pwr == 0) {
++$count;
$visited_pwr = 1;
}
$ds_name[$count] = "Amperage Probes";
$vlabel = "Ampere";
$title = $ds_name[$count];
$opt[$count] = "-X0 --lower-limit 0 --slope-mode --vertical-label \"{$vlabel}\" --title \"{$def_title}: {$title}\" ";
if (isset($def[$count])) {
$def[$count] .= rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
} else {
$def[$count] = rrd::def("var{$KEY}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
}
$def[$count] .= rrd::line1("var{$KEY}", "#" . $colors[$a], $VAL['NAME']);
$def[$count] .= rrd::area("var{$KEY}", "#" . $colors[$a++] . "20");
$def[$count] .= rrd::gprint("var{$KEY}", array("LAST", "MAX", "AVERAGE"), "%4.2lf A");
}
}
# FANS (RPMs)
if (preg_match('/^fan_/', $VAL['NAME']) || preg_match('/^f\\d+$/', $VAL['NAME'])) {
if ($visited_fan == 0) {
++$count;
$visited_fan = 1;
}
# Long label
$VAL['NAME'] = preg_replace('/^fan_\\d+_/', '', $VAL['NAME']);
$VAL['NAME'] = preg_replace('/_rpm$/', '', $VAL['NAME']);
$VAL['NAME'] = preg_replace('/_/', ' ', $VAL['NAME']);
# Short label
$VAL['NAME'] = preg_replace('/^f(\\d+)$/', 'Fan Probe $1', $VAL['NAME']);
示例5: pad
$def[$casecount_int] .= rrd::comment(" \\n");
# Case graph, Case runtime on top ###########################################################
$def[$casecount_int] .= rrd::def("case{$casecount}", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
# not used anymore; formerly used to draw grey TICK-areas if any case is unknown to hide everything.
$def[$casecount_int] .= rrd::cdef("case" . $casecount . "_unknown", "case{$casecount},UN,1,0,IF");
if ($s_last_index != "") {
$def[$casecount_int] .= rrd::cdef("case_diff{$casecount}", "case{$casecount},s_line_stackbase{$s_last_index},-");
# invisible line to stack upon
$def[$casecount_int] .= rrd::line1("s_line_stackbase{$s_last_index}", "#00000000");
$def[$casecount_int] .= rrd::area("case_diff{$casecount}", $col_case_runtime_area, pad($casename, $label_max_length), 1);
# invisible line to stack upon
$def[$casecount_int] .= rrd::line1("s_line_stackbase{$s_last_index}", "#00000000");
$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 ");
}
}
示例6: array
<?php
$ds_name[1] = "Barracuda Queues";
$opt[1] = "--vertical-label 'Queue Length' -l0 --title \"Queue Length for {$hostname}\" ";
#
$def[1] = rrd::def("inqueue", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::area("inqueue", "#22cc22", "inqueue", 'STACK');
$def[1] .= rrd::gprint("inqueue", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("outqueue", $RRDFILE[2], $DS[1], "AVERAGE");
$def[1] .= rrd::area("outqueue", "#2222FF", "outqueue", 'STACK');
$def[1] .= rrd::gprint("outqueue", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
示例7: array
<?php
$ds_name[1] = "Barracuda Outbound Message Statistics";
$opt[1] = "--vertical-label 'Messages' -l0 --title \"Message Statistics for {$hostname}\" ";
$def[1] = rrd::def("hourlyOutboundPolicyBlocked", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyOutboundPolicyBlocked", "#ff3333", "hourlyOutboundPolicyBlocked", 'STACK');
$def[1] .= rrd::gprint("hourlyOutboundPolicyBlocked", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyOutboundSpamBlocked", $RRDFILE[2], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyOutboundSpamBlocked", "#ff33b9", "hourlyOutboundSpamBlocked", 'STACK');
$def[1] .= rrd::gprint("hourlyOutboundSpamBlocked", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyOutboundVirusBlocked", $RRDFILE[3], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyOutboundVirusBlocked", "#ff7633", "hourlyOutboundVirusBlocked", 'STACK');
$def[1] .= rrd::gprint("hourlyOutboundVirusBlocked", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyOutboundRateControlled", $RRDFILE[4], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyOutboundRateControlled", "#9600ff", "hourlyOutboundRateControlled", 'STACK');
$def[1] .= rrd::gprint("hourlyOutboundRateControlled", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyOutboundQuarantined", $RRDFILE[5], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyOutboundQuarantined", "#33b0ff", "hourlyOutboundQuarantined", 'STACK');
$def[1] .= rrd::gprint("hourlyOutboundQuarantined", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyEncrypted", $RRDFILE[6], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyEncrypted", "#3333aa", "hourlyEncrypted", 'STACK');
$def[1] .= rrd::gprint("hourlyEncrypted", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlyRedirected", $RRDFILE[7], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlyRedirected", "#33aa84", "hourlyRedirected", 'STACK');
$def[1] .= rrd::gprint("hourlyRedirected", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("hourlySent", $RRDFILE[8], $DS[1], "AVERAGE");
$def[1] .= rrd::area("hourlySent", "#45e126", "hourlySent", 'STACK');
$def[1] .= rrd::gprint("hourlySent", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
?>
示例8: array
* 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/.
*
*
* Plots number of cloudstack instances by state as reported by the
* check_cloud_instances.php plugin.
*
* This file is part of the nagios-cloudstack bundle that can be found
* at https://github.com/jasonhancock/nagios-cloudstack
*/
$alpha = '';
$colors = array('Running' => '#00FF00' . $alpha, 'Starting' => '#0000FF' . $alpha, 'Stopping' => '#FF0000' . $alpha, 'Destroyed' => '#CCCCCC' . $alpha);
$vlabel = '# of VMs';
$opt[1] = sprintf('-T 55 -l 0 --vertical-label "%s" --title "%s / Number of VMs"', $vlabel, $hostname);
$def[1] = '';
$ds_name[1] = 'Cloud Instances';
$count = 0;
foreach ($this->DS as $i => $dso) {
$def[1] .= rrd::def("var{$i}", $dso['RRDFILE'], $dso['DS'], 'AVERAGE');
$name = rrd::cut($dso['NAME'], 9);
$color = isset($colors[$dso['NAME']]) ? $colors[$dso['NAME']] : '#FFFF00';
$stack = $i == 0 ? '' : 'STACK';
$def[1] .= rrd::area("var{$i}", $color, $name, $i == 0 ? '' : $stack);
$def[1] .= rrd::gprint("var{$i}", array('LAST', 'MAX', 'AVERAGE'), "%3.0lf");
}
$def[1] .= 'COMMENT:"' . $TEMPLATE[$i] . '\\r" ';
示例9: array
#
$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");
$def[1] .= rrd::area("swap", "#800000", "Swap ", true);
$def[1] .= rrd::gprint("swap", array("LAST", "AVERAGE", "MAX"), "%6.2lf%s");
# vim: set ts=4 sw=4 et syn=php :
示例10: 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");
}
示例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
$def[$defcnt] .= rrd::area("mem", "#c3c3c3", "Memory");
$def[$defcnt] .= rrd::line1("mem", "#111111");
$def[$defcnt] .= rrd::gprint("mem", array("MAX", "AVERAGE", "LAST"), "%.1lf %SB");
$defcnt++;
}
if (preg_match('/^buffer_cache_hit_ratio$/', $VAL['NAME'])) {
$ds_name[$defcnt] = "Buffer Cache Hit Ratio";
$opt[$defcnt] = "--vertical-label \"%\" --title \"Buffer cache hit ratio on {$hostname}\" ";
$def[$defcnt] = "";
$def[$defcnt] .= rrd::def("bufcahitrat", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE:reduce=LAST");
$def[$defcnt] .= rrd::cdef("ar", "bufcahitrat," . $VAL['CRIT_MIN'] . ",LE,bufcahitrat,0,GT,INF,UNKN,IF,UNKN,IF,ISINF,bufcahitrat,0,IF");
$def[$defcnt] .= rrd::cdef("ay", "bufcahitrat," . $VAL['WARN_MIN'] . ",LE,bufcahitrat," . $VAL['CRIT_MIN'] . ",GT,INF,UNKN,IF,UNKN,IF,ISINF,bufcahitrat,0,IF");
$def[$defcnt] .= rrd::cdef("ag", "bufcahitrat,100,LE,bufcahitrat," . $VAL['WARN_MIN'] . ",GT,INF,UNKN,IF,UNKN,IF,ISINF,bufcahitrat,0,IF");
$def[$defcnt] .= rrd::area("ag", "#{$green}");
$def[$defcnt] .= rrd::area("ay", "#{$yellow}");
$def[$defcnt] .= rrd::area("ar", "#{$red}");
$def[$defcnt] .= rrd::line1("bufcahitrat", "#000000:");
$def[$defcnt] .= rrd::gprint("bufcahitrat", "LAST", "Hit ratio is %3.2lf percent\\n");
$defcnt++;
}
if (preg_match('/^(.*)_lock_timeouts_per_sec/', $VAL['NAME'], $match)) {
$dsname = $match[1];
if (empty($opt[1])) {
$opt[1] = "--vertical-label \"Lock timeouts/s\" -l0 --title \"Locks timeouts / sec\" ";
}
if (empty($def[1])) {
$def[1] = "";
}
$ds_name[1] = "Lock Timeouts Per Second ";
$def[1] .= rrd::def("var" . $KEY, $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
$def[1] .= rrd::line1("var" . $KEY, rrd::color($KEY), rrd::cut($dsname, 12));
示例13: array
<?php
$ds_name[1] = "Barracuda Inbound Message Statistics";
$opt[1] = "--vertical-label 'Messages' -l0 --title \"Message Statistics for {$hostname}\" ";
$def[1] = rrd::def("InboundBlocked", $RRDFILE[1], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundBlocked", "#ff0000", "InboundBlocked", 'STACK');
$def[1] .= rrd::gprint("InboundBlocked", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("InboundVirusBlocked", $RRDFILE[2], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundVirusBlocked", "#ff8400", "InboundVirusBlocked", 'STACK');
$def[1] .= rrd::gprint("InboundVirusBlocked", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("InboundRateLimited", $RRDFILE[3], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundRateLimited", "#9600ff", "InboundRateLimited", 'STACK');
$def[1] .= rrd::gprint("InboundRateLimited", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("InboundQuarantined", $RRDFILE[4], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundQuarantined", "#33b0ff", "InboundQuarantined", 'STACK');
$def[1] .= rrd::gprint("InboundQuarantined", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("InboundTagged", $RRDFILE[5], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundTagged", "#fdff33", "InboundTagged", 'STACK');
$def[1] .= rrd::gprint("InboundTagged", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
$def[1] .= rrd::def("InboundAllowed", $RRDFILE[6], $DS[1], "AVERAGE");
$def[1] .= rrd::area("InboundAllowed", "#45e126", "Allowed", 'STACK');
$def[1] .= rrd::gprint("InboundAllowed", array("LAST", "MAX", "AVERAGE"), "%6.0lf");
示例14: explode
<?php
# VmPeak:530255872,VmSize:530251776,VmLck:0,VmHWM:243642368,VmRSS:243634176,VmData:252669952,VmStk:397312,VmExe:2215936,VmLib:9801728,VmPTE:827392
# TODO: .../buildout/parts/instance/etc/zope.conf
$parts = explode("_", $servicedesc);
$instance = $parts[sizeof($parts) - 3];
$opt[1] = "--title \"Zope memory For {$hostname} / {$instance}\" ";
#
$def[1] = "" . "DEF:VmPeak={$RRDFILE['1']}:{$DS['1']}:AVERAGE " . "CDEF:VmPeak_mb=VmPeak,1048576,/ " . rrd::area("VmPeak_mb", rrd::color(1), "Peak ", "STACK") . "GPRINT:VmPeak_mb:LAST:\"%8.1lf MB LAST\" " . "GPRINT:VmPeak_mb:AVERAGE:\"%8.1lf MB AVERAGE\" " . "GPRINT:VmPeak_mb:MAX:\"%8.1lf MB MAX\\n\" " . "DEF:VmSize={$RRDFILE['2']}:{$DS['2']}:AVERAGE " . "CDEF:VmSize_mb=VmSize,1048576,/ " . rrd::area("VmSize_mb", rrd::color(2), "Size ", "STACK") . "GPRINT:VmSize_mb:LAST:\"%8.1lf MB LAST\" " . "GPRINT:VmSize_mb:AVERAGE:\"%8.1lf MB AVERAGE\" " . "GPRINT:VmSize_mb:MAX:\"%8.1lf MB MAX\\n\" " . "DEF:VmLck={$RRDFILE['3']}:{$DS['3']}:AVERAGE " . "CDEF:VmLck_mb=VmLck,1048576,/ " . rrd::area("VmLck_mb", rrd::color(3), "Lck ", "STACK") . "GPRINT:VmLck_mb:LAST:\"%8.1lf MB LAST\" " . "GPRINT:VmLck_mb:AVERAGE:\"%8.1lf MB AVERAGE\" " . "GPRINT:VmLck_mb:MAX:\"%8.1lf MB MAX\\n\" " . "DEF:VmHWM={$RRDFILE['4']}:{$DS['4']}:AVERAGE " . "CDEF:VmHWM_mb=VmHWM,1048576,/ " . rrd::area("VmHWM_mb", rrd::color(4), "HWM ", "STACK") . "GPRINT:VmHWM_mb:LAST:\"%8.1lf MB LAST\" " . "GPRINT:VmHWM_mb:AVERAGE:\"%8.1lf MB AVERAGE\" " . "GPRINT:VmHWM_mb:MAX:\"%8.1lf MB MAX\\n\" " . "DEF:VmRSS={$RRDFILE['5']}:{$DS['5']}:AVERAGE " . "CDEF:VmRSS_mb=VmRSS,1048576,/ " . rrd::area("VmRSS_mb", rrd::color(5), "RSS ", "STACK") . "GPRINT:VmRSS_mb:LAST:\"%8.1lf MB LAST\" " . "GPRINT:VmRSS_mb:AVERAGE:\"%8.1lf MB AVERAGE\" " . "GPRINT:VmRSS_mb:MAX:\"%8.1lf MB MAX\\n\" " . "DEF:VmData={$RRDFILE['6']}:{$DS['6']}:AVERAGE " . "CDEF:VmData_mb=VmData,1048576,/ " . rrd::area("VmData_mb", rrd::color(6), "Data ", "STACK") . "GPRINT:VmData_mb:LAST:\"%8.1lf MB\\n\" " . "DEF:VmStk={$RRDFILE['7']}:{$DS['7']}:AVERAGE " . "CDEF:VmStk_mb=VmStk,1048576,/ " . rrd::area("VmStk_mb", rrd::color(7), "Stk ", "STACK") . "GPRINT:VmStk_mb:LAST:\"%8.1lf MB\\n\" " . "DEF:VmExe={$RRDFILE['8']}:{$DS['8']}:AVERAGE " . "CDEF:VmExe_mb=VmExe,1048576,/ " . rrd::area("VmExe_mb", rrd::color(8), "Exe ", "STACK") . "GPRINT:VmExe_mb:LAST:\"%8.1lf MB\\n\" " . "DEF:VmLib={$RRDFILE['9']}:{$DS['9']}:AVERAGE " . "CDEF:VmLib_mb=VmLib,1048576,/ " . rrd::area("VmLib_mb", rrd::color(9), "Lib ", "STACK") . "GPRINT:VmLib_mb:LAST:\"%8.1lf MB\\n\" " . "DEF:VmPTE={$RRDFILE['10']}:{$DS['10']}:AVERAGE " . "CDEF:VmPTE_mb=VmPTE,1048576,/ " . rrd::area("VmPTE_mb", rrd::color(10), "PTE ", "STACK") . "GPRINT:VmPTE_mb:LAST:\"%8.1lf MB\\n\" " . "";
示例15: array
<?php
$_WARNRULE = '#FFFF00';
$_CRITRULE = '#FF0000';
$_AREA = '#256aef';
$_LINE = '#3152A5';
$_MAXRULE = '#000000';
$colors = array("#FF0000", "#336600", "#6600FF", "#FF3300", "#339900", "#6633FF", "#FF6600", "#6600FF", "#6666FF", "#FF9900", "#33FF00", "#6699FF", "#FFCC00", "#33FF33", "#66CCFF", "#FFFF00", "#66CC00", "#66FFFF");
$j = 0;
$opt[1] = '--slope-mode -l0 --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . '"';
$def[1] = '';
# Debugging Code
# throw new Kohana_exception(print_r($this->DS,true));
# sort by ACT (Last) Value. Highest Value goes into Background.
usort($this->DS, function ($a, $b) {
return $b['ACT'] - $a['ACT'];
});
foreach ($this->DS as $KEY => $VAL) {
$def[1] .= rrd::def("var{$KEY}", $this->DS[$KEY]['RRDFILE'], $this->DS[$KEY]['DS'], "AVERAGE");
$def[1] .= rrd::area("var{$KEY}", $colors[$j] . "70", rrd::cut($this->DS[$KEY]["NAME"], 40));
$def[1] .= rrd::line1("var{$KEY}", "#000");
$def[1] .= rrd::gprint("var{$KEY}", array("AVERAGE", "MAX", "LAST"), "%5.0lf");
$j++;
}