2 $myfile = $_SERVER['SCRIPT_FILENAME'];
3 while (is_link($myfile)) { $myfile = readlink($myfile); }
4 if (getcwd() != dirname($myfile)) {
5 // change to directory of the script if called from different directory
6 $orig_workingdir = getcwd();
7 chdir(dirname($myfile));
10 include_once('rrdstat.php-class');
11 include_once('rrd-config.inc.php');
14 $sname = isset($_GET['stat'])?$_GET['stat']:null;
15 if (is_null($sname) || !strlen($sname)) { $sname = 'index'; }
18 $rrds = new rrdstat($rrd_info, $sname);
20 $psub = isset($_GET['sub'])?$_GET['sub']:null;
21 print($rrds->page($psub));