Hi all,
I'm trying to set up a script that will monitor the bandwidth being used by a given process and kill it if it exceeds a threshold. I was planning on using bwmon (http://thp.io/2010/bwmon/), which reads /proc/net/ip_conntrack to get the number of bytes in each packet and the packet count.
The first thing I noticed was that /proc/net didn't contain ip_conntrack, so then I tried:
This at least gives me an ip_conntrack, but it's missing the "bytes=" and "packets=" fields. From googling I expect each entry to look something like this:Code:~$ sudo modprobe ip_conntrack
but what I actually get looks like this:Code:~$ sudo tail -n 1 /proc/net/ip_conntrack tcp 6 431557 ESTABLISHED src=X.X.X.X dst=X.X.X.X sport=44242 dport=993 packets=128 bytes=9267 src=X.X.X.X dst=X.X.X.X sport=993 dport=44242 packets=85 bytes=53950 [ASSURED] mark=0 use=2
I'm running 12.04 and kernel v3.2.0-29, but I also find that the entries look the same (i.e. missing "bytes=" and "packets=") on another machine running 11.04 and kernel v3.0.0-23.Code:~$ sudo tail -n 1 /proc/net/ip_conntrack tcp 6 431665 ESTABLISHED src=X.X.X.X dst=X.X.X.X sport=4640 dport=8082 src=X.X.X.X dst=X.X.X.X sport=8082 dport=4640 [ASSURED] mark=0 use=2
So what gives? Is there some way I can turn on logging of packet size/count, or is this information now being logged somewhere else?



Adv Reply

Bookmarks