Re: [Ganglia-developers] ganglia.h cannot be compiled with C++

2011-04-19 Thread Kazuki Ohta
Hi, Bemard

Thanks for the reply. Wrapping in C first, and use them will work for C++
application, but not ideal solution.

On Tue, Apr 19, 2011 at 2:48 AM, Bernard Li bern...@vanhpc.org wrote:
 Hi Kazuki:

 On Mon, Apr 18, 2011 at 1:30 AM, Kazuki Ohta k...@preferred.jp wrote:

 I'm now trying to implement C++ server, with native Ganglia metrics support.
 The server throws to local gmond with its own metrics.

 [kzk@red0 tmp]$ ganglia-config --version
 Ganglia 3.1.7

 However, ganglia.h cannot be compiled with g++, becuase of the typedef 
 problem.
 https://gist.github.com/924982

 Not sure if this is helpful to you, but we have some documentation on
 how to write gmond C modules (and Python modules) here:

 https://sourceforge.net/apps/trac/ganglia/wiki

 Good luck,

 Bernard





-- 
--
Kazuki Ohta: http://kzk9.net/

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] ganglia.h cannot be compiled with C++

2011-04-19 Thread Bernard Li
Hi Kazuki:

On Mon, Apr 18, 2011 at 11:52 PM, Kazuki Ohta k...@preferred.jp wrote:

 Thanks for the reply. Wrapping in C first, and use them will work for C++
 application, but not ideal solution.

The documentation I provided is for writing gmond C modules, however
we do support writing modules in C++ at least according to the release
notes:

http://sourceforge.net/apps/trac/ganglia/wiki/ganglia_release_notes#GangliaRelease3.1.1

Perhaps you can use the guide and try writing a C++ module and see if
you can make it work?

I also found this thread, perhaps it will come in handy:

http://www.mail-archive.com/ganglia-developers@lists.sourceforge.net/msg05278.html

On the other hand, it looks like you're trying to write a C++ program
using ganglia header files, that is not the same as writing a C++
gmond module.  You need to figure out whether writing a module will
work in your case.

Good luck,

Bernard

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


[Ganglia-developers] let Grid and Cluster Load graphs at the web 2.0 interface lock like at the old interface

2011-04-19 Thread Markus Köberl
Attached is a patch to let the Grid and Cluster Load graphs lock like at the 
old interface.

Add possibility to define a custom data source in the json template with DS 
which will get used instead of the default 'sum'. To handle situations where 
the data source is not available in all rrds define the context.

For example the number of Nodes:
data source 'num' only available in the summary rrds of 'cpu_num'
definition in the json template looks like:
{ metric: cpu_num, color: 00FF00, label: Nodes, line_width: 2, 
type: line, DS: num, context: 
{ cluster: true, meta: true } }
The metric will get ignored at the host context but not at the meta and 
cluster context.


Markus
-- 
Markus Köberl
Graz University of Technology
Signal Processing and Speech Communication Laboratory
E-mail: markus.koeb...@tugraz.at
Index: graph.d/load_report.json
===
--- graph.d/load_report.json	(revision 2574)
+++ graph.d/load_report.json	(working copy)
@@ -5,6 +5,8 @@
vertical_label : Loads/Procs,
series : [
   { metric: load_one, color: BB, label: 1-min, type: stack },
+  { metric: cpu_num, color: 00FF00, label: Nodes, line_width: 2, type: line, DS: num, context: { cluster: true, meta: true } },
+  { metric: cpu_num, color: FF, label: CPUs, line_width: 2, type: line },
   { metric: proc_run, color: 2030F4, label: Procs, line_width: 2, type: line }
]
 }
Index: functions.php
===
--- functions.php	(revision 2574)
+++ functions.php	(working copy)
@@ -870,7 +870,10 @@

   // Loop through all the graph items
   foreach( $graph_config[ 'series' ] as $index = $item ) {
-
+ // ignore item if context is not defined in json template
+ if ( $item[ 'context' ] and $item[ 'context' ][ $context ] == false )
+ continue;
+
  $rrd_dir = $conf['rrds'] . / . $item['clustername'] . / . $item['hostname'];

  $metric = sanitize( $item[ 'metric' ] );
@@ -884,8 +887,14 @@
   $unique_id = a . $index;

$label = str_pad( sanitize( $item[ 'label' ] ), $max_label_length );
-   $series .=  DEF:'$unique_id'='$metric_file':'sum':AVERAGE ;
-
+
+   // use custom DS defined in json template (default = 'sum')
+   $DS = sanitize( $item[ 'DS' ] );
+   if($DS!='')
+   $series .=  DEF:'$unique_id'='$metric_file':'$DS':AVERAGE ;
+   else
+   $series .=  DEF:'$unique_id'='$metric_file':'sum':AVERAGE ;
+
// By default graph is a line graph
isset( $item['type']) ? $item_type = $item['type'] : $item_type = line;
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] (no subject)

2011-04-19 Thread saurabh verma
Read the documentations. 

On 19-Apr-2011, at 8:36 PM, aahan noor wrote:

 Hi
 i am new to ganglia. i need to know from where i can get help of my several 
 questions regarding ganglia.my 1st question is that what is the task 
 of gmond module which is written in c, how gmond config file and module is 
 connected.?
 
 and 2nd question is that in linux operating system, in which directory 
 gmond module is located?
 
 
 waiting for yours favour
 --
 Benefiting from Server Virtualization: Beyond Initial Workload 
 Consolidation -- Increasing the use of server virtualization is a top
 priority.Virtualization can reduce costs, simplify management, and improve 
 application availability and disaster protection. Learn more about boosting 
 the value of server virtualization. 
 http://p.sf.net/sfu/vmware-sfdev2dev___
 Ganglia-developers mailing list
 Ganglia-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ganglia-developers

--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers


Re: [Ganglia-developers] let Grid and Cluster Load graphs at the web 2.0 interface lock like at the old interface

2011-04-19 Thread Alex Dean

On Apr 19, 2011, at 9:59 AM, Markus Köberl wrote:

 On Tuesday 19 April 2011, Alex Dean wrote:
 On Apr 19, 2011, at 8:34 AM, Markus Köberl wrote:
 { metric: cpu_num, color: 00FF00, label: Nodes, line_width:
 2, type: line, DS: num, context: { cluster: true, meta:
 true } }
 
 This seems like a good idea to me.
 
 What about formatting like this:
 { metric: cpu_num, color: 00FF00, label: Nodes, line_width:
 2, type: line, DS: num, contexts: [cluster, meta] }
 
 You could implement with:
 if ( isSet($item[ 'contexts' ])  array_key_exists($context,
 $item['contexts']) ) { continue;
 }
 
 The context names seem like data here, not keys, so I just thought an array
 might be more appropriate.
 
 Yes, it is much simpler now.
 
 Markus

Ah, yeah, especially since my suggested change implemented the opposite of your 
idea. Oops. :)

Also, I'm remembering to reply to everyone this time.

alex
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers