当前位置: 首页>>代码示例>>PHP>>正文


PHP rrdtool_escape函数代码示例

本文整理汇总了PHP中rrdtool_escape函数的典型用法代码示例。如果您正苦于以下问题:PHP rrdtool_escape函数的具体用法?PHP rrdtool_escape怎么用?PHP rrdtool_escape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了rrdtool_escape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rrdtool_escape

<?php

$scale_min = '0';
$scale_max = '100';
$ds = 'usage';
// FIXME: As far as I can tell, $descr is never mentioned in includes/graphs/generic_simplex.inc.php -- PDG 2015-11-14
$descr = rrdtool_escape(short_hrDeviceDescr($proc['processor_descr']), 28);
$colour_line = 'cc0000';
$colour_area = 'FFBBBB';
$colour_minmax = 'c5c5c5';
$graph_max = 1;
$unit_text = 'Usage';
require 'includes/graphs/generic_simplex.inc.php';
开发者ID:samyscoub,项目名称:librenms,代码行数:13,代码来源:usage.inc.php

示例2: rrdtool_escape

<?php

$scale_min = '0';
$scale_max = '10';
require 'includes/graphs/common.inc.php';
$rrd_options .= " COMMENT:'                            Min   Max   Last\\n'";
$rrd_options .= " DEF:sensor={$rrd_filename}:sensor:AVERAGE";
$rrd_options .= " LINE1.5:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'], 21) . "'";
$rrd_options .= ' GPRINT:sensor:MIN:%4.1lf';
$rrd_options .= ' GPRINT:sensor:MAX:%4.1lf';
$rrd_options .= ' GPRINT:sensor:LAST:%4.1lf\\\\l';
if (is_numeric($sensor['sensor_limit'])) {
    $rrd_options .= ' HRULE:' . $sensor['sensor_limit'] . '#999999::dashes';
}
if (is_numeric($sensor['sensor_limit_low'])) {
    $rrd_options .= ' HRULE:' . $sensor['sensor_limit_low'] . '#999999::dashes';
}
开发者ID:samyscoub,项目名称:librenms,代码行数:17,代码来源:state.inc.php

示例3: rrdtool_escape

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$scale_min = "0";
$scale_max = "100";
$ds = "usage";
$descr = rrdtool_escape(rewrite_hrDevice($proc['processor_descr']), 28);
$colour_line = "cc0000";
$colour_area = "FFBBBB";
$colour_minmax = "c5c5c5";
$graph_max = 1;
$unit_text = "Usage";
include $config['html_dir'] . "/includes/graphs/generic_simplex.inc.php";
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:23,代码来源:usage.inc.php

示例4: rrdtool_escape

<?php

