本文整理汇总了PHP中rrd::ticker方法的典型用法代码示例。如果您正苦于以下问题:PHP rrd::ticker方法的具体用法?PHP rrd::ticker怎么用?PHP rrd::ticker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rrd
的用法示例。
在下文中一共展示了rrd::ticker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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];
$DS_status = $this->DS[1];
$opt[1] = "-l0 --title \"{$hostname} / Openoffice server\" ";
$def[1] = rrd::def("var1", $DS_time['RRDFILE'], $DS_time['DS']);
$def[1] .= rrd::def("var2", $DS_status['RRDFILE'], $DS_status['DS']);
$def[1] .= rrd::gradient("var1", "#00FFFF", "#0000FF", "Time");
$def[1] .= rrd::gprint("var1", array("LAST", "AVERAGE", "MIN", "MAX"), "%4.2lfs");
$def[1] .= rrd::ticker("var2", 2, 1, -0.05, "ff", "#00ff00", "#ff8c00", "#ff0000");
示例2: 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");
}