Commit | Line | Data |
---|---|---|
4a778b7e | 1 | <?php |
1759d73b | 2 | date_default_timezone_set("Europe/Vienna"); |
4a778b7e | 3 | $myfile = $_SERVER['SCRIPT_FILENAME']; |
4 | while (is_link($myfile)) { $myfile = readlink($myfile); } | |
5 | if (getcwd() != dirname($myfile)) { | |
6 | // change to directory of the script if called from different directory | |
7 | $orig_workingdir = getcwd(); | |
8 | chdir(dirname($myfile)); | |
9 | } | |
10 | ||
11 | include_once('rrdstat.php-class'); | |
4d8d65db | 12 | |
ac51fa8e RK |
13 | // $GLOBALS['ua'] is required by some page generation routines |
14 | include_once('useragent.php-class'); | |
15 | $ua = new userAgent(); | |
16 | ||
4d8d65db RK |
17 | $rrd_config_file = 'rrd-config/'.php_uname('n').'.inc.php'; |
18 | if (!file_exists($rrd_config_file)) { $rrd_config_file = 'rrd-config.inc.php'; } | |
19 | include_once($rrd_config_file); | |
4a778b7e | 20 | |
21 | // view stats | |
22 | $sname = isset($_GET['stat'])?$_GET['stat']:null; | |
23 | if (is_null($sname) || !strlen($sname)) { $sname = 'index'; } | |
24 | ||
25 | // call RRD module | |
26 | $rrds = new rrdstat($rrd_info, $sname); | |
27 | ||
28 | $psub = isset($_GET['sub'])?$_GET['sub']:null; | |
29 | print($rrds->page($psub)); | |
30 | ?> |