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


PHP get_rrd_path函数代码示例

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


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

示例1: round

include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
if ($width > 500) {
    $descr_len = 22;
} else {
    $descr_len = 12;
}
$descr_len += round(($width - 250) / 8);
$iter = 0;
$colours = 'mixed';
$rrd_options .= " COMMENT:'" . str_pad('Size      Used    %used', $descr_len + 31, ' ', STR_PAD_LEFT) . "\\l'";
//$rrd_options .= " COMMENT:'                    Size      Used    %age\\l'";
foreach (dbFetchRows("SELECT * FROM storage where device_id = ?", array($device['device_id'])) as $storage) {
    if (!$config['graph_colours'][$colours][$iter]) {
        $iter = 0;
    }
    $colour = $config['graph_colours'][$colours][$iter];
    $descr = rrdtool_escape($storage['storage_descr'], $descr_len);
    $rrd = get_rrd_path($device, "storage-" . $storage['storage_mib'] . "-" . $storage['storage_descr'] . ".rrd");
    if (is_file($rrd)) {
        $rrd_options .= " DEF:" . $storage['storage_id'] . "used={$rrd}:used:AVERAGE";
        $rrd_options .= " DEF:" . $storage['storage_id'] . "free={$rrd}:free:AVERAGE";
        $rrd_options .= " CDEF:" . $storage['storage_id'] . "size=" . $storage['storage_id'] . "used," . $storage['storage_id'] . "free,+";
        $rrd_options .= " CDEF:" . $storage['storage_id'] . "perc=" . $storage['storage_id'] . "used," . $storage['storage_id'] . "size,/,100,*";
        $rrd_options .= " LINE1.25:" . $storage['storage_id'] . "perc#" . $colour . ":'{$descr}'";
        $rrd_options .= " GPRINT:" . $storage['storage_id'] . "size:LAST:%6.2lf%sB";
        $rrd_options .= " GPRINT:" . $storage['storage_id'] . "used:LAST:%6.2lf%sB";
        $rrd_options .= " GPRINT:" . $storage['storage_id'] . "perc:LAST:%5.2lf%%\\\\l";
        $iter++;
    }
}
// EOF
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:storage.inc.php

示例2: get_rrd_path

/*
  DS:corebadURIsrcvd:COUNTER:600:0:125000000000 \
  DS:corebadmsghdr:COUNTER:600:0:125000000000 \
  DS:coredropreplies:COUNTER:600:0:125000000000 \
  DS:coredroprequests:COUNTER:600:0:125000000000 \
  DS:coreerrreplies:COUNTER:600:0:125000000000 \
  DS:coreerrrequests:COUNTER:600:0:125000000000 \
  DS:corefwdreplies:COUNTER:600:0:125000000000 \
  DS:corefwdrequests:COUNTER:600:0:125000000000 \
  DS:corercvreplies:COUNTER:600:0:125000000000 \
  DS:corercvrequests:COUNTER:600:0:125000000000 \
  DS:coreunsupportedmeth:COUNTER:600:0:125000000000 \
*/
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$rrd_filename = get_rrd_path($device, "app-kamailio-" . $app['app_id'] . ".rrd");
$array = array('corebadURIsrcvd' => array('descr' => 'Bad URIs Recieved'), 'corebadmsghdr' => array('descr' => 'Bad Msg Header'), 'coredropreplies' => array('descr' => 'Dropped Replies'), 'coredroprequests' => array('descr' => 'Drop Requests'), 'coreerrreplies' => array('descr' => 'Error Replies'), 'coreerrrequests' => array('descr' => 'Error Requests'), 'corefwdreplies' => array('descr' => 'Forward Replies'), 'corefwdrequests' => array('descr' => 'Forward Requests'), 'corercvrequests' => array('descr' => 'Recieved Replies'), 'corercvreplies' => array('descr' => 'Recieved Requests'), 'coreunsupportedmeth' => array('descr' => 'Unsupported Methods'));
$i = 0;
if (is_file($rrd_filename)) {
    foreach ($array as $ds => $data) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $data['descr'];
        $rrd_list[$i]['ds'] = $ds;
        $i++;
    }
} else {
    echo "file missing: {$file}";
}
$colours = "mixed";
include $config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:30,代码来源:kamailio_core.inc.php

