[collectd] Problems with 'traffic' plugin

Muralito muralito at montevideo.com.uy
Thu May 4 05:30:46 CEST 2006

Sune Marcher escribió:
> Hello Florian,
> It's pretty weird. There's no messages in the syslog from collectd at
> all (which should of course be a good sign, had 'traffic' worked).
> I added a "syslog("it worked")" after the getifaddrs() null-check -
> which *does* pop up in the syslog. Then I added a syslog() to the for
> loop, and from that it seems like all the returned interfaces'
> ifa_data member is NULL - weird!
> Is there some kernel options I need enabled for getifaddrs to work?
>> Could you send some more information about your system? You
>> Kernel(-version), libc version, gcc version, ...?
> Slackware 9.0.0, Kernel 2.4.30, gcc version 3.2.2 - and whatever libc
> slack came with (libc-2.3.1.so?)
>> No, sorry, I don't know.. But I wouldn't be surprised if `getifaddrs(3)'
>> returned interface aliases as well..
> Perhaps - if it worked :)
> A discouraging thing, though, is that 'ifconfig' doesn't show traffic
> for the alias interfaces, only for the main physical interface :/

In the networking framework of linux kernel (2.4 and newers, I don't 
remember very well) the "alias interface" is a deprecated concept. There 
are network devices (links) that have a binding with 0 or more ip 
addresses. Of course the old tools like ifconfig and route continue to 
working, but they are masking the new framework, and should be replaced 
by the iproute2 tools (ip & tc commands).

try # ip -s link show

You should see only the real links and it's counters.

Maybe you can't see the counters for the "alias interface" because there 
aren't, it's the same device, but have two (or more) ip addresses 
attached to it.

One way to do what you want is to setup the traffic control framework, 
filter the traffic to several qdiscs and use its counters.

It's easy for the outgoing traffic and not too difficult for the 
incoming. See lartc.org.

>> The various rrdtool-manpages are pretty good, though somewhat academic..
>> A little easier to understand could be the `rrdtutorial' by Alex van den
>> Bogaerdt: <http://oss.oetiker.ch/rrdtool/tut/rrdtutorial.en.html>. IIrc
>> the RRDTool homepage has some links to more documentation..
> Thanks, I'll browse around.


More information about the collectd mailing list