>>> On 10/18/2007 at 7:16 PM, in message <[EMAIL PROTECTED]>,
Klaus Steden <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> I am investigating implementing some custom metrics in ganglia for use with
> greceptor, specifically, to monitor hardware attributes.
> 
> It looks straightforward, but I think I've hit a bit of a wrinkle. I've got
> systems in my cluster that are slightly assymetrical (i.e. some have two
> CPUs, some have only one CPU) -- which means that I would need to make two
> copies of my very simple greceptor plugin -- one for CPU 0, and one for CPU
> 1, and hardwire the specific CPU information into each one.
> 
> This is not really ideal, as that means I have to do a hardware inventory on
> a system-by-system basis to avoid creating more scripts than CPUs, or fewer
> scripts than CPUs.
> 
> What would be ideal would be if I reference CPU information as generic
> variables in the plugin, and it would be able to call each CPU individually
> and return numbers to ganglia, i.e.
> 
> -- cut --
> def value(self):
>     cmd = 'read-cpu-temp %i' % cpu_id
>     temp = os.popen(cmd).readline()
>     return int(temp)
> -- cut --
> 
> The question is ... is it possible to pass the CPU identity into the
> 
> 
> 
> Is such a thing possible?
> 
> I looked through Google and the ganglia-info list archives and couldn't find
> any mention of it. Is there some documentation on greceptor plugins?
> 

If you are talking about creating a python metric module then the answer to 
your question is 'yes'.  In the metric_init() function, you will need to 
discover the hardware and then dynamically create a metric descriptor for each 
element.  Then within your metric_handler() function, determine which element 
is being requested and return the value.  Take a look at the multidisk.py 
module at 
http://ganglia.svn.sourceforge.net/viewvc/ganglia/trunk/monitor-core/gmond/python_modules/disk/multidisk.py?revision=846&view=markup
 .  It discovers all of the hard drives on the box and dynamically creates a 
metric descriptor for each one.  Then it returns various metrics depending on 
the drive metric that is requested.

Brad



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to