[collectd] Collecting more detail network statistics

Ulf Zimmermann ulf at openlane.com
Tue Mar 3 18:44:28 CET 2009


> > On Mon, 02 March 2009 "Ulf Zimmermann" <ulf at openlane.com> wrote:
> > > > > 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.
> > >
> > > Hmmm, netlink is a problem under RedHat EL4 so far. Can't find a
> > > libnetlink for it so far.
> > >
> > If RedHat is doing things similar to (Open)SuSE then the netlink
> > package might even be named differently if available.
> >
> > For OpenSuSE I was missing netlink library as well but it did show up
> > starting with 11.0 (libnlink) and 11.1 (libnetlink-devel)...
> >
> > For Gentoo the static library is not being installed either but it's
> > pretty easy to fix with slightly modified ebuild.
> >
> > Bruno
> 
> Ok, here is what I did:
> 
> Downloaded iproute-2.6.9-4.EL4.src.rpm from rhn.redhat.com
> Installed into my rpmbuild directory
> Copied the iproute.spec file to libnetlink.spec
> Changed the "Name: " to libnetlink
> Changed under the %install section to only create the %{_includedir}
> and %{_libdir}
> Changed under the %install section to only install lib/libnetlink.a and
> include/libnetlink.h
> Changed under %files that only %{_includedir}/* and %{_libdir}/* are
> getting included
> Removed most comments and replaced it with a based on iproute-2.6.9-
> 4.EL4 to just build/package libnetlink
> 
> This let collectd configure with libnetlink and I am going to build a
> rpm now and test it on a machine.

And this unfortunately fails:

/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -DPREFIX='"/usr"' -DCONFIGFILE='"/etc/collectd.conf"' -DLOCALSTATEDIR='"/usr/var"' -DPKGLOCALSTATEDIR='"/usr/var/lib/collectd"' -DPIDFILE='"/usr/var/run/collectd.pid"' -DPLUGINDIR='"/usr/lib/collectd"' -DPKGDATADIR='"/usr/share/collectd"'  -Wall -Werror  -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL' -MT netlink_la-netlink.lo -MD -MP -MF .deps/netlink_la-netlink.Tpo -c -o netlink_la-netlink.lo `test -f 'netlink.c' || echo './'`netlink.c
 gcc -DHAVE_CONFIG_H -I. -DPREFIX=\"/usr\" -DCONFIGFILE=\"/etc/collectd.conf\" -DLOCALSTATEDIR=\"/usr/var\" -DPKGLOCALSTATEDIR=\"/usr/var/lib/collectd\" -DPIDFILE=\"/usr/var/run/collectd.pid\" -DPLUGINDIR=\"/usr/lib/collectd\" -DPKGDATADIR=\"/usr/share/collectd\" -Wall -Werror "-DLT_LAZY_OR_NOW=RTLD_LAZY|RTLD_GLOBAL" -MT netlink_la-netlink.lo -MD -MP -MF .deps/netlink_la-netlink.Tpo -c netlink.c  -fPIC -DPIC -o .libs/netlink_la-netlink.o
netlink.c: In function `link_filter':
netlink.c:281: error: dereferencing pointer to incomplete type
netlink.c:281: error: dereferencing pointer to incomplete type
netlink.c:282: error: dereferencing pointer to incomplete type
netlink.c:282: error: dereferencing pointer to incomplete type
netlink.c:283: error: dereferencing pointer to incomplete type
netlink.c:283: error: dereferencing pointer to incomplete type
netlink.c:292: error: dereferencing pointer to incomplete type
netlink.c:292: error: dereferencing pointer to incomplete type
netlink.c:293: error: dereferencing pointer to incomplete type
netlink.c:294: error: dereferencing pointer to incomplete type
netlink.c:296: error: dereferencing pointer to incomplete type
netlink.c:297: error: dereferencing pointer to incomplete type
netlink.c:298: error: dereferencing pointer to incomplete type
netlink.c:299: error: dereferencing pointer to incomplete type
netlink.c:300: error: dereferencing pointer to incomplete type
netlink.c:301: error: dereferencing pointer to incomplete type
netlink.c:303: error: dereferencing pointer to incomplete type
netlink.c:304: error: dereferencing pointer to incomplete type
netlink.c:305: error: dereferencing pointer to incomplete type
netlink.c:306: error: dereferencing pointer to incomplete type
netlink.c:307: error: dereferencing pointer to incomplete type
netlink.c: In function `ir_read':
netlink.c:576: warning: passing arg 2 of `rtnl_dump_filter' from incompatible pointer type
netlink.c:614: warning: passing arg 2 of `rtnl_dump_filter' from incompatible pointer type
make[3]: *** [netlink_la-netlink.lo] Error 1
make[3]: Leaving directory `/home/ulf/rpmbuild/BUILD/collectd-4.6.1/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/ulf/rpmbuild/BUILD/collectd-4.6.1/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/ulf/rpmbuild/BUILD/collectd-4.6.1/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.94818 (%build)

Back to the drawing board.



More information about the collectd mailing list