本文整理汇总了PHP中rrd_name函数的典型用法代码示例。如果您正苦于以下问题:PHP rrd_name函数的具体用法?PHP rrd_name怎么用?PHP rrd_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rrd_name函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rrd_name
<?php
$rrd_filename = rrd_name($device['hostname'], 'cipsec_flow');
$ds_in = 'InPkts';
$ds_out = 'OutPkts';
$colour_area_in = 'AA66AA';
$colour_line_in = '330033';
$colour_area_out = 'FFDD88';
$colour_line_out = 'FF6600';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
$graph_max = 1;
$unit_text = 'Pkts ';
require 'includes/graphs/generic_duplex.inc.php';
示例2: dbFetchRow
<?php
if ($_GET['id'] && is_numeric($_GET['id'])) {
$atm_vp_id = $_GET['id'];
}
$vp = dbFetchRow('SELECT * FROM `juniAtmVp` as J, `ports` AS I, `devices` AS D WHERE J.juniAtmVp_id = ? AND I.port_id = J.port_id AND I.device_id = D.device_id', array($atm_vp_id));
if ($auth || port_permitted($vp['port_id'])) {
$port = $vp;
$device = device_by_id_cache($port['device_id']);
$title = generate_device_link($device);
$title .= ' :: Port ' . generate_port_link($port);
$title .= ' :: VP ' . $vp['vp_id'];
$auth = true;
$rrd_filename = rrd_name($vp['hostname'], array('vp', $vp['ifIndex'], $vp['vp_id']));
}
示例3: rrd_name
<?php
$scale_min = '0';
$rrd_filename = rrd_name($device['hostname'], array('bgp', $data['bgpPeerIdentifier']));
$ds_in = 'bgpPeerInUpdates';
$ds_out = 'bgpPeerOutUpdates';
$colour_area_in = 'AA66AA';
$colour_line_in = '330033';
$colour_area_out = 'FF6600';
$colour_line_out = 'FFDD88';
$colour_area_in_max = 'FFEE99';
$colour_area_out_max = 'FF7711';
$graph_max = 1;
$unit_text = 'Updates';
require 'includes/graphs/generic_duplex.inc.php';
示例4: rrd_create_update
function rrd_create_update($device, $name, $def, $val, $step = 300)
{
global $config;
$rrd = rrd_name($device['hostname'], $name);
if (!is_file($rrd) && $def != null) {
// add the --step and the rra definitions to the array
$newdef = "--step {$step} " . implode(' ', $def) . $config['rrd_rra'];
rrdtool_create($rrd, $newdef);
}
rrdtool_update($rrd, $val);
}
示例5: rrd_name
<?php
/*
* LibreNMS
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
require 'includes/graphs/common.inc.php';
$rrdfilename = rrd_name($device['hostname'], 'cambium-epmp-gpsSync');
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'1 - GPS Sync Up 2 - GPS Sync Down 3 - CMM Sync \\n'";
$rrd_options .= ' DEF:gpsSync=' . $rrdfilename . ':gpsSync:AVERAGE ';
$rrd_options .= " -l 1 ";
$rrd_options .= " -u 3 ";
$rrd_options .= " LINE2:gpsSync#666699:'GPS Sync Status ' ";
$rrd_options .= ' GPRINT:gpsSync:LAST:%0.2lf%s ';
}
示例6: rrd_name
<?php
require 'includes/graphs/common.inc.php';
$mysql_rrd = rrd_name($device['hostname'], array('app', 'mysql', $app['app_id']));
if (rrdtool_check_rrd_exists($mysql_rrd)) {
$rrd_filename = $mysql_rrd;
}
$multiplier = 8;
$ds_in = 'BRd';
$ds_out = 'BSt';
require 'includes/graphs/generic_data.inc.php';
示例7: foreach
<?php
$i = 0;
foreach ($procs as $proc) {
$rrd_filename = rrd_name($device['hostname'], array('processor', $proc['processor_type'], $proc['processor_index']));
if (rrdtool_check_rrd_exists($rrd_filename)) {
$descr = short_hrDeviceDescr($proc['processor_descr']);
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $descr;
$rrd_list[$i]['ds'] = 'usage';
$i++;
}
}
$unit_text = 'Load %';
$units = '%';
$total_units = '%';
$colours = 'oranges';
$scale_min = '0';
$scale_max = '100';
$divider = $i;
$text_orig = 1;
$nototal = 1;
require 'includes/graphs/generic_multi_simplex_seperated.inc.php';
示例8: rrd_name
<?php
require 'includes/graphs/common.inc.php';
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio');
if (rrdtool_check_rrd_exists($rrdfilename)) {
$rrd_options .= ' COMMENT:" Now Min Max\\r" ';
$rrd_options .= ' DEF:radioRxLevel=' . $rrdfilename . ':radioRxLevel:AVERAGE ';
$rrd_options .= ' LINE1:radioRxLevel#CC0000:"RX Level\\l" ';
$rrd_options .= ' COMMENT:\\u ';
$rrd_options .= ' GPRINT:radioRxLevel:LAST:"%3.2lf dBm" ';
$rrd_options .= ' GPRINT:radioRxLevel:MIN:"%3.2lf dBm" ';
$rrd_options .= ' GPRINT:radioRxLevel:MAX:"%3.2lf dBm\\r" ';
}
示例9: rrd_name
<?php
$rrd_filename = rrd_name($device['hostname'], array('arubaap', $ap['name'] . $ap['radio_number']));
$rrd_list[0]['filename'] = $rrd_filename;
$rrd_list[0]['descr'] = 'radioutil';
$rrd_list[0]['ds'] = 'radioutil';
$unit_text = 'Percent';
$units = '';
$total_units = '';
$colours = 'mixed';
$scale_min = '0';
$nototal = 1;
if ($rrd_list) {
include 'includes/graphs/generic_multi_line.inc.php';
}
示例10: array
<?php
require 'includes/graphs/common.inc.php';
$pallette = array(1 => 'FF0000', 2 => '0000FF', 3 => '00FF00', 4 => 'FF00FF', 5 => '000000', 6 => 'FFFF00', 7 => 'C0C0C0', 8 => '800000', 9 => '808000', 10 => '008000', 11 => '00FFFF', 12 => '008080', 13 => '000080', 14 => '800080', 15 => 'FF69B4', 16 => '006400');
$rrd_options .= ' -l 0 -E ';
$rrd_options .= " COMMENT:'Average Data Rate Cur Min Max\\n'";
$radioId = 1;
foreach (glob(rrd_name($device['hostname'], 'xirrus_stats-', '*.rrd')) as $rrd) {
// get radio name
preg_match("/xirrus_stats-iap([0-9]{1,2}).rrd/", $rrd, $out);
list(, $radioId) = $out;
// build graph
$color = $pallette[$radioId];
$descr = "iap{$radioId} ";
$rrd_options .= " DEF:rate{$radioId}={$rrd}:dataRate:AVERAGE";
$rrd_options .= " LINE2:rate{$radioId}#" . $color . ":'" . $descr . "'";
$rrd_options .= " GPRINT:rate{$radioId}:LAST:'%5.0lf'";
$rrd_options .= " GPRINT:rate{$radioId}:MIN:'%5.0lf'";
$rrd_options .= " GPRINT:rate{$radioId}:MAX:'%5.0lf'\\l";
$radioId++;
}
//end foreach
示例11: rrd_name
<?php
require 'includes/graphs/common.inc.php';
$scale_min = 0;
$ds = 'frequency';
$colour_area = 'F6F6F6';
$colour_line = 'B3D0DB';
$colour_area_max = 'FFEE99';
$graph_max = 100;
$unit_text = 'Frequency';
$ntpclient_rrd = rrd_name($device['hostname'], array('app', 'ntpclient', $app['app_id']));
if (rrdtool_check_rrd_exists($ntpclient_rrd)) {
$rrd_filename = $ntpclient_rrd;
}
require 'includes/graphs/generic_simplex.inc.php';
示例12: rrd_name
<?php
/*
* LibreNMS
*
* 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. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
require 'includes/graphs/common.inc.php';
$rrdfilename = rrd_name($device['hostname'], 'canopy-generic-rssi');
if (file_exists($rrdfilename)) {
$rrd_options .= " COMMENT:'dBm Now Ave Max \\n'";
$rrd_options .= ' DEF:rssi=' . $rrdfilename . ':rssi:AVERAGE ';
$rrd_options .= " AREA:rssi#FF0000:'RSSI ' ";
$rrd_options .= ' GPRINT:rssi:LAST:%0.2lf%s ';
$rrd_options .= ' GPRINT:rssi:MIN:%0.2lf%s ';
$rrd_options .= ' GPRINT:rssi:MAX:%0.2lf%s\\\\l ';
}
示例13: rrd_name
<?php
$nototal = 1;
$ds_in = 'msg_recv';
$ds_out = 'msg_sent';
$graph_titel .= '::messages';
$unit_text = 'Messages/sec';
$colour_line_in = '008800FF';
$colour_line_out = '000088FF';
$colour_area_in = 'CEFFCE66';
$colour_area_out = 'CECEFF66';
$colour_area_in_max = 'CC88CC';
$colour_area_out_max = 'FFEFAA';
$mailscanner_rrd = rrd_name($device['hostname'], array('app', 'mailscannerV2', $app['app_id']));
if (rrdtool_check_rrd_exists($mailscanner_rrd)) {
$rrd_filename = $mailscanner_rrd;
}
require 'includes/graphs/generic_duplex.inc.php';
示例14: elseif
} elseif ($iter == '2') {
$colour = '008C00';
} elseif ($iter == '3') {
$colour = '4096EE';
} elseif ($iter == '4') {
$colour = '73880A';
} elseif ($iter == '5') {
$colour = 'D01F3C';
} elseif ($iter == '6') {
$colour = '36393D';
} elseif ($iter == '7') {
$colour = 'FF0084';
unset($iter);
}
$descr = rrdtool_escape(short_hrDeviceDescr($mempool['mempool_descr']), 22);
$rrd_filename = rrd_name($device['hostname'], array('mempool', $mempool['mempool_type'], $mempool['mempool_index']));
if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_options .= " DEF:mempoolfree{$i}={$rrd_filename}:free:AVERAGE ";
$rrd_options .= " DEF:mempoolused{$i}={$rrd_filename}:used:AVERAGE ";
$rrd_options .= " CDEF:mempooltotal{$i}=mempoolused{$i},mempoolused{$i},mempoolfree{$i},+,/,100,* ";
$rrd_options .= " AREA:mempooltotal{$i}#" . $colour . '10';
$rrd_optionsb .= " LINE1:mempooltotal{$i}#" . $colour . ":'" . $descr . "' ";
$rrd_optionsb .= " GPRINT:mempooltotal{$i}:MIN:%3.0lf%%";
$rrd_optionsb .= " GPRINT:mempooltotal{$i}:LAST:%3.0lf%%";
$rrd_optionsb .= " GPRINT:mempooltotal{$i}:MAX:%3.0lf%%\\l ";
$iter++;
$i++;
}
}
//end foreach
$rrd_options .= $rrd_optionsb;
示例15: ceph_rrd
/**
* Constructs the path to an RRD for the Ceph application
* @param string $gtype The type of rrd we're looking for
* @return string
**/
function ceph_rrd($gtype)
{
global $device;
global $vars;
if ($gtype == "osd") {
$var = $vars['osd'];
} else {
$var = $vars['pool'];
}
return rrd_name($device['hostname'], array('app', 'ceph', $vars['id'], $gtype, $var));
}