Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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: ...
  1. #1
    Linux 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

  2. #2
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    remove the d vnstat-1.4 directory, then do this:

    tar -xvf vnstat-1.4.tar
    cd vnstat-1.4
    make
    ---> you'll see the same errors but you need to check the return code <----
    echo $?
    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".

  3. #3
    Linux 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 #

  4. #4
    Linux Newbie
    Join Date
    May 2006
    Location
    Kansas
    Posts
    187
    Apparently you will need to run this:
    vnstat -u -i eth0
    Then you will have to wait about a day or so before the vnstat will actually show you anything.
    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

  5. #5
    Linux 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

  6. #6
    Linux 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

  7. #7
    Linux 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:
    rpm -qa | grep php5
    Start up your apache server:
    /etc/init.d/apache2 start
    Then you need to open your web browser to (not sure why this says "cPanel". Should be "localhost"):
    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:
    yast -> Security and Users -> Firewall -> Allowed Services -> HTTP server -> Add -> Accept
    After that, open a browser on a remote computer and type in
    http://<suse box IP>/vnstat_php_frontend-1.3/
    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.

  8. #8
    Linux 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:
    // $iface_list = array('eth0', 'eth1', 'sixxs');
    $iface_list = array('eth0');
    I want my network named "internet" because that is the only one I have:
    // $iface_title['eth0'] = 'Internal';
    // $iface_title['eth1'] = 'Internet';
    // $iface_title['sixxs'] = 'SixXS IPv6';
    $iface_title['eth0'] = 'Internet';
    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":
    // $vnstat_bin = '';
    $vnstat_bin = '/usr/bin/vnstat';
    Remember the "//" is a comment in the php files. Now my webpage shows more along the lines of what I expected to see.

  9. #9
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    Quote Originally Posted by kahoona View Post
    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:


    Then you need to open your web browser to (not sure why this says "cPanel". Should be "localhost"):


    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 in


    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.
    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

  10. #10
    Linux 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:

    cd /srv/www/htdocs
    chown wwwrun:www ./vnstat_php_frontend-1.3
    cd vnstat_php_frontend-1.3
    chown wwwrun:www ./*
    That should fix your problem. No need to restart apache.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...