[collectd] Collecting more detail network statistics

Florian Forster octo at verplant.org
Sat Feb 28 12:23:56 CET 2009


Hi Ulf,

On Fri, Feb 27, 2009 at 12:10:10PM -0800, Ulf Zimmermann wrote:
> I am looking at how I could collect more detailed network (interface)
> statistics. Extra numbers I am interested in are (all on Linux
> database servers):

> netstat -in

Bruno already mentioned the Netlink plugin [0], I think it's exactly
what you want for interface errors.

> cat /proc/net/snmp

I think IP, TCP, and UDP statistics are currently not available. Since
apparently `netstat' simply reads from these files
  octo at leeloo:~ $ strace -ttt -v -s 1024 -o /tmp/netstat.strace -- netstat -s >/dev/null
  octo at leeloo:~ $ egrep 'open.*proc' /tmp/netstat.strace
  1235815119.609463 open("/proc/meminfo", O_RDONLY) = 3
  1235815119.609754 open("/proc/net/snmp", O_RDONLY) = 3
  1235815119.610715 open("/proc/net/netstat", O_RDONLY) = 3
I'd say it's relatively safe to assume they won't change dramatically in
the future..

> Is anyone collecting these numbers right now? Any hints how you would
> collect them?

I've just written and pushed a small plugin called `protocols' which
does precisely that: Read from `/proc/net/snmp' and `/proc/net/netstat'
and dispatch the values.

It's very simple and dispatches all values as the new type
`protocol_counter'. The vast majority of those values are counters, but
`Tcp: CurrEstab' for example isn't. So most values should work just
fine, but those that are not counters (`CurrEstab' is the only one I've
seen so far) will be totally worthless.

Any feedback is of course welcome :)

Regards,
-octo

[0] <http://collectd.org/wiki/index.php/Plugin:Netlink>
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090228/758d48d0/attachment.pgp 


More information about the collectd mailing list