mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Move Billing/Bandwidth Graphs to common format, extract data generation to central function * Add API functions to access billing graphs and graph data * Scrutinizer fixes * Fix transfer graphs with from/to * Scrutinizer Fix * Fix docs, transfer page and missing from API param * Document and fix reducefactor, Add Graph Stats to Graph Data * Standardise times in graphdata * Fixed renamed function for History GraphData
50 lines
1.0 KiB
PHP
50 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
* LibreNMS
|
|
*
|
|
* This file is part of LibreNMS.
|
|
*
|
|
* @package librenms
|
|
* @subpackage billing
|
|
* @copyright (C) 2006 - 2012 Adam Armstrong
|
|
*/
|
|
|
|
ini_set('allow_url_fopen', 0);
|
|
|
|
$init_modules = array('web', 'auth');
|
|
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
|
|
|
$urlargs = array(
|
|
'type' => 'bill_historicbits',
|
|
'id' => $_GET['bill_id'],
|
|
'width' => $_GET['x'],
|
|
'height' => $_GET['y']
|
|
);
|
|
if (isset($_GET['bill_hist_id'])) {
|
|
$urlargs['bill_hist_id'] = $_GET['bill_hist_id'];
|
|
} else {
|
|
$urlargs['from'] = $_GET['from'];
|
|
$urlargs['to'] = $_GET['to'];
|
|
}
|
|
if (isset($_GET['count'])) {
|
|
$urlargs['reducefactor'] = $_GET['count'];
|
|
}
|
|
if (isset($_GET['95th'])) {
|
|
$urlargs['95th'] = $_GET['95th'];
|
|
}
|
|
if (isset($_GET['ave'])) {
|
|
$urlargs['ave'] = $_GET['ave'];
|
|
}
|
|
|
|
$url = "{$config['base_url']}graph.php?";
|
|
$i = 0;
|
|
foreach ($urlargs as $name => $value) {
|
|
if ($i++ > 0) {
|
|
$url .= '&';
|
|
}
|
|
$url .= "$name=$value";
|
|
}
|
|
|
|
header("Location: $url", false, 301);
|
|
exit;
|