2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 date_default_timezone_set("Europe/Vienna");
7 $myfile = $_SERVER['SCRIPT_FILENAME'];
8 while (is_link($myfile)) { $myfile = readlink($myfile); }
9 if (getcwd() != dirname($myfile)) {
10 // change to directory of the script if called from different directory
11 $orig_workingdir = getcwd();
12 chdir(dirname($myfile));
15 include_once('rrdstat.php-class');
17 // $GLOBALS['ua'] is required by some page generation routines
18 include_once('useragent.php-class');
19 $ua = new userAgent();
21 $rrd_config_file = 'rrd-config/'.php_uname('n').'.inc.php';
22 if (!file_exists($rrd_config_file)) { $rrd_config_file = 'rrd-config.inc.php'; }
23 include_once($rrd_config_file);
26 $sname = isset($_GET['stat'])?$_GET['stat']:null;
27 if (is_null($sname) || !strlen($sname)) { $sname = 'index'; }
30 $rrds = new rrdstat($rrd_info, $sname);
32 $psub = isset($_GET['sub'])?$_GET['sub']:null;
33 print($rrds->page($psub));