// Draw generic bits graph
// args: ds_in, ds_out, rrd_filename, bg, legend, from, to, width, height, inverse, previous
include "includes/graphs/common.inc.php";
if ($format == "octets" || $format == "bytes") {
    $units = "Bps";
    $format = "bytes";
    $units_descr = "Bytes/s";
} else {
    $units = "bps";
    $format = "bits";
    $units_descr = "Bits/s";
}
$i = 0;
$units_descr = rrdtool_escape($units_descr, 9);
if (!$noheader) {
    $rrd_options .= " COMMENT:'{$units_descr}  Now      Ave      Max     95th \\n'";
}
if ($rrd_filename) {
    $rrd_filename_out = $rrd_filename;
    $rrd_filename_in = $rrd_filename;
}
if ($inverse) {
    $in = 'out';
    $out = 'in';
} else {
    $in = 'in';
    $out = 'out';
}
if ($multiplier) {
开发者ID:RomanBogachev,项目名称:observium,代码行数:31,代码来源:generic_data.inc.php

示例5: foreach

    $rrd_options .= " COMMENT:'\\l'";
}
$colour_iter = 0;
foreach ($rrd_list as $i => $rrd) {
    if ($rrd['colour']) {
        $colour = $rrd['colour'];
    } else {
        if (!$config['graph_colours'][$colours][$colour_iter]) {
            $colour_iter = 0;
        }
        $colour = $config['graph_colours'][$colours][$colour_iter];
        $colour_iter++;
    }
    $ds = $rrd['ds'];
    $filename = $rrd['filename'];
    $descr = rrdtool_escape($rrd['descr'], $descr_len);
    $id = "ds" . $i;
    $rrd_options .= " DEF:" . $id . "={$filename}:{$ds}:AVERAGE";
    if ($simple_rrd) {
        $rrd_options .= " CDEF:" . $id . "min=" . $id . " ";
        $rrd_options .= " CDEF:" . $id . "max=" . $id . " ";
    } else {
        $rrd_options .= " DEF:" . $id . "min={$filename}:{$ds}:MIN";
        $rrd_options .= " DEF:" . $id . "max={$filename}:{$ds}:MAX";
    }
    if ($rrd['invert']) {
        $rrd_options .= " CDEF:" . $id . "i=" . $id . ",-1,*";
        $rrd_optionsb .= " LINE1.25:" . $id . "i#" . $colour . ":'{$descr}'";
        if (!empty($rrd['areacolour'])) {
            $rrd_optionsb .= " AREA:" . $id . "i#" . $rrd['areacolour'];
        }
开发者ID:RomanBogachev,项目名称:observium,代码行数:31,代码来源:generic_multi_line.inc.php

示例6: rrdtool_escape

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
$ds = "sensor";
$line_text = rrdtool_escape($sensor['sensor_descr'], 22);
$colour_line = "cc0000";
$colour_area = "FFFF99";
$colour_minmax = "c5c5c5";
$scale_min = 0;
$graph_max = 1;
$unit_text = "lux";
$print_min = 1;
include $config['html_dir'] . "/includes/graphs/generic_simplex.inc.php";
if (is_numeric($sensor['sensor_limit'])) {
    $rrd_options .= " HRULE:" . $sensor['sensor_limit'] . "#999999::dashes";
}
if (is_numeric($sensor['sensor_limit_low'])) {
    $rrd_options .= " HRULE:" . $sensor['sensor_limit_low'] . "#999999::dashes";
}
$graph_return['descr'] = 'Illuminance sensor measured in lux.';
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:30,代码来源:illuminance.inc.php

示例7: dbFetchRow

<?php

include "includes/graphs/common.inc.php";
$sla = dbFetchRow("SELECT * FROM `slas` WHERE `sla_id` = ?", array($vars['id']));
$device = device_by_id_cache($sla['device_id']);
#if ($_GET['width'] >= "450") { $descr_len = "48"; } else { $descr_len = "21"; }
$descr_len = intval($_GET['width'] / 8) * 0.8;
$unit_long = 'milliseconds';
$unit = 'ms';
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'" . str_pad($unit_long, $descr_len) . "   Cur      Min     Max\\n'";
#$descr = "";
$descr = $sla['sla_nr'] . " ";
if ($sla['tag']) {
    $descr .= $sla['tag'];
}
if ($sla['owner']) {
    $descr .= " (Owner: " . $sla['owner'] . ")";
}
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("sla-" . $sla['sla_nr'] . ".rrd");
$rrd_options .= " DEF:rtt={$rrd_file}:rtt:AVERAGE ";
$rrd_options .= " VDEF:avg=rtt,AVERAGE ";
$rrd_options .= " LINE1:avg#CCCCFF:'" . str_pad('Average', $descr_len - 3) . "':dashes";
$rrd_options .= " GPRINT:rtt:AVERAGE:%4.1lf" . $unit . "\\\\l ";
$rrd_options .= " LINE1:rtt#CC0000:'" . rrdtool_escape($descr) . "'";
$rrd_options .= " GPRINT:rtt:LAST:%4.1lf" . $unit . " ";
$rrd_options .= " GPRINT:rtt:MIN:%4.1lf" . $unit . " ";
$rrd_options .= " GPRINT:rtt:MAX:%4.1lf" . $unit . "\\\\l ";
开发者ID:RomanBogachev,项目名称:observium,代码行数:28,代码来源:sla.inc.php

示例8: rrdtool_escape

        $pings_options .= ",p" . $i . "p" . $p . ",UN,+";
        $m_options .= ",p" . $i . "p" . $p . ",+";
        $sdev_options .= ",p" . $i . "p" . $p . ",m" . $i . ",-,DUP,*,+";
    }
    $rrd_options .= " CDEF:pings" . $i . "=" . $pings . ",p" . $i . "p1,UN" . $pings_options . ",-";
    $rrd_options .= " CDEF:m" . $i . "=p" . $i . "p1" . $m_options . ",pings" . $i . ",/";
    $rrd_options .= " CDEF:sdev" . $i . "=p" . $i . "p1,m" . $i . ",-,DUP,*" . $sdev_options . ",pings" . $i . ",/,SQRT";
    // end emulate Smokeping::calc_stddev
    $rrd_options .= " CDEF:dmlow{$i}=dm{$i},sdev{$i},2,/,-";
    $rrd_options .= " CDEF:s2d{$i}=sdev{$i}";
    $dm_list .= ",dm{$i},+";
    $sd_list .= ",s2d{$i},+";
    $ploss_list .= ",ploss{$i},+";
    $i++;
}
$descr = rrdtool_escape("Average", $descr_len);
$rrd_options .= " CDEF:ploss_all=0" . $ploss_list . ",{$i},/";
$rrd_options .= " CDEF:dm_all=0" . $dm_list . ",{$i},/";
#  $rrd_options .= " CDEF:dm_all_clean=dm_all,UN,NaN,dm_all,IF";
$rrd_options .= " CDEF:sd_all=0" . $sd_list . ",{$i},/";
$rrd_options .= " CDEF:dmlow_all=dm_all,sd_all,2,/,-";
$rrd_options .= " AREA:dmlow_all";
$rrd_options .= " AREA:sd_all#AAAAAA::STACK";
$rrd_options .= " LINE1:dm_all#CC0000:'{$descr}'";
$rrd_options .= " VDEF:avmed=dm_all,AVERAGE";
$rrd_options .= " VDEF:avsd=sd_all,AVERAGE";
$rrd_options .= " CDEF:msr=dm_all,POP,avmed,avsd,/";
$rrd_options .= " VDEF:avmsr=msr,AVERAGE";
$rrd_options .= " GPRINT:avmed:'%5.1lf%ss'";
$rrd_options .= " GPRINT:ploss_all:AVERAGE:'%5.1lf%%'";
$rrd_options .= " GPRINT:avsd:'%5.1lf%Ss'";
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:smokeping_all_common_avg.inc.php

