On Wed, Mar 26, 2008 at 1:27 PM, Miah, W (Wadud) <[EMAIL PROTECTED]> wrote:
> I am monitoring a custom metric using the gmetric command and plots for
> this metric appear under the host. However, I would like the plot of
> this metric to appear under the meta view of the grid. Does anyone know
> where I can obtain information that will allow me to acheive this? The
> PHP code looks complicated and wondered if this is documented somewhere.
It isn't overly difficult. Most of the HTML for the webpages is
handled using a template system. The template files are stored in
web/templates/default, and you can make whatever changes to those you
think are needed for your local installation. In fact, for one of my
production installs, I've done exactly what you are asking about, but
using the "network report" instead of a custom metric. Here's a diff
of my changes against the current SVN trunk. You didn't mention the
version you are using, but I don't believe that this code has changed
much recently, so you should be okay.
<---snip--->
Index: templates/default/meta_view.tpl
===================================================================
--- templates/default/meta_view.tpl (revision 1126)
+++ templates/default/meta_view.tpl (working copy)
@@ -1,8 +1,8 @@
-<TABLE BORDER="0" WIDTH="100%">
+<TABLE BORDER="2" >
<!-- START BLOCK : source_info -->
<TR>
- <TD CLASS={class} COLSPAN=3>
+ <TD CLASS={class} COLSPAN=4>
<A HREF="{url}"><STRONG>{name}</STRONG></A> {alt_view}
</TD>
</TR>
@@ -33,6 +33,13 @@
ALT="{name} MEM" BORDER="0">
</A>
</TD>
+
+ <TD VALIGN=top align=left>
+ <A HREF="{url}" VALIGN=top>
+ <IMG SRC="./graph.php?{graph_url}&g=network_report&z=medium&r={range}"
+ ALT="{name} MEM" BORDER="0">
+ </A>
+ </TD>
<!-- END BLOCK : public -->
<!-- START BLOCK : private -->
<---snip--->
The important part is the <IMG> tag. That calls the actual graphing
routines. For a custom metric, you will probably want to use
something like this, instead of the network_report entry above:
graph.php?m=sys_temp
Note, however, that this will plot the *SUM* of all of those metrics,
across all hosts. There are two alternatives to this:
1) Modify the URL for a specific graph, for a specific metric, on a
specific host, and use that in the template file. You'll wind up with
something like this:
http://webserver.example.com/ganglia/graph.php?c=YOURCLUSTERNAME&h=YOURHOSTNAMEHERE&m=YOURMETRIC&z=medium&vl=YOURMETRICUNITS
2) Create a custom report, like the "network_report", and link to it.
Usually the reports are designed to show aggregate information (as is
displayed in the meta_view). This is significantly easier in the SVN
trunk code, but also possible by making changes to the graph.php file.
If you go with option #2, feel free to post questions to the list
about how to make the reports.
--
Jesse Becker
GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ganglia-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-general