James B. Byrne
2009-Jul-15 15:46 UTC
[CentOS] NIC traffic monitoring, recording and reporting software?
I have a remote CentOS-5.3 installation that shares traffic with another enterprise. I want to record and measure the actual network traffic that comes into and goes out of that host's net i/f on a monthly basis for billing verification purposes. Does CentOS have a software package to accomplish this? I have run across references to a package called vnstat as a possible answer to my requirements, but I cannot seem to locate a CentOS rpm package for it. Regards, -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
Les Mikesell
2009-Jul-15 16:40 UTC
[CentOS] NIC traffic monitoring, recording and reporting software?
James B. Byrne wrote:> I have a remote CentOS-5.3 installation that shares traffic with > another enterprise. I want to record and measure the actual network > traffic that comes into and goes out of that host's net i/f on a > monthly basis for billing verification purposes. Does CentOS have a > software package to accomplish this? > > I have run across references to a package called vnstat as a > possible answer to my requirements, but I cannot seem to locate a > CentOS rpm package for it.There are several tools that will collect interface traffic data via SNMP and record it so you can graph, show high/low/average values over a time span, etc. Cacti (in the epel repo) is probably the easiest to set up, OpenNMS (opennms.org) probably the most complete. These could also get their data from a port on a managed switch or router if that makes it easier to show the connections you need to split out. -- Les Mikesell lesmikesell at gmail.com
James B. Byrne
2009-Jul-15 17:38 UTC
[CentOS] NIC traffic monitoring, recording and reporting software?
I discover that mrtg is available as a package for CentOS-5. At first blush this seems the answer but would it in fact suffice for my purposes: measuring the total data volume passing over eth0 on the CentOS based host running mrtg? Is there a how-to guide to configuring snmp for eth0 on CentOS? I am afraid this this is all new territory for me and I am working under serious time and resource constraints. I have to get this done quickly and cheaply and I need a recipe to monitor total eth0 traffic cumulatively over a period of months. Getting the niceties of snmp mastered and in place must wait til a later date. Any pertinant advice is welcomed. -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
Filipe Brandenburger
2009-Jul-15 20:22 UTC
[CentOS] NIC traffic monitoring, recording and reporting software?
Hi, On Wed, Jul 15, 2009 at 11:46, James B. Byrne<byrnejb at harte-lyne.ca> wrote:> I have a remote CentOS-5.3 installation that shares traffic with > another enterprise. ?I want to record and measure the actual network > traffic that comes into and goes out of that host's net i/f on a > monthly basis for billing verification purposes. ?Does CentOS have a > software package to accomplish this?Have a look at "netacct-mysql": sourceforge.net/projects/netacct-mysql It uses pcap which puts your network card in promiscuous mode and send all packets to the running daemon, which might be a little heavyweight on the resources if your server uses a lot of network, but it appears to be very flexible in terms of being able to split accounting for different traffic going through the server. If you want something simpler than that, you may: 1) Use "ifconfig" and save the amount of bytes received/transmitted, then do that again some time from now and subtract the difference to know how much you sent in that period. A simple script should be able to do that. Beware that that counter may wrap though. Also, you might lose the information if you reboot the server or restart the network. 2) Use "iptables" to set specific rules for what you want to account. You don't have to use "allow" or "reject" or "drop", just write the filter you want. Then use "iptables -v -L" which will show you the number of packets and bytes that went through that rule. You can then use "iptables -Z" to reset the counters for a new period. HTH, Filipe