示例3: get_rrd_path

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$scale_min = 0;
$colours = "mixed";
$nototal = $width < 224 ? 1 : 0;
$unit_text = "MThreads";
$rrd_filename = get_rrd_path($device, "app-powerdns-recursor-" . $app['app_id'] . ".rrd");
$array = array('concurrentQueries' => array('descr' => 'Concurrent queries', 'colour' => '0000FFFF'));
$i = 0;
if (is_file($rrd_filename)) {
    foreach ($array as $ds => $data) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $data['descr'];
        $rrd_list[$i]['ds'] = $ds;
        $rrd_list[$i]['colour'] = $data['colour'];
        $i++;
    }
} else {
    echo "file missing: {$file}";
}
include $config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:powerdns-recursor_load.inc.php

示例4: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$radio1 = get_rrd_path($device, "wificlients-radio1.rrd");
$radio2 = get_rrd_path($device, "wificlients-radio2.rrd");
if (file_exists($radio1)) {
    $rrd_options .= " COMMENT:'                           Cur   Min  Max\\n'";
    $rrd_options .= " DEF:wificlients1=" . $radio1 . ":wificlients:AVERAGE ";
    $rrd_options .= " LINE1:wificlients1#CC0000:'Clients on Radio1    ' ";
    $rrd_options .= " GPRINT:wificlients1:LAST:%3.0lf ";
    $rrd_options .= " GPRINT:wificlients1:MIN:%3.0lf ";
    $rrd_options .= " GPRINT:wificlients1:MAX:%3.0lf\\\\l ";
    if (file_exists($radio2)) {
        $rrd_options .= " DEF:wificlients2=" . $radio2 . ":wificlients:AVERAGE ";
        $rrd_options .= " LINE1:wificlients2#008C00:'Clients on Radio2    ' ";
        $rrd_options .= " GPRINT:wificlients2:LAST:%3.0lf ";
        $rrd_options .= " GPRINT:wificlients2:MIN:%3.0lf ";
        $rrd_options .= " GPRINT:wificlients2:MAX:%3.0lf\\\\l ";
    }
}
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:wifi_clients.inc.php

示例5: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$colours = "mixed";
$nototal = 1;
$unit_text = "Download Tasks Queued";
$rrd_filename = get_rrd_path($device, "wmi-app-exchange-oab.rrd");
if (is_file($rrd_filename)) {
    $rrd_list[0]['filename'] = $rrd_filename;
    $rrd_list[0]['descr'] = "Download Tasks Queued";
    $rrd_list[0]['ds'] = "dltasksqueued";
} else {
    echo "file missing: {$file}";
}
include "includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:skive,项目名称:observium,代码行数:26,代码来源:exchange_oab_dlq.inc.php

示例6: get_rrd_path

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
//$scale_min = 0;
$colours = "mixed";
$nototal = 0;
$unit_text = "Errors";
$rrd_filename = get_rrd_path($device, "netscaler-stats-tcp.rrd");
$log_y = TRUE;
$array = array('TotZomPsHalfCloseCl' => array('descr' => 'TotZomPsHalfCloseCl'), 'TotZomPsHalfCloseSr' => array('descr' => 'TotZomPsHalfCloseSr'));
if (is_file($rrd_filename)) {
    foreach ($array as $ds => $data) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $data['descr'];
        $rrd_list[$i]['ds'] = $ds;
        $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
        $i++;
    }
} else {
    echo "file missing: {$file}";
}
include "includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:skive,项目名称:observium,代码行数:30,代码来源:netscaler_conn_zombie_packets.inc.php

示例7: dbFetchRows

} else {
    $rows = dbFetchRows("SELECT * FROM `printersupplies` where `device_id` = ?", array($device['device_id']));
}
foreach ($rows as $supply) {
    // If colour was supplied by the device, pass it to the function, otherwise pass the description
    // and have the function try and figure it out from there.
    if ($supply['supply_colour'] != '') {
        $colour = toner_to_colour($supply['supply_colour'], $perc);
    } else {
        $colour = toner_to_colour($supply['supply_descr'], $perc);
    }
    // If no colour found by the toner to colour function, get one from the configured palette.
    if (!$colour['found']) {
        if (!$config['graph_colours'][$colours][$iter]) {
            $iter = 0;
        }
        $colour['left'] = $config['graph_colours'][$colours][$iter];
    }
    $hostname = get_device_by_device_id($supply['device_id']);
    $descr = rrdtool_escape($supply['supply_descr'], 16);
    $rrd_filename = get_rrd_path($device, "toner-" . $supply['supply_index'] . ".rrd");
    $supply_id = $supply['supply_id'];
    $rrd_options .= " DEF:level{$supply_id}={$rrd_filename}:level:AVERAGE";
    $rrd_options .= " LINE2:level{$supply_id}#" . $colour['left'] . ":'" . $descr . "'";
    $rrd_options .= " GPRINT:level{$supply_id}:LAST:'%5.0lf%%'";
    $rrd_options .= " GPRINT:level{$supply_id}:MIN:'%5.0lf%%'";
    $rrd_options .= " GPRINT:level{$supply_id}:MAX:%5.0lf%%\\l";
    $iter++;
    $colour['left'] = NULL;
}
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:printersupplies.inc.php

示例8: get_rrd_path

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$colours = "mixed";
$nototal = $width < 224 ? 1 : 0;
$unit_text = "Count";
$rrd_filename = get_rrd_path($device, "app-bind-" . $app['app_id'] . "-resolver-default.rrd");
$array = array('EDNS0Fail' => array('descr' => "EDNS(0) query failures", 'colour' => '87cefa'), 'Mismatch' => array('descr' => "Mismatch responses received", 'colour' => '00bfff'), 'Truncated' => array('descr' => "Truncated responses received", 'colour' => 'ff69b4'), 'Lame' => array('descr' => "Lame delegations received", 'colour' => 'ff1493'), 'Retry' => array('descr' => "Retried queries", 'colour' => 'ffa07a'), 'QueryAbort' => array('descr' => "Aborted due to quota", 'colour' => 'ff6533'), 'QuerySockFail' => array('descr' => "Socket errors", 'colour' => 'ff8c00'), 'QueryTimeout' => array('descr' => "Timeouts", 'colour' => 'ff0000'));
$i = 0;
if (is_file($rrd_filename)) {
    foreach ($array as $ds => $data) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $data['descr'];
        $rrd_list[$i]['ds'] = $ds;
        $rrd_list[$i]['colour'] = $data['colour'];
        $i++;
    }
} else {
    echo "file missing: {$file}";
}
include $config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:30,代码来源:bind_resolv_errors.inc.php

示例9: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$nototal = 1;
$ds_in = "packets_recv";
$ds_out = "packets_sent";
$graph_title .= "::packets";
$unit_text = "Packets";
$colour_line_in = "330033";
$colour_line_out = "FF6600";
$colour_area_in = "AA66AA";
$colour_area_out = "FFDD88";
$colour_area_in_max = "CC88CC";
$colour_area_out_max = "FFEFAA";
$ntpdserver_rrd = get_rrd_path($device, "app-ntpd-server-" . $app['app_id'] . ".rrd");
if (is_file($ntpdserver_rrd)) {
    $rrd_filename = $ntpdserver_rrd;
}
//    include("includes/graphs/generic_bits.inc.php");
include "includes/graphs/generic_duplex.inc.php";
开发者ID:skive,项目名称:observium,代码行数:29,代码来源:ntpd_bits.inc.php

示例10: foreach

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
// Generate a list of vsvrs and build an rrd_list array using arguments passed from parent
foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id'])) as $vsvr) {
    $rrd_filename = get_rrd_path($device, "netscaler-vsvr-" . $vsvr['vsvr_name'] . ".rrd");
    if (is_file($rrd_filename)) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $vsvr['vsvr_name'];
        $rrd_list[$i]['descr_in'] = $vsvr['vsvr_name'];
        $rrd_list[$i]['descr_out'] = $vsvr['vsvr_ip'] . ":" . $vsvr['vsvr_port'];
        $rrd_list[$i]['ds_in'] = $ds_in;
        $rrd_list[$i]['ds_out'] = $ds_out;
        $i++;
    }
    unset($ignore);
}
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:27,代码来源:netscalervsvr.inc.php

示例11: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$rrd_filename = get_rrd_path($device, "juniperive_storage.rrd");
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = "Disk";
$rrd_list[0]['ds'] = "diskpercent";
$rrd_list[1]['filename'] = $rrd_filename;
$rrd_list[1]['descr'] = "Log";
$rrd_list[1]['ds'] = "logpercent";
if ($_GET['debug']) {
    print_vars($rrd_list);
}
$colours = "juniperive";
$unit_text = "Storage %";
$units = '%';
$total_units = '%';
$scale_min = "0";
$scale_max = "100";
$nototal = 1;
include "includes/graphs/generic_multi_line.inc.php";
开发者ID:skive,项目名称:observium,代码行数:30,代码来源:juniperive_storage.inc.php