示例9: elseif

    } elseif (is_numeric($divider)) {
        $g_defname = $rrd['ds'] . "_cdef";
        $rrd_options .= " CDEF:" . $g_defname . $i . "=" . $rrd['ds'] . $i . "," . $divider . ",/";
        $rrd_options .= " CDEF:" . $g_defname . $i . "min=" . $rrd['ds'] . $i . "min," . $divider . ",/";
        $rrd_options .= " CDEF:" . $g_defname . $i . "max=" . $rrd['ds'] . $i . "max," . $divider . ",/";
    }
    // Are our text values related to the multiplier/divisor or not?
    if (isset($text_orig) && $text_orig) {
        $t_defname = $rrd['ds'];
    } else {
        $t_defname = $g_defname;
    }
    $rrd_options .= " AREA:" . $g_defname . $i . "#" . $colour . ":'" . rrdtool_escape($rrd['descr'], $descr_len) . "':{$stack}";
    $rrd_options .= " GPRINT:" . $t_defname . $i . ":LAST:%5.1lf%s GPRINT:" . $t_defname . $i . "min:MIN:%5.1lf%s";
    $rrd_options .= " GPRINT:" . $t_defname . $i . "max:MAX:%5.1lf%s GPRINT:" . $t_defname . $i . ":AVERAGE:%5.1lf%s";
    if (!$nototal) {
        $rrd_options .= " GPRINT:tot" . $rrd['ds'] . $i . ":%5.2lf%s" . rrdtool_escape($total_units) . "";
    }
    $rrd_options .= "'\\n' COMMENT:'\\n'";
}
if ($_GET['previous'] == "yes") {
    if (is_numeric($multiplier)) {
        $rrd_options .= " CDEF:X=" . $thingX . $plusesX . "," . $multiplier . ",*";
    } elseif (is_numeric($divider)) {
        $rrd_options .= " CDEF:X=" . $thingX . $plusesX . "," . $divider . ",/";
    } else {
        $rrd_options .= " CDEF:X=" . $thingX . $plusesX;
    }
    $rrd_options .= " AREA:X#99999999:";
    $rrd_options .= " LINE1.25:X#666666:";
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:31,代码来源:generic_multi_simplex_seperated.inc.php

示例10: rrdtool_escape

        $m_options .= ',p' . $i . 'p' . $p . ',+';
        $sdev_options .= ',p' . $i . 'p' . $p . ',m' . $i . ',-,DUP,*,+';
    }
    $rrd_options .= ' CDEF:pings' . $i . '=' . $pings . ',p' . $i . 'p1,UN' . $pings_options . ',-';
    $rrd_options .= ' CDEF:m' . $i . '=p' . $i . 'p1' . $m_options . ',pings' . $i . ',/';
    $rrd_options .= ' CDEF:sdev' . $i . '=p' . $i . 'p1,m' . $i . ',-,DUP,*' . $sdev_options . ',pings' . $i . ',/,SQRT';
    // end emulate Smokeping::calc_stddev
    $rrd_options .= " CDEF:dmlow{$i}=dm{$i},sdev{$i},2,/,-";
    $rrd_options .= " CDEF:s2d{$i}=sdev{$i}";
    $dm_list .= ",dm{$i},+";
    $sd_list .= ",s2d{$i},+";
    $ploss_list .= ",ploss{$i},+";
    $i++;
}
//end foreach
$descr = rrdtool_escape('Average', $descr_len);
$rrd_options .= ' CDEF:ploss_all=0' . $ploss_list . ",{$i},/";
$rrd_options .= ' CDEF:dm_all=0' . $dm_list . ",{$i},/";
// $rrd_options .= " CDEF:dm_all_clean=dm_all,UN,NaN,dm_all,IF";
$rrd_options .= ' CDEF:sd_all=0' . $sd_list . ",{$i},/";
$rrd_options .= ' CDEF:dmlow_all=dm_all,sd_all,2,/,-';
$rrd_options .= ' AREA:dmlow_all';
$rrd_options .= ' AREA:sd_all#AAAAAA::STACK';
$rrd_options .= " LINE1:dm_all#CC0000:'{$descr}'";
$rrd_options .= ' VDEF:avmed=dm_all,AVERAGE';
$rrd_options .= ' VDEF:avsd=sd_all,AVERAGE';
$rrd_options .= ' CDEF:msr=dm_all,POP,avmed,avsd,/';
$rrd_options .= ' VDEF:avmsr=msr,AVERAGE';
$rrd_options .= " GPRINT:avmed:'%5.1lf%ss'";
$rrd_options .= " GPRINT:ploss_all:AVERAGE:'%5.1lf%%'";
$rrd_options .= " GPRINT:avsd:'%5.1lf%Ss'";
开发者ID:n-st,项目名称:librenms,代码行数:31,代码来源:smokeping_all_common_avg.inc.php

