1533 |
richard |
1 |
<?php
|
|
|
2 |
//
|
|
|
3 |
// vnStat PHP frontend (c)2006-2010 Bjorge Dijkstra (bjd@jooz.net)
|
|
|
4 |
//
|
|
|
5 |
// This program is free software; you can redistribute it and/or modify
|
|
|
6 |
// it under the terms of the GNU General Public License as published by
|
|
|
7 |
// the Free Software Foundation; either version 2 of the License, or
|
|
|
8 |
// (at your option) any later version.
|
|
|
9 |
//
|
|
|
10 |
// This program is distributed in the hope that it will be useful,
|
|
|
11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
13 |
// GNU General Public License for more details.
|
|
|
14 |
//
|
|
|
15 |
// You should have received a copy of the GNU General Public License
|
|
|
16 |
// along with this program; if not, write to the Free Software
|
|
|
17 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
18 |
//
|
|
|
19 |
//
|
|
|
20 |
// see file COPYING or at http://www.gnu.org/licenses/gpl.html
|
|
|
21 |
// for more information.
|
|
|
22 |
//
|
|
|
23 |
error_reporting(E_ALL | E_NOTICE);
|
|
|
24 |
|
|
|
25 |
//
|
|
|
26 |
// configuration parameters
|
|
|
27 |
//
|
|
|
28 |
// edit these to reflect your particular situation
|
|
|
29 |
//
|
|
|
30 |
$locale = 'en_US.UTF-8';
|
|
|
31 |
$language = 'en';
|
|
|
32 |
|
|
|
33 |
// list of network interfaces monitored by vnStat
|
|
|
34 |
$iface_list = array('eth0');
|
|
|
35 |
|
|
|
36 |
//
|
|
|
37 |
// optional names for interfaces
|
|
|
38 |
// if there's no name set for an interface then the interface identifier
|
|
|
39 |
// will be displayed instead
|
|
|
40 |
//
|
|
|
41 |
$iface_title['eth0'] = 'Wire';
|
|
|
42 |
|
|
|
43 |
//
|
|
|
44 |
// There are two possible sources for vnstat data. If the $vnstat_bin
|
|
|
45 |
// variable is set then vnstat is called directly from the PHP script
|
|
|
46 |
// to get the interface data.
|
|
|
47 |
//
|
|
|
48 |
// The other option is to periodically dump the vnstat interface data to
|
|
|
49 |
// a file (e.g. by a cronjob). In that case the $vnstat_bin variable
|
|
|
50 |
// must be cleared and set $data_dir to the location where the dumps
|
|
|
51 |
// are stored. Dumps must be named 'vnstat_dump_$iface'.
|
|
|
52 |
//
|
|
|
53 |
// You can generate vnstat dumps with the command:
|
|
|
54 |
// vnstat --dumpdb -i $iface > /path/to/data_dir/vnstat_dump_$iface
|
|
|
55 |
//
|
|
|
56 |
$vnstat_bin = '/usr/bin/vnstat';
|
|
|
57 |
$data_dir = './dumps';
|
|
|
58 |
$data_dir = '/var/spool/vnstat';
|
|
|
59 |
|
|
|
60 |
// graphics format to use: svg or png
|
|
|
61 |
$graph_format='svg';
|
|
|
62 |
|
|
|
63 |
// Font to use for PNG graphs
|
|
|
64 |
define('GRAPH_FONT',dirname(__FILE__).'/VeraBd.ttf');
|
|
|
65 |
|
|
|
66 |
// Font to use for SVG graphs
|
|
|
67 |
define('SVG_FONT', 'Verdana');
|
|
|
68 |
|
|
|
69 |
// Default theme
|
|
|
70 |
define('DEFAULT_COLORSCHEME', 'light');
|
|
|
71 |
|
|
|
72 |
?>
|