bandwidth usage in bytes on Linux
Hi
I'm looking for a way to create graphs for hobbit on Linux to monitor network bandwidth usage, separately on each interface (eth0,eth1). The provided netstat rrd Network I/O graph measures packets/second but I want bytes/second, which netstat0 (as defined in hobbitgraph.cfg) is supposed to graph but it doesn't since the netstat -s command on my server (RHEL4) doesn't return any byte statistics (only packets).
I suppose I could build something like this (monitoring the /proc/net/dev file) myself if I looked into setting up a custom rrd and so forth, but I'm hoping to save some trouble by asking if someone here has already done this :-D
Help, anyone?
There is a very well described MRTG interface for Hobbit. I just implemented it at a customer site and it works as advertised. The URL is in the help.
Jesper Johnson wrote:
Hi
I'm looking for a way to create graphs for hobbit on Linux to monitor network bandwidth usage, separately on each interface (eth0,eth1). The provided netstat rrd Network I/O graph measures packets/second but I want bytes/second, which netstat0 (as defined in hobbitgraph.cfg) is supposed to graph but it doesn't since the netstat -s command on my server (RHEL4) doesn't return any byte statistics (only packets).
I suppose I could build something like this (monitoring the /proc/net/dev file) myself if I looked into setting up a custom rrd and so forth, but I'm hoping to save some trouble by asking if someone here has already done this :-D
Help, anyone?
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- Rich Smrcina VM Assist, Inc. Main: (262)392-2026 Cell: (414)491-6001 Ans Service: (360)715-2467 rich.smrcina at vmassist.com
Catch the WAVV! http://www.wavv.org WAVV 2006 - Chattanooga, TN - April 7-11, 2006
On Thu, Nov 10, 2005 at 06:46:49AM -0600, Rich Smrcina wrote:
Jesper Johnson wrote:
I'm looking for a way to create graphs for hobbit on Linux to monitor network bandwidth usage, separately on each interface (eth0,eth1). The
There is a very well described MRTG interface for Hobbit. I just implemented it at a customer site and it works as advertised. The URL is in the help.
MRTG would indeed solve this problem.
But it might still make some sense to have the Linux hobbitclient collect the data from /sbin/ifconfig. It does have byte counters:
eth0 Link encap:Ethernet HWaddr 00:0E:A6:CE:D6:85
inet addr:172.16.10.100 Bcast:172.16.10.255 Mask:255.255.255.0
inet6 addr: fe80::20e:a6ff:fece:d685/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7935102 errors:0 dropped:0 overruns:0 frame:0
TX packets:7943900 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2210282597 (2.0 GiB) TX bytes:2268014990 (2.1 GiB)
Interrupt:17
I dont think Hobbit should use these to populate the tcpOutDataBytes and tcpInInorderBytes fields in the netstat rrd - the ifconfig counters are per network interface, where the rest of the netstat data are global counters.
But perhaps there should be a completely separate set of RRD files, with one graph per network interface ?
Regards, Henrik
But it might still make some sense to have the Linux hobbitclient collect the data from /sbin/ifconfig. It does have byte counters:
eth0 Link encap:Ethernet HWaddr 00:0E:A6:CE:D6:85 RX bytes:2210282597 (2.0 GiB) TX bytes:2268014990 (2.1 GiB)
I dont think Hobbit should use these to populate the tcpOutDataBytes and tcpInInorderBytes fields in the netstat rrd - the ifconfig counters are per network interface, where the rest of the netstat data are global counters.
Correct, and I've never really trusted those counters for 'real bandwidth usage'. I think re-transmissions and other TCP counters need to be added.
But perhaps there should be a completely separate set of RRD files, with one graph per network interface ?
Yes. And for the other UNIXes you'll want to to run these local commands and send them to the server for parsing:
AIX|HP-UX: /usr/bin/netstat -v
Solaris: /usr/bin/kstat -p -s [or]bytes64
And a 'netstat -i' provides ethernet layer stats that can be useful. Not for bandwidth, but Input Errors and Output Errors are never a good thing.
Henrik, do you need sample outputs to do the parsing on the server?
-- Scott Walters -PacketPusher
On Thu, Nov 10, 2005 at 09:14:43AM -0500, Scott Walters wrote:
But it might still make some sense to have the Linux hobbitclient collect the data from /sbin/ifconfig. It does have byte counters:
eth0 Link encap:Ethernet HWaddr 00:0E:A6:CE:D6:85 RX bytes:2210282597 (2.0 GiB) TX bytes:2268014990 (2.1 GiB)
I dont think Hobbit should use these to populate the tcpOutDataBytes and tcpInInorderBytes fields in the netstat rrd - the ifconfig counters are per network interface, where the rest of the netstat data are global counters.
Correct, and I've never really trusted those counters for 'real bandwidth usage'. I think re-transmissions and other TCP counters need to be added.
Yep ...
But perhaps there should be a completely separate set of RRD files, with one graph per network interface ?
Yes. And for the other UNIXes you'll want to to run these local commands and send them to the server for parsing:
AIX|HP-UX: /usr/bin/netstat -v
Solaris: /usr/bin/kstat -p -s [or]bytes64
Fabulous.
If anyone knows of similar commands to get the interface statistics for the *BSD systems, let me know.
And a 'netstat -i' provides ethernet layer stats that can be useful. Not for bandwidth, but Input Errors and Output Errors are never a good thing.
Henrik, do you need sample outputs to do the parsing on the server?
I think I can get most of these myself, but if you have them available do send me a copy - it will save me having to hunt them down.
Regards, Henrik
My vote would be for the method that uses the least amount of resources (within reason). If the data is available using existing interfaces and does not require additional software (like mrtg), it's goodness (as long as it's accurate). I have no reason to think that ifconfig wouldn't be accurate.
A separate graph per interface works for me (that's the way the mrtg implementation does it).
The worst thing for a monitor to do is to become a performance problem.
Henrik Stoerner wrote:
On Thu, Nov 10, 2005 at 06:46:49AM -0600, Rich Smrcina wrote:
Jesper Johnson wrote:
I'm looking for a way to create graphs for hobbit on Linux to monitor network bandwidth usage, separately on each interface (eth0,eth1). The
There is a very well described MRTG interface for Hobbit. I just implemented it at a customer site and it works as advertised. The URL is in the help.
MRTG would indeed solve this problem.
But it might still make some sense to have the Linux hobbitclient collect the data from /sbin/ifconfig. It does have byte counters:
eth0 Link encap:Ethernet HWaddr 00:0E:A6:CE:D6:85
inet addr:172.16.10.100 Bcast:172.16.10.255 Mask:255.255.255.0 inet6 addr: fe80::20e:a6ff:fece:d685/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7935102 errors:0 dropped:0 overruns:0 frame:0 TX packets:7943900 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2210282597 (2.0 GiB) TX bytes:2268014990 (2.1 GiB) Interrupt:17I dont think Hobbit should use these to populate the tcpOutDataBytes and tcpInInorderBytes fields in the netstat rrd - the ifconfig counters are per network interface, where the rest of the netstat data are global counters.
But perhaps there should be a completely separate set of RRD files, with one graph per network interface ?
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- Rich Smrcina VM Assist, Inc. Main: (262)392-2026 Cell: (414)491-6001 Ans Service: (360)715-2467 rich.smrcina at vmassist.com
Catch the WAVV! http://www.wavv.org WAVV 2006 - Chattanooga, TN - April 7-11, 2006
Thanks for the fast replies.
I noticed the MRTG support, but like some of you mentioned, setting up MRTG is a bit too much for polling just a few values that can be fetched with existing lightweight tools.
Henrik Stoerner wrote:
But perhaps there should be a completely separate set of RRD files, with one graph per network interface ?
I support this idea (with bytes/sec values). Having a different graph for each interface (instead of the current global stats) is necessary for monitoring multi-nic servers that run different services on different nics...
Is implementing this into hobbit a lot of work or is there a possibility we'll be enjoying this new feature before 2006? :-)
Last but not least a big thank you to Henrik for hobbit. Found out about this project a few days ago... it's great!
-J
On Thu, Nov 10, 2005 at 09:20:56PM +0200, Jesper Johnson wrote:
Is implementing this into hobbit a lot of work or is there a possibility we'll be enjoying this new feature before 2006? :-)
I took a shot at it tonight, and I think I have something working for linux boxes. I'll let it run overnight and see if the data look right in the morning. I need to do the parsing of the other OS's output formats, but that shouldn't be much of a problem. Regular expressions are great.
Last but not least a big thank you to Henrik for hobbit. Found out about this project a few days ago... it's great!
Glad you like it :-)
Regards, Henrik
Hey Henrik
How did your 'bandwidth graph per interface' -experiment on Linux go and is there a test version available somewhere yet?
Henrik Stoerner wrote:
I took a shot at it tonight, and I think I have something working for linux boxes. I'll let it run overnight and see if the data look right in the morning. I need to do the parsing of the other OS's output formats, but that shouldn't be much of a problem. Regular expressions are great.
On Tue, Nov 22, 2005 at 02:33:00PM +0200, Jesper Johnson wrote:
How did your 'bandwidth graph per interface' -experiment on Linux go and is there a test version available somewhere yet?
It actually seems to work quite well. It is currently only for Linux, but it has been included in the nightly snapshots for some time - you'll find it at http://www.hswn.dk/beta/
The clients must be updated, so they report the raw "ifconfig" data (for Linux - there are some other commands for AIX, Solaris and HP-UX, but I haven't done the server-side parsing for these OS's yet).
Regards, Henrik
I installed the snapshot on all my servers, the graphs seem to work fine (on RH Enterprise Linux 4). Just needed to add "ifstat" into hobbitserver.cfg TEST2RRD and GRAPHS.
This is exactly what I needed, thanks a million!
-J
Henrik Stoerner wrote:
It actually seems to work quite well. It is currently only for Linux, but it has been included in the nightly snapshots for some time - you'll find it at http://www.hswn.dk/beta/
The clients must be updated, so they report the raw "ifconfig" data (for Linux - there are some other commands for AIX, Solaris and HP-UX, but I haven't done the server-side parsing for these OS's yet).
participants (4)
-
henrik@hswn.dk
-
jesper.johnson@welho.com
-
rsmrcina@wi.rr.com
-
scott@PacketPushers.com