Just $.02 from the peanut gallery, but we use longer strings from gmetric (on
3.0) all the time, especially for reporting the versions of our gmetric-based
sensing scripts. Since we use p4 (which, like svn, keeps its branch names near
the root), they're pretty long (e.g.,
"//depot/main/platform/ops/scripts/ganglia/ganglia-snmp#11"). Restrictions to
short values are now another entry on the list of reasons for us to avoid the
plug-in strategy and continue to use external sensing scripts.
-- ReC
On 11/21/08 10:27 AM, "Brad Nicholes" <[EMAIL PROTECTED]> wrote:
>>> On 11/21/2008 at 8:24 AM, in message <[EMAIL PROTECTED]>,
Matt Jamison <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm building some custom C metric modules for gmond, and I've run into what
> seems like a strange limitation on the length of values for string type
> metrics. Perhaps I'm just missing some magic, but it appears I'm limited to
>
> returning 32 characters for the value, due to the size
> of "MAX_G_STRING_SIZE". I say this is strange to me, because I can return
> much larger messages via the gmetric command line utility, seemingly
> indicating that the protocol/messages are capable of holding much more...
>
> Any pointers on returning larger strings via a custom module, or maybe an
> explanation on this limitation to satisfy my curiosity?
>
This is actually an interesting question now that I have gone back to look at
the source code. Originally it had to do with limiting the XDR packet size.
The length of a string value metric was never meant to be very large. Values
returned as strings were meant to be small pieces of information such as the OS
name or something like that. So when the XDR packets (the platform independent
data packets that are passed between gmond's) were defined, the max string
length was set to 32. The base XDR packet definition was done early in the
ganglia development and has just carried over into later versions. This
carried over into the definition of the g_val_t structure which is the
structure that is used to pass data between the metric functions or modules
back to gmond. However after looking at the XDR definitions again, I am not
seeing the 32 byte limitation in the structure definition which is probably why
you are able to pass larger strings through gmetric. Gmetric doesn't have to
pass the metric value through a g_val_t structure before it is loaded into an
XDR value packet therefore the string isn't limited by MAX_G_STRING_SIZE.
Anyway, this is probably something that needs to be looked at closer in a
future version of Ganglia. There might still be a reason for the 32 byte
limit, but I am not seeing it other than the limitation of the g_val_t
structure.
Brad
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers