Commit | Line | Data |
---|---|---|
4a778b7e | 1 | <?php |
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)); | |
8 | } | |
9 | ||
10 | include_once('rrdstat.php-class'); | |
4d8d65db RK |
11 | |
12 | $rrd_config_file = 'rrd-config/'.php_uname('n').'.inc.php'; | |
13 | if (!file_exists($rrd_config_file)) { $rrd_config_file = 'rrd-config.inc.php'; } | |
14 | include_once($rrd_config_file); | |
4a778b7e | 15 | |
16 | // view stats | |
17 | $sname = isset($_GET['stat'])?$_GET['stat']:null; | |
18 | if (is_null($sname) || !strlen($sname)) { $sname = 'index'; } | |
19 | ||
20 | // call RRD module | |
21 | $rrds = new rrdstat($rrd_info, $sname); | |
22 | ||
23 | $psub = isset($_GET['sub'])?$_GET['sub']:null; | |
24 | print($rrds->page($psub)); | |
25 | ?> |