LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2010, 12:43 PM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Bandwidth logging and monitoring on interface


Hi! following my recent adventures with setting up my slackware router/firewall box (thanks to the slackware guys and this community!!) I am looking to complete the setup with specific features.

I would like to implement a way to monitor and log the internet bandwidth on the eth0 interface (the one that carry the connection to/from the outside world).

My network setup is like that:

ISP -> eth0 (Slackware Firewall/router/DHCP) eth1 -> 8 ports switch -> LAN clients

As you can see, if I monitor EVERYTHING that comes in and out of eth0, I wil get my answers. Because I dont want to monitor whats going on IN my lan, I dont need to worry about eth1.

What would be the best way to achieve this? I would like to get a real time monitoring as well as a daily/monthly/yearly cumulative logging. Similar to what IPTRAF does...

Please keep in mind that I will use this to eventually stop the eth0 when the monthly bandwidth exceed my ISP limit (60GB/month).

I dont want to rely on their logging (from their website) and I dont want to exceed, they will charge me wayyy to much.

Thanks for feedback!
 
Old 06-14-2010, 07:06 AM   #2
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Rep: Reputation: 16
Check out ntop, it's available as slackbuild.

Last edited by KMBS; 06-14-2010 at 07:11 AM. Reason: Typo
 
Old 06-14-2010, 07:44 AM   #3
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
could also use SNMP on the server and collect the data with something like cacti, nice graphs with that.
 
Old 06-14-2010, 08:02 PM   #4
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Hi! I tried to install ntop from slackbuilds.org, all the dependency packages installed fine (libevent, lua, and GeoIP) except rrdtool which generated these errors when compiling:

Code:
Find 3rd-Party Libraries
checking for libdbi... no
checking for cairo_font_options_create in -lcairo... no
checking for pkg-config... pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no cairo-png.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of cairo-png. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libcairo and its header files. If
  you have not installed cairo-png, you can get it either from its original home on

     http://cairographics.org/releases/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of cairo-png is 1.4.6.

       LIBS=-lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for cairo_svg_surface_create in -lcairo... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no cairo-svg.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of cairo-svg. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libcairo and its header files. If
  you have not installed cairo-svg, you can get it either from its original home on

     http://cairographics.org/releases/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of cairo-svg is 1.4.6.

       LIBS=-lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for cairo_pdf_surface_create in -lcairo... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no cairo-pdf.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of cairo-pdf. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libcairo and its header files. If
  you have not installed cairo-pdf, you can get it either from its original home on

     http://cairographics.org/releases/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of cairo-pdf is 1.4.6.

       LIBS=-lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for cairo_ps_surface_create in -lcairo... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no cairo-ps.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of cairo-ps. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libcairo and its header files. If
  you have not installed cairo-ps, you can get it either from its original home on

     http://cairographics.org/releases/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of cairo-ps is 1.4.6.

       LIBS=-lm 
   LDFLAGS=
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for glib_check_version in -lglib-2.0... yes
checking glib.h usability... no
checking glib.h presence... no
checking for glib.h... no
checking for pkg-config... (cached) pkg-config
checking for glib_check_version in -lglib-2.0... yes
checking glib.h usability... yes
checking glib.h presence... yes
checking for glib.h... yes
checking for pango_cairo_context_set_font_options in -lpango-1.0... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of pangocairo. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libpango-1.0 and its header files. If
  you have not installed pangocairo, you can get it either from its original home on

     http://ftp.gnome.org/pub/GNOME/sources/pango/1.17

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of pangocairo is 1.17.

       LIBS=-lm  -lglib-2.0  
   LDFLAGS=    
  CPPFLAGS= -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  

----------------------------------------------------------------------------
                
checking for xmlParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
configure: error: Please fix the library issues listed above and try again.
I installed pango & cairo with "slackpkg install pango" & "slackpkg install cairo" but no success....

Any idea?
Thanks!
 
Old 06-15-2010, 12:38 AM   #5
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Rep: Reputation: 16
You need the following packages from slackbuilds:

libsigc++
glibmm
cairomm
pangomm

Edit: When I think about it, I'm not quite sure if this is it.

When I run 'pkg-config --list-all | grep cairo' I get the lines 'cairo-svg' and 'cairomm-svg-1.0' among others.
Check if in your case at least 'cairo-svg' shows up.

I built cairomm and pangomm prior to rrdtool for some other program, and the rrdtool description doesn't
mention cairomm and pangomm, so I guess they're not needed, but it's worth a shot.

Post the output of 'pkg-config --list-all | grep cairo' and 'pkg-config --list-all | grep pango', maybe it is helpful.

Last edited by KMBS; 06-15-2010 at 01:25 AM. Reason: Typo
 
Old 06-15-2010, 02:22 AM   #6
frandalla
Member
 
Registered: Oct 2003
Location: Tokyo - Japan
Distribution: Slackware
Posts: 348
Blog Entries: 1

Rep: Reputation: 37
it depends on what kind of monitoring you want to do. if you want something like "top" to monitor processes of the system, go with "ntop".
If you want to have statistics and logging and pretty graphics and would like to throw a nice web interface to that I'd go with MRTG.

http://oss.oetiker.ch/mrtg/
 
Old 06-15-2010, 05:27 AM   #7
KMBS
Member
 
Registered: Oct 2009
Location: Germany
Distribution: Slackware
Posts: 32

Rep: Reputation: 16
Quote:
Originally Posted by frandalla View Post
If you want to have statistics and logging and pretty graphics and would like to throw a nice web interface to that I'd go with MRTG.
That's what ntop does.

Last edited by KMBS; 06-15-2010 at 05:28 AM. Reason: typo
 
Old 06-17-2010, 09:25 PM   #8
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
KMBS, installing the packages you suggested did it!

thanks!
ntop seems perfect for my needs!
 
Old 06-24-2010, 03:38 AM   #9
frandalla
Member
 
Registered: Oct 2003
Location: Tokyo - Japan
Distribution: Slackware
Posts: 348
Blog Entries: 1

Rep: Reputation: 37
Quote:
Originally Posted by KMBS View Post
That's what ntop does.

I see. I only knew ntop as the top-like tool to monitor network traffic. I didn't know it had (or incorporated) mrtg like features.
 
Old 06-24-2010, 08:44 AM   #10
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
Well there is ntop the application that you run from cli and then there is ntop the software that has a web interface. That one collects data from your network and provides a lot of information. I've attached a screenshot of what ntop looks like in the web interface.
Attached Thumbnails
Click image for larger version

Name:	ntop.JPG
Views:	25
Size:	95.7 KB
ID:	3972  
 
Old 06-27-2010, 09:32 PM   #11
frandalla
Member
 
Registered: Oct 2003
Location: Tokyo - Japan
Distribution: Slackware
Posts: 348
Blog Entries: 1

Rep: Reputation: 37
I just knew ntop as a top-like console tool. Thanks for the info

Quote:
Originally Posted by KMBS View Post
That's what ntop does.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bandwidth Monitoring bruceblacklaws Linux - Networking 4 05-12-2009 04:00 AM
Monitoring bandwidth use Jubalint Linux - Networking 4 01-13-2007 07:50 PM
bandwidth monitoring,,,,, apenguinlinux Linux - Software 3 01-25-2005 10:19 AM
Bandwidth Monitoring basketkase999 Linux - Software 2 01-13-2005 02:44 PM
Bandwidth Monitoring allandire Linux - Networking 1 06-25-2002 06:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration