[collectd] tcpconns plugin: Trouble under *BSD?

Doug MacEachern Doug.MacEachern at hyperic.com
Thu Jan 15 02:33:31 CET 2009


I haven't run collectd on *BSD yet, but I can confirm this is the case.
The sigar library has an api that provides the same data as the tcpconns
plugin, the impls are likely similar.
This was the initial OpenBSD port:
http://svn.hyperic.org/trunk/src/os/darwin/darwin_sigar.c?root=Hyperic+S
IGAR&r1=3632&r2=3633
Notice:
conn.local_port  = ntohs(inpcb.inp_lport);
conn.remote_port = ntohs(inpcb.inp_fport);

When we ported to NetBSD the same code applies.  And, the #else for
FreeBSD + Darwin also converts via ntohs.  Btw one of these days I'll
get around to patching collectd to make use of libsigar :)

> -----Original Message-----
> From: collectd-bounces at verplant.org [mailto:collectd-
> bounces at verplant.org] On Behalf Of Florian Forster
> Sent: Tuesday, January 13, 2009 9:49 AM
> To: collectd at verplant.org
> Subject: [collectd] tcpconns plugin: Trouble under *BSD?
> 
> Hi,
> 
> ``thated'' reports a problem [0] with the tcpconns plugin under
> FreeBSD/x86 (the architacture I assume). She/he writes, that the port
> numbers are stored in big endian byte order (which is a problem only
on
> little endian systems, hence my guess on the architecture).
> 
> The consequence would be, that instead of port 25 (SMTP, one of the
> example ports) == 0x0019, port 6400 == 0x1900 would be used as
instance
> name by collectd.
> 
> I can verify (but haven't done yet) this problem under FreeBSD, but
> sadly that's all the BSDs I have access to. Could anyone on the list
> try the plugin on a little endian *BSD machine and let me know if it
> worked or not? It'd be much apprechiated :)
> 
> Regards,
> -octo
> 
> [0] <http://collectd.org/mantis/view.php?id=35>
> --
> Florian octo Forster
> Hacker in training
> GnuPG: 0x91523C3D
> http://verplant.org/



More information about the collectd mailing list