Line 1:
Line 1:
−
{{Needs review}}
+
{{Level|Medium}}
+
===Description===
"vnStat is a network traffic monitor for Linux that keeps a log of daily network traffic for the selected interface(s)." ([http://humdi.net/vnstat/ Read more...])
"vnStat is a network traffic monitor for Linux that keeps a log of daily network traffic for the selected interface(s)." ([http://humdi.net/vnstat/ Read more...])
−
How to install vnstat and the the PHP frontent.<br>
+
Based on How to install vnstat and the the PHP frontent.<br>
[Original post http://forums.contribs.org/index.php?topic=42444]<br>
[Original post http://forums.contribs.org/index.php?topic=42444]<br>
−
==Install vnstat==
+
+
===Configure necessary repositories===
+
You can either obtain the package directly or set up the Dag repository. If not already configured, the Dag repsository can be set up as follows:
+
====Dag====
+
{{Repository|Dag}}
+
+
===Install vnstat===
+
====Using Yum====
+
If you have configured the dag repository, installation is as simple as:
+
yum install vnstat --enablerepo=dag
+
====Manually====
+
If you have not configured the Dag repository then the following applies.
+
+
Search for the package at http://dag.wieers.com and find the latest and adjust the wget line as appropriate.
+
Get vnstat and install:
Get vnstat and install:
wget http://dag.wieers.com/rpm/packages/vnstat/vnstat-1.4-3.2.el4.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/vnstat/vnstat-1.4-3.2.el4.rf.i386.rpm
yum localinstall vnstat-1.4-3.2.el4.rf.i386.rpm
yum localinstall vnstat-1.4-3.2.el4.rf.i386.rpm
+
====Add the monitored Interfaces====
Add the interfaces you would like to monitor:
Add the interfaces you would like to monitor:
vnstat -u -i eth0
vnstat -u -i eth0
vnstat -u -i eth1
vnstat -u -i eth1
−
(Ignore the error message you get)
+
You should get an error about the database not existing but it will also say it created it. It is safe to ignore the error message.
−
==Install vnStat PHP FrontEnd==
+
===Install vnStat PHP FrontEnd===
"...Since vnStat is console mode only I created this script to make a 'nice' report of the data collected by vnStat...." ([http://www.sqweek.com/sqweek/index.php?p=1 Read More)]
"...Since vnStat is console mode only I created this script to make a 'nice' report of the data collected by vnStat...." ([http://www.sqweek.com/sqweek/index.php?p=1 Read More)]
+
There is no yum repo for this so you will need to go to: http://www.sqweek.com/sqweek/index.php?p=1 to find the latest. Determine the link to the latest release and replace the '''wget''' command (below) accordingly.
+
+
The below instructions put the file into the Primary ibay, you can also put it in a dedicated ibay or in /opt as suits your needs and security requirements.
Get the frontend and configure:
Get the frontend and configure:
cd /home/e-smith/files/ibays/Primary/html/
cd /home/e-smith/files/ibays/Primary/html/
−
wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.4.tar.gz
+
wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.4.1.tar.gz
−
tar -xvzf vnstat_php_frontend-1.4.tar.gz
+
tar -xvzf vnstat_php_frontend-1.4.1.tar.gz
−
cd vnstat_php_frontend-1.4
+
cd vnstat_php_frontend-1.4.1
nano config:<br>
nano config:<br>
Edit the information about the interfaces you would like to graph:
Edit the information about the interfaces you would like to graph:
−
$iface_list = array('eth0', 'ppp0');
+
$iface_list = array('eth0', 'eth1');
The optional names:
The optional names:
$iface_title['eth0'] = 'Internal';
$iface_title['eth0'] = 'Internal';
−
$iface_title['ppp0'] = 'Internet';
+
$iface_title['eth1'] = 'Internet';
Finnaly set application path:
Finnaly set application path:
$vnstat_bin = '/usr/bin/vnstat';
$vnstat_bin = '/usr/bin/vnstat';
Line 35:
Line 54:
chmod 666 /var/lib/vnstat/*;
chmod 666 /var/lib/vnstat/*;
−
Wait and you should see the application working at http://yourserverIP/vnstat_php_frontend-1.4
+
Wait and you should see the application working at http://yourserverIP/vnstat_php_frontend-1.4.1
----
----
[[Category: Howto]]
[[Category: Howto]]
[[Category: Administration]]
[[Category: Administration]]