Results 1 to 10 of 15
OS: SLES 10
# rpm -q gcc
gcc-4.1.0-28.4
# tar -xzvf vnstat-1.4.tar.gz
# cd vnstat-1.4
# make
make -C src vnstat
make[1]: Entering directory `/opt/MonitoringSoftwares/vnstat-1.4/src'
gcc -O2 -c proc.c
proc.c: ...
- 05-30-2007 #1Linux Newbie
- Join Date
- Feb 2007
- Posts
- 248
help me install 'vnstat'.. asap
OS: SLES 10
# rpm -q gcc
gcc-4.1.0-28.4
# tar -xzvf vnstat-1.4.tar.gz
# cd vnstat-1.4
# make
make -C src vnstat
make[1]: Entering directory `/opt/MonitoringSoftwares/vnstat-1.4/src'
gcc -O2 -c proc.c
proc.c: In function ‘parseproc’:
proc.c:105: warning: integer constant is too large for ‘long’ type
proc.c:106: warning: integer constant is too large for ‘long’ type
proc.c:107: warning: integer constant is too large for ‘long’ type
proc.c:109: warning: integer constant is too large for ‘long’ type
proc.c:109: warning: integer constant is too large for ‘long’ type
proc.c:135: warning: integer constant is too large for ‘long’ type
proc.c:136: warning: integer constant is too large for ‘long’ type
proc.c:137: warning: integer constant is too large for ‘long’ type
proc.c:139: warning: integer constant is too large for ‘long’ type
proc.c:139: warning: integer constant is too large for ‘long’ type
gcc -O2 -c db.c
db.c: In function ‘readdb’:
db.c:88: warning: integer constant is too large for ‘long’ type
gcc -O2 -c misc.c
gcc -O2 -o vnstat vnstat.c proc.o db.o misc.o
make[1]: Leaving directory `/opt/MonitoringSoftwares/vnstat-1.4/src'
Plz help me install, vnstat ? what should I do ?
Regards
- 05-31-2007 #2Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
remove the d vnstat-1.4 directory, then do this:
---> you'll see the same errors but you need to check the return code <----tar -xvf vnstat-1.4.tar
cd vnstat-1.4
make
If that returns "0", then it was probably successfully created. Look in the vnstat-1.4/src directory for the "vnstat" executable file. Check the time stamp on it and it should be from the same time you ran the "make".echo $?
- 05-31-2007 #3Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
Oh yeah... you also have to do a "make install" from the vnstat-1.4 directory. Then do "which vnstat" and it should pull back something. I just did this:
ehud:/home/xxxx/Desktop/temp/vnstat-1.4 # which vnstat
/usr/bin/vnstat
ehud:/home/xxxx/Desktop/temp/vnstat-1.4 # vnstat --help
vnStat 1.4 by Teemu Toivola <tst at iki dot fi>
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface change interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
See also "--longhelp" for complete options list and "man vnstat".
ehud:/home/xxxx/Desktop/temp/vnstat-1.4 #
- 05-31-2007 #4Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
Apparently you will need to run this:
Then you will have to wait about a day or so before the vnstat will actually show you anything.vnstat -u -i eth0
ehud:/var/lib/vnstat # vnstat
eth0: Not enough data available yet.
ehud:/var/lib/vnstat #
For those interested in what "vnstat" is, it is a network monitoring tool and here is the homepage for it:
vnStat - network traffic monitor for Linux
- 06-01-2007 #5Linux Newbie
- Join Date
- Feb 2007
- Posts
- 248
nice help kahoona

its DONE...infact I was confused/misguide due to warning messages, and esp the second and last line in the warning message i.e "make[1]" really misguide me, and convince me to think that vnstat doesnt compile successfully.
thanks and nice help
Regards
Needee
- 06-01-2007 #6Linux Newbie
- Join Date
- Feb 2007
- Posts
- 248
one more thing to ask I also download the " PHP frontend end to vnstat" from vnStat PHP frontend
then
# tar zxvf vnstat_php_frontend-1.3.tar.gz
# cd vnstat_php_frontend-1.3
now there i tried to run "./configure" "make" but failed... that is this php_frontend doesnt have any installer.
then I read the README file
<snip>
Put the files from this package somewhere inside the webroot of
your webserver
</snip>
thats why i copied all the files under vnstat_php_frontend-1.3 directory to the /srv/www/htdocs
# cd vnstat_php_frontend-1.3
# cp * /srv/www/htdocs
but Now I have no idea... what to do next ?
Regards
Needee
- 06-01-2007 #7Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
When you extract the file, you should have a directory named "vnstat_php_frontend-1.3". That directory needs to be copied to /srv/www/htdocs
Before you do anything, make sure you have php5 installed (I have php5-5.2.0-14). If you don't have it, then the vnstat_php_frontend will never work. Check with this:
Start up your apache server:rpm -qa | grep php5
Then you need to open your web browser to (not sure why this says "cPanel". Should be "localhost"):/etc/init.d/apache2 start
You should see a message that says "It works!". If you do, then type in:
And you should see your vnstat page.
If you want to view it from another computer, you have to open your firewall:
After that, open a browser on a remote computer and type inyast -> Security and Users -> Firewall -> Allowed Services -> HTTP server -> Add -> Accept
Of course, you can rename "vnstat_php_frontend-1.3" to something shorter like "vnstat" if you want so the URL isn't so long to type out.http://<suse box IP>/vnstat_php_frontend-1.3/
- 06-01-2007 #8Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
Configuration
You will probably see all zero's for everything. If so, you need to update the "config.php" file in the /srv/www/htdocs/vnstat_php_frontend-1.3.
Here are the changes I made; both the original line and modified line:
I only have one network adapter, so I commented out the others:
I want my network named "internet" because that is the only one I have:// $iface_list = array('eth0', 'eth1', 'sixxs');
$iface_list = array('eth0');
The php script needs to know where the vnstat executable is. Your's is probably in the same location. You can find out for sure with "which vnstat":// $iface_title['eth0'] = 'Internal';
// $iface_title['eth1'] = 'Internet';
// $iface_title['sixxs'] = 'SixXS IPv6';
$iface_title['eth0'] = 'Internet';
Remember the "//" is a comment in the php files. Now my webpage shows more along the lines of what I expected to see.// $vnstat_bin = '';
$vnstat_bin = '/usr/bin/vnstat';
- 06-04-2007 #9Linux Newbie
- Join Date
- Feb 2007
- Posts
- 248
Thanks Kahoona
# rpm -q php
php5-5.1.2-29.5
# cd /srv/www/htdocs
# tar zxvf vnstat_php_frontend-1.3.tar.gz
# ls -l
drwxr-xr-x 2 sharfuddin 1000 256 Jun 1 12:05 vnstat_php_frontend-1.3
# rcapache2 restart
Now open firefox > cPanel®.. and got the page that says :
It Works!
but failed when in firefox > http://127.0.0.1/vnstat_php_frontend-1.3/
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
plz help ;(
Regards
Needee
- 06-04-2007 #10Linux Newbie
- Join Date
- May 2006
- Location
- Kansas
- Posts
- 187
The vnstat_php* directory needs to be readable by the user who starts the apache server (wwwrun). Execute these to update the ownership:
That should fix your problem. No need to restart apache.cd /srv/www/htdocs
chown wwwrun:www ./vnstat_php_frontend-1.3
cd vnstat_php_frontend-1.3
chown wwwrun:www ./*


Reply With Quote
