On Thursday 26 July 2007 03:31:21 richard grevis wrote:
> Fantastic work Paul, the results are great.

Thanks!

> And you realise that as one adds more graphs and custom
> graphs, one needs a way of managing all the graphs that
> may get thrown at the users.

Yes, indeed.  The more information that's made available through Ganglia, the 
greater the need for something to make a better presentation of the data.  
The standard gmetric graphs (at the bottom of the host view) really don't cut 
it once you've added a few (many hundred!) extra metrics.

> I don't see where the definition of the graphs takes place.
> Is that in MonAMI's GUI?

Hmmm, not really.  MonAMI doesn't have a GUI, just a pretty simple config. 
file.  So, at the risk of going on into detail, here's how it fits together.

For me, the metrics originate from MonAMI.  However, they could come from a 
number of other sources (e.g. gmetric, gmond+DSO, Nick Galbreath's embedded 
metric), so I don't want to be too distracted by this part.  In the interests 
of completeness, an example config. can be found here:

http://monami.cvs.sourceforge.net/monami/external/ganglia/MonAMI-config/torque+maui?view=markup

The current MonAMI docs explain how this works in general.  The CVS version of 
the User Guide describes the new Torque- and Maui- plugins, and has an 
extended section on Ganglia: v0.9 will have all this.

With the PHP code, the core common functionality is contained in the 
file "multiple-graphs.php".  It has three classes: MGBase, MGFrameBase and 
MGRRDGraphBase:

http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/multiple-graphs.php?view=markup

The necessary work splits neatly into two parts: generating RRD graphs and 
generating HTML for the frames.  MGBase has the things common between these 
two parts.  At the moment, this is just some colour definitions.

MGRRDGraphBase extends MGBase.  It supports building an rrdtool command line, 
handing HTML headers (like the MIME type for PNG/PDF/SVG graphs) and 
executing the command line through passthru() cmd.

Actual RRD graphs are supported through individual files (e.g. 
torque-graph.php).  Each file instantiate MGRRDGraphBase and use this object.  
(There didn't seem much point in subclassing MGRRDGraphBase for a single 
use.)  The dpm-graph.php is pretty simple example and shows the useful 
build_series() method, which does a RegExp search for matching metrics and 
stacks the series up:

http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/dpm-graph.php?view=markup

One can also build up custom graphs using methods that map (pretty closely) to 
the underlying RRD commands.  Here's an example:

http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/mysql-graph.php?view=markup

The class MGFrameBase (which extends MGBase) supports emitting the HTML for 
frames.  Calling show_frame() will emit the necessary HTML and the class has 
a method frame_contents() that subclasses should override (its done this way 
because PHP 4 doesn't support abstract methods).  MGFrameBase contains handy 
common code like graph_with_icons(), which emits HTML for the graph along 
with icons for zoomed-, PDF- and SVG- versions.

The actual frame definitions are subclasses of MGFrameBase that override the 
frame_contents() method.  The torque (mg-frame-torque.php) and maui 
(mg-frame-maui.php) files are fairly lengthy, but the MySQL frame is pretty 
simple, so it's easily to see what's happening:

http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/mg-frame-mysql.php?view=markup

To actually use a frame one just instantiates the frame class and execute the 
show_frame() method.

In principle, executing show_frame() could happen in some flexible way (like 
portlets within a web portals) using polymorphism.  However, it's currently 
done by explicitly instantiating and calling show_frame() within the 
host-specific template file (templates/<template>/host_extra_<FQDN>.php).  
Here are some canned examples:

http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/templates/default/frames/torque.php?view=markup
  and
http://monami.cvs.sourceforge.net/monami/external/ganglia/ganglia/templates/default/frames/torque+maui.php?view=markup

So, once the PHP is installed, one can show some frames by simply sym-linking 
host_extra_<FQDN>.php to one of these examples.


> In my previous job there were also multiple distinct classes
> of end user for the graphs - the HPC people, the grid infrastructure
> people, and very much upper IT management who want to see utilisation high
> on the thousands of blades they just bought. Some want lots of detail, some
> don't. Some want a cluster and job driven view and others a more infra
> view.

True, management always like the pretty graphs ;^)

More seriously, managing what graphs to show is a big, big issue and one that 
(I think) is true whenever lots of computers need monitoring.


> Has anyone though of customisal "views" of the underlying data and graphs?

IIRC, there was a discussion a while back about how to do this nicely.  For 
example:

http://www.mail-archive.com/ganglia-developers%40lists.sourceforge.net/msg00063.html

I'm not sure if there's been much progress.

One option would be to extend the current idea of views, so its easier to add 
new ones and define new content.  This could even be through a web-interface. 
where a user could drag-and-drop new graphs and define them on the fly.  Alex 
Balk started work on providing graphs on-the-fly:
  http://wtf.ath.cx/screenshots.html
(link seems dead at the mo.)

I guess one could always hack together a custom view today, by creating a 
(perhaps static) page with the right IMG tags... or by using the above 
framework outside the normal Ganglia environment (which might work, but would 
need some variables set correctly; YMMV).

Cheers,

Paul.

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

Reply via email to