[collectd] data_set_t over the protocol

Florian Forster octo at verplant.org
Sat Apr 4 12:57:08 CEST 2009


Hi Doug,

On Fri, Apr 03, 2009 at 01:25:53PM -0400, Doug MacEachern wrote:
> I see there has been some discussion on the subject:
> http://marc.info/?l=collectd&m=122371735702092
> Interested if there are any new ideas around this esp. with the recent
> edition of the gmond plugin.

I started writing a `netcmd' plugin, basically an extension of the
unixsock plugin to TCP sockets (in addition to the UNIX domain sockets).
My goals were to make is possible to send the `FLUSH' command via
network and to implement SSL / certificate authentication eventually.

One of the central problems when transferring the `data set' over the
network is that you either end up transferring it over and over again,
although the server already knows about the type, or you need
bidirectional communication. The latter is, of course, trivial with a
TCP based communication schema. Since each connection is handled by a
separate thread makes this pretty straight forward to implement:

-- 8< -- communication --
 -> | PUTVAL myhost/someplugin/unknown_type ...
 <- | -1 Unknown type: unknown_type
 -> | DEFINEDS unknown_type ...
 <- | 0 Success
 -> | PUTVAL myhost/someplugin/unknown_type ...
 <- | 0 Success
-- >8 --

The server side could do:
-- 8< -- code --
 handle_putval (type, ...)
 {
   ds = check_local_tree (type);
   if (ds == NULL)
     ds = plugin_get_ds (type);
   if (ds == NULL)
     send_error ("Unknown type: %s", type);
   else
   {
     plugin_dispatch_values_with_ds (ds, ...);
     send_success ();
   }
 }
-- >8 --
 
Since that `netcmd' code isn't done, I don't want to pull it into
`master' yet. But if you're interested in starting from there I can of
course push that into some other branch on git.verplant.org..

Regards,
-octo
-- 
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/20090404/bc5eb2f6/attachment.pgp 


More information about the collectd mailing list