From: Brad N. <BNI...@no...> - 2009-03-31 17:12:36
|
>>> On 3/31/2009 at 9:56 AM, in message <49D...@hp...>, Mark Seger <Mar...@hp...> wrote: > > This then leads to my question, which is what is the best way to send > data to ganglia. I want to keep my messages very dense and so we chose > to simply send out binary data in the same format gmond expects. In the > case of pnnl, where they have a monitoring hierarchy, we've completely > replaced all the monitoring gmonds with a dozen that act only as > aggregators. There are about 190 nodes running collectl sending UPD > messages to each aggregator gmonds and it seems to run just fine. Does > this make sense? Is there anything to watch out for? > > If anyone else is interested in trying this out while we're shaking out > the code, I'd be happy to share some pre-release code with a few people. > Which version of Ganglia are you targeting (3.0.x or 3.1.x). Ganglia uses XDR to pack and unpack the metric packets. However the actual format changed significantly between 3.0.x and 3.1.x. You can see the XDR packet layout in the file lib/protocol.x for 3.0.x or lib/gm_protocol.x for 3.1.x. The 3.1.x version is a bit more complex than the 3.0.x version. The 3.0.x version is a very simple XDR packet that basically contains a metric ID and a value. Gmond 3.0.x can get away with just sending an ID in the packet because every 3.0.x gmond hardcodes the metric metadata. Gmond 3.1.x made this more flexible by splitting the packets in to metadata and value packets. Probably the easiest way to communicate directly with gmond is to use the message creation and sending APIs that are part of the ganglia library. Take a look at the gmetric utility code for an example of how to use these APIs. Gmetric is basically doing what you want to do but as a standalone utility. For Ganglia 3.0.x you will have to include lib/ganglia.h, for Ganglia 3.1.x you will include include/ganglia.h. The libraries for Ganglia 3.1.x version have been made a little more developer friendly by putting the public headers in the include/ directory and converting the library to be a .so rather than static. Brad |