示例12: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$rrd_filename = get_rrd_path($device, 'netapp_stats.rrd');
$rrd_exists = is_file($rrd_filename);
$count = 0;
foreach (array('iscsi', 'nfs', 'cifs', 'http', 'fcp') as $stat) {
    if (!$rrd_exists) {
        continue;
    }
    $rrd_list[$count]['filename'] = $rrd_filename;
    $rrd_list[$count]['descr'] = nicecase($stat);
    $rrd_list[$count]['ds'] = $stat . '_ops';
    $count++;
}
$unit_text = 'Operations/s';
$colours = 'mixed';
$units = '';
$total_units = '';
$scale_min = '0';
$scale_max = '100';
$divider = $count;
开发者ID:rhizalpatrax64bit,项目名称:StacksNetwork,代码行数:31,代码来源:netapp_ops.inc.php

示例13: list

     case 'prefixes_ipv6multicast':
         list(, $afisafi) = explode("_", $vars['view']);
         if (isset($peer['afisafi'][$afisafi])) {
             $peer['graph'] = 1;
         }
         // FIXME no break??
     // FIXME no break??
     case 'updates':
         $graph_array['type'] = "bgp_" . $vars['view'];
         $graph_array['id'] = $peer['bgpPeer_id'];
 }
 switch ($vars['view']) {
     case 'macaccounting_bits':
     case 'macaccounting_pkts':
         $acc = dbFetchRow("SELECT * FROM `mac_accounting` AS M\n                        LEFT JOIN `ip_mac`   AS I ON M.mac = I.mac_address\n                        LEFT JOIN `ports`    AS P ON P.port_id = M.port_id\n                        LEFT JOIN `devices`  AS D ON D.device_id = P.device_id\n                        WHERE I.ip_address = ?", array($peer['bgpPeerRemoteAddr']));
         $database = get_rrd_path($device, "cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd");
         if (is_array($acc) && is_file($database)) {
             $peer['graph'] = 1;
             $graph_array['id'] = $acc['ma_id'];
             $graph_array['type'] = $vars['view'];
         }
 }
 if ($vars['view'] == 'updates') {
     $peer['graph'] = 1;
 }
 if ($graphs == 1) {
     echo '<tr><td colspan="8">';
     if ($peer['graph']) {
         $graph_array['to'] = $config['time']['now'];
         print_graph_row($graph_array);
     }
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:bgp.inc.php

示例14: get_rrd_path

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$colours = "mixed";
$nototal = $width < 224 ? 1 : 0;
$unit_text = "Blocks";
$rrd_filename = get_rrd_path($device, "app-postgresql-" . $app['app_id'] . ".rrd");
$array = array('blks_read' => array('descr' => 'Read'), 'blks_hit' => array('descr' => 'Hit'));
$i = 0;
if (is_file($rrd_filename)) {
    foreach ($array as $ds => $data) {
        $rrd_list[$i]['filename'] = $rrd_filename;
        $rrd_list[$i]['descr'] = $data['descr'];
        $rrd_list[$i]['ds'] = $ds;
        $rrd_list[$i]['colour'] = $config['graph_colours'][$colours][$i];
        $i++;
    }
} else {
    echo "file missing: {$file}";
}
include $config['html_dir'] . "/includes/graphs/generic_multi_line.inc.php";
// EOF
开发者ID:Natolumin,项目名称:observium,代码行数:30,代码来源:postgresql_blks.inc.php

示例15: get_rrd_path

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage graphs
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
$scale_min = "0";
include_once $config['html_dir'] . "/includes/graphs/common.inc.php";
$rrd = get_rrd_path($device, "fdb_count.rrd");
if (is_file($rrd)) {
    $rrd_filename = $rrd;
}
$ds = 'value';
$colour_area = 'EEEEEE';
$colour_line = '36393D';
$colour_area_max = 'FFEE99';
$unit_text = 'MACs';
$unit_integer = TRUE;
$line_text = 'Count';
include_once 'includes/graphs/generic_simplex.inc.php';
//$rrd_options .= " DEF:value=$rrd_filename:fdb:AVERAGE";
//$rrd_options .= " DEF:value_min=$rrd_filename:fdb:MIN";
//$rrd_options .= " DEF:value_max=$rrd_filename:fdb:MAX";
//
//$rrd_options .= " COMMENT:'MACs      Current  Minimum  Maximum  Average\\n'";
开发者ID:skive,项目名称:observium,代码行数:31,代码来源:fdb_count.inc.php


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