Hi all:

Was finally able to setup Ganglia + Graphite integration on a Joyent
SmartMachine instance.  You can see a demo of it here:

http://fjrkr5af.joyent.us/gweb-2.0/

I had to apply the following patch to get it going:

Index: graph.php
===================================================================
--- graph.php   (revision 2550)
+++ graph.php   (working copy)
@@ -321,13 +321,17 @@
     // area
     if ( ! is_link($rrd_graphite_link) ) {
       // Does the directory exist for the cluster. If not create it
-      if ( ! is_dir ($conf['graphite_rrd_dir'] . "/" . $clustername) )
-        mkdir ( $conf['graphite_rrd_dir'] . "/" . $clustername );
-      symlink($rrd_dir, $rrd_graphite_link);
+      if ( ! is_dir ($conf['graphite_rrd_dir'] . "/" . str_replace("
", "_", $clustername)) )
+        mkdir ( $conf['graphite_rrd_dir'] . "/" . str_replace(" ",
"_", $clustername ));
+      symlink($rrd_dir, str_replace(" ", "_", $rrd_graphite_link));
     }

     // Generate host cluster string
-    $host_cluster = $clustername . "." . $host;
+    if ( isset($clustername) ) {
+      $host_cluster = str_replace(" ", "_", $clustername) . "." . $host;
+    } else {
+      $host_cluster = $host;
+    }

     $height += 70;

@@ -386,8 +390,12 @@
       }

     } // end of if ( ! isset($graph_config) ) {
-
-    $graphite_url = $conf['graphite_url_base'] .
"?width=$width&height=$height&" . $target . "&from=" . $start .
"&yMin=0&bgcolor=FFFFFF&fgcolor=000000&title=" . urlencode($title . "
last " . $range);
+
+    if (preg_match('/^-/', $start)) {
+      $graphite_url = $conf['graphite_url_base'] .
"?width=$width&height=$height&" . $target . "&from=" . $start .
"s&yMin=0&bgcolor=FFFFFF&fgcolor=000000&title=" . urlencode($title . "
last " . $range);
+    } else {
+      $graphite_url = $conf['graphite_url_base'] .
"?width=$width&height=$height&" . $target . "&from=" . $start .
"&yMin=0&bgcolor=FFFFFF&fgcolor=000000&title=" . urlencode($title . "
last " . $range);
+    }
     break;

 } // end of switch ( $conf['graph_engine'])

Vladimir -- if $start is "-xxx" then it needs "s" appended otherwise
it will give:

Exception Value:        Invalid offset unit ''

Not sure if this is a bug with Graphite or not?  I was using the
latest version 0.9.8.

In case anybody wants a writeup on how to get things installed, I
could give it a try at the Wiki.

Cheers,

Bernard

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to