>>> On 10/6/2008 at 2:23 PM, in message
<[EMAIL PROTECTED]>, Martin Hicks <[EMAIL PROTECTED]>
wrote:

> On Mon, Oct 06, 2008 at 11:11:51AM -0600, Brad Nicholes wrote:
>> >>> On 10/3/2008 at 12:23 PM, in message
>> > 
>> > Am I expected to deal with each SPOOF_HOST when a call_back occurs
>> > for a particular metric name?
>> > 
>> > I kind of expected SPOOF_NAME to be in the 'name' argument of the
>> > call_back.
>> > 
>> 
>> For the spoof modules that I wrote, I appended the host name to the
>> name of the metric and used it as a unique metric identifier
>> 
>> metric_name = name + ':' + host_name
>> 
>> Then in the handler I just call 
>> 
>> metric_keys = name.split(':')
>> 
>> and I end up with an array that uniquely identifies which metric for
>> which host.  Finally, to make sure that the concatenation of the
>> metric_name:host_name does not show up in the front end as the title
>> of the graph, I make sure to assign a title to the metric in the
>> gmond.conf file.
>> 
>> This is just one way to uniquely identify any spoofed metric.  Since
>> gmond has no idea what a metric module is doing or what naming
>> convention is being used, it simply leaves all of that up to the
>> module itself rather than trying to enforce some policy.
> 
> Does this not also mean I need to know at gmond start-up time which
> hosts the module will be spoofing for and rewrite
> /etc/ganglia/conf.d/<module>.pyconf to reflect the list of nodes that
> will need to be spoofed?
> 

No.  Sorry, the colon separated name/id actually has more significance than I 
stated previously.  The metric_name:host_name is actually a derivative of the 
same style used by gmetric in the --spoof=STRING parameter.  Part of the patch 
to gmond.c was to add a function called get_metric_names() which for a spoofed 
metric, specifically looks for a colon separated metric name, pulls the first 
name from the string and uses that to match against the name that is referenced 
in the gmond.conf file.  So for example if your metric name is "my_foo_metric" 
then the name that is referenced in gmond.conf should also be "my_foo_metric".  
But the name that your module actually assigns as the metric name in the metric 
definition structure should be "my_foo_metric:some_host_or_other_id".  This 
needs to be documented in the README.in file that explains how to write a 
python metric module.  I also plan on adding this same documentation to the 
wiki once the patch has been backported.

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-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to