Files
librenms-librenms/html/includes/graphs/bill/bits.inc.php
T

42 lines
1.3 KiB
PHP
Raw Normal View History

2010-07-31 21:08:35 +00:00
<?php
2012-05-25 12:24:34 +00:00
// Generate a list of ports and then call the multi_bits grapher to generate from the list
2010-07-31 21:08:35 +00:00
2011-03-17 13:35:25 +00:00
$i = 0;
2011-05-13 12:57:11 +00:00
foreach ($ports as $port)
2011-03-17 13:35:25 +00:00
{
if (is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd")))
{
$rrd_list[$i]['filename'] = $config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
2010-07-31 21:08:35 +00:00
$rrd_list[$i]['descr'] = $port['ifDescr'];
$i++;
}
}
2011-03-17 13:35:25 +00:00
$units='bps';
$total_units='B';
$colours_in='greens';
$multiplier = "8";
2010-07-31 21:08:35 +00:00
$colours_out = 'blues';
$nototal = 1;
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";
2010-07-31 21:08:35 +00:00
2011-03-23 10:25:42 +00:00
#print_r($rates);
if($bill['bill_type'] == "cdr") {
$custom_graph = " COMMENT:'\\r' ";
2011-12-07 13:52:46 +00:00
$custom_graph .= " HRULE:" . $rates['rate_95th'] . "#cc0000:'95th %ile \: ".formatRates($rates['rate_95th'])." (".$rates['dir_95th'].") (CDR\: ".formatRates($bill['bill_cdr']).")'";
$custom_graph .= " HRULE:" . $rates['rate_95th'] * -1 . "#cc0000";
2011-03-23 10:25:42 +00:00
} elseif($bill['bill_type'] == "quota") {
$custom_graph = " COMMENT:'\\r' ";
2011-12-07 13:52:46 +00:00
$custom_graph .= " HRULE:" . $rates['rate_average'] . "#cc0000:'Usage \: ".format_bytes_billing($rates['total_data'])." (".formatRates($rates['rate_average']).")'";
$custom_graph .= " HRULE:" . $rates['rate_average'] * -1 . "#cc0000";
2011-03-23 10:25:42 +00:00
}
2011-03-17 13:35:25 +00:00
include("includes/graphs/generic_multi_bits_separated.inc.php");
2010-07-31 21:08:35 +00:00
2011-03-23 10:25:42 +00:00
?>