示例11: dbFetchRow

<?php

include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$colour = "CC0000";
$colour_area = "ffaaaa";
$sql = "SELECT * FROM `applications-state` WHERE `application_id` = ?";
$app_state = dbFetchRow($sql, array($app['app_id']));
$app_data = unserialize($app_state['app_state']);
$descr = rrdtool_escape($app['app_instance'], $descr_len);
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/wmi-app-mssql_" . $app['app_instance'] . "-cpu.rrd";
$rrd_options .= " -u 100 -l 0 ";
$rrd_options .= " COMMENT:'Usage       Current     Average    Maximum\\n'";
$rrd_options .= " DEF:proc=" . $rrd_filename . ":percproctime:LAST ";
$rrd_options .= " DEF:lastpoll=" . $rrd_filename . ":lastpoll:LAST ";
$rrd_options .= " CDEF:usage=proc,lastpoll,/,100,* ";
$rrd_options .= " 'AREA:usage#ea8f00:   '";
$rrd_options .= " GPRINT:usage:LAST:'     %5.2lf%%'";
$rrd_options .= " GPRINT:usage:AVERAGE:'   %5.2lf%%'";
$rrd_options .= " GPRINT:usage:MAX:'   %5.2lf%%\\n'";
// EOF
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:20,代码来源:mssql_cpu_usage.inc.php

示例12: graph_from_definition

function graph_from_definition($vars, $type, $subtype, $device)
{
    global $config, $graph_defs;
    $graph_def = $graph_defs[$type][$subtype];
    include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
    // Here we scale the number of numerical columns shown to make sure we keep the text.
    if ($width > 600) {
        $data_show = array('lst', 'avg', 'min', 'max', 'tot');
    } elseif ($width > 400) {
        $data_show = array('lst', 'avg', 'max', 'tot');
    } elseif ($width > 300) {
        $data_show = array('lst', 'avg', 'max', 'tot');
    } else {
        $data_show = array('lst', 'avg', 'max');
    }
    // Drop total from view if requested not to show
    if ($args['nototal'] || $nototal) {
        if (($key = array_search('tot', $data_show)) !== FALSE) {
            unset($data_show[$key]);
        }
    }
    $data_len = count($data_show) * 8;
    // Here we scale the length of the description to make sure we keep the numbers
    if ($width > 600) {
        $descr_len = 40;
    } elseif ($width > 300) {
        $descr_len = floor(($width + 42) / 8) - $data_len;
    } else {
        $descr_len = floor(($width + 42) / 7) - $data_len;
    }
    // Build the legend headers using the length values previously calculated
    if (!isset($unit_text)) {
        if ($format == "octets" || $format == "bytes") {
            $units = "Bps";
            $format = "bytes";
            $unit_text = "Bytes/s";
        } else {
            $units = "bps";
            $format = "bits";
            $unit_text = "Bits/s";
        }
    }
    if ($legend != 'no') {
        $rrd_options .= " COMMENT:'" . rrdtool_escape($unit_text, $descr_len) . "'";
        if (in_array("lst", $data_show)) {
            $rrd_options .= " COMMENT:'   Now'";
        }
        if (in_array("avg", $data_show)) {
            $rrd_options .= " COMMENT:'    Avg'";
        }
        if (in_array("min", $data_show)) {
            $rrd_options .= " COMMENT:'    Min'";
        }
        if (in_array("max", $data_show)) {
            $rrd_options .= " COMMENT:'    Max'";
        }
        if (in_array("tot", $data_show)) {
            $rrd_options .= " COMMENT:'  Total'";
        }
        $rrd_options .= " COMMENT:'\\l'";
    }
    foreach ($graph_def['ds'] as $ds_name => $ds) {
        if (!isset($ds['file'])) {
            $ds['file'] = $graph_def['file'];
        }
        if (!isset($ds['draw'])) {
            $ds['draw'] = "LINE1.5";
        }
        $ds['file'] = get_rrd_path($device, $ds['file']);
        $cmd_def .= " DEF:" . $ds_name . "=" . $ds['file'] . ":" . $ds_name . ":AVERAGE";
        $cmd_def .= " DEF:" . $ds_name . "_min=" . $ds['file'] . ":" . $ds_name . ":MIN";
        $cmd_def .= " DEF:" . $ds_name . "_max=" . $ds['file'] . ":" . $ds_name . ":MAX";
        if (!empty($ds['cdef'])) {
            $ds_name = $ds_name . "_c";
            $cmd_cdef .= " CDEF:" . $ds_name . "=" . $ds['cdef'] . "";
            $cmd_cdef .= " CDEF:" . $ds_name . "_min=" . $ds['cdef'] . "";
            $cmd_cdef .= " CDEF:" . $ds_name . "_max=" . $ds['cdef'] . "";
        }
        if ($ds['ds_graph'] != "yes") {
            if (empty($ds['colour'])) {
                if (!$config['graph_colours'][$graph_def['colours']][$c_i]) {
                    $c_i = 0;
                }
                $colour = $config['graph_colours'][$graph_def['colours']][$c_i];
                $c_i++;
            } else {
                $colour = $ds['colour'];
            }
            $descr = rrdtool_escape($ds['label'], $descr_len);
            if ($ds['draw'] == "AREASTACK") {
                if ($i == 0) {
                    $ds['ds_draw'] = "AREA";
                } else {
                    $ds['ds_draw'] = "STACK";
                }
            } elseif (preg_match("/^LINESTACK([0-9\\.]*)/", $ds['ds_draw'], $m)) {
                if ($i == 0) {
                    $data['ds_draw'] = "LINE{$m['1']}";
                } else {
                    $ds['draw'] = "STACK";
//.........这里部分代码省略.........
开发者ID:skive,项目名称:observium,代码行数:101,代码来源:functions.inc.php

示例13: round

$iter = "1";
$colour = "CC0000";
$colour_area = "ffaaaa";
if ($width > "500") {
    $descr_len = 13;
} else {
    $descr_len = 8;
    $descr_len += round(($width - 250) / 8);
}
if ($width > "500") {
    $rrd_options .= " COMMENT:'" . substr(str_pad($unit_text, $descr_len + 5), 0, $descr_len + 5) . "Total      Used      Free(    Min       Max      Avg)'";
    $rrd_options .= " COMMENT:'\\l'";
} else {
    $rrd_options .= " COMMENT:'" . substr(str_pad($unit_text, $descr_len + 5), 0, $descr_len + 5) . "Total      Used      Free\\l'";
}
$descr = rrdtool_escape(rewrite_hrDevice($mempool['mempool_descr']), $descr_len);
$perc = round($mempool['mempool_perc'], 0);
$background = get_percentage_colours($perc);
$rrd_options .= " DEF:" . $mempool['mempool_id'] . "used={$rrd_filename}:used:AVERAGE";
$rrd_options .= " DEF:" . $mempool['mempool_id'] . "free={$rrd_filename}:free:AVERAGE";
$rrd_options .= " CDEF:" . $mempool['mempool_id'] . "size=" . $mempool['mempool_id'] . "used," . $mempool['mempool_id'] . "free,+";
$rrd_options .= " CDEF:" . $mempool['mempool_id'] . "perc=" . $mempool['mempool_id'] . "used," . $mempool['mempool_id'] . "size,/,100,*";
$rrd_options .= " CDEF:" . $mempool['mempool_id'] . "percx=100," . $mempool['mempool_id'] . "perc,-";
$rrd_options .= " AREA:" . $mempool['mempool_id'] . "perc#" . $background['right'] . ":";
if ($width > "500") {
    $rrd_options .= " LINE1.25:" . $mempool['mempool_id'] . "perc#" . $background['left'] . ":'{$descr}'";
    $rrd_options .= " GPRINT:" . $mempool['mempool_id'] . "size:LAST:%6.2lf%sB";
    $rrd_options .= " GPRINT:" . $mempool['mempool_id'] . "used:LAST:%6.2lf%sB";
    $rrd_options .= " GPRINT:" . $mempool['mempool_id'] . "free:LAST:%6.2lf%sB";
    $rrd_options .= " GPRINT:" . $mempool['mempool_id'] . "free:MIN:%5.2lf%sB";
    $rrd_options .= " GPRINT:" . $mempool['mempool_id'] . "free:MAX:%5.2lf%sB";
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:usage.inc.php

示例14: array

<?php

include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$iter = "1";
$rrd_options .= " COMMENT:'Imaging Drum level     Cur     Min      Max\\n'";
$drums = array('Cyan' => 'c', 'Magenta' => 'm', 'Yellow' => 'y', 'Black' => 'k');
foreach ($drums as $drum => $letter) {
    $descr = rrdtool_escape("{$drum} Drum", 16);
    $colour = toner2colour($descr);
    $hostname = gethostbyid($device['device_id']);
    $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("drum-{$letter}.rrd");
    $rrd_options .= " DEF:drum{$iter}={$rrd_filename}:drum:AVERAGE";
    $rrd_options .= " LINE2:drum{$iter}#" . $colour['left'] . ":'" . $descr . "'";
    $rrd_options .= " GPRINT:drum{$iter}:LAST:'%5.0lf%%'";
    $rrd_options .= " GPRINT:drum{$iter}:MIN:'%5.0lf%%'";
    $rrd_options .= " GPRINT:drum{$iter}:MAX:%5.0lf%%\\\\l";
    $iter++;
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:19,代码来源:imagingdrums.inc.php

示例15: unset

            case "3":
                $colour['left'] = "4096EE";
                break;
            case "4":
                $colour['left'] = "73880A";
                break;
            case "5":
                $colour['left'] = "D01F3C";
                break;
            case "6":
                $colour['left'] = "36393D";
                break;
            case "7":
            default:
                $colour['left'] = "FF0000";
                unset($iter);
                break;
        }
    }
    $hostname = gethostbyid($toner['device_id']);
    $descr = rrdtool_escape($toner['toner_descr'], 16);
    $rrd_filename = get_rrd_path($device, "toner-" . $toner['toner_index'] . ".rrd");
    $toner_id = $toner['toner_id'];
    $rrd_options .= " DEF:toner{$toner_id}={$rrd_filename}:toner:AVERAGE";
    $rrd_options .= " LINE2:toner{$toner_id}#" . $colour['left'] . ":'" . $descr . "'";
    $rrd_options .= " GPRINT:toner{$toner_id}:LAST:'%5.0lf%%'";
    $rrd_options .= " GPRINT:toner{$toner_id}:MIN:'%5.0lf%%'";
    $rrd_options .= " GPRINT:toner{$toner_id}:MAX:%5.0lf%%\\\\l";
    $iter++;
}
// EOF
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:toner.inc.php


注:本文中的rrdtool_escape函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。