yujun wu-

steve's message to you is right on target as far as the security of gmond 
and using telnet to get the data.

the reason gmond exports information in XML is because there is an XML 
parser available for just about every programing language on the planet.  
that makes it easy to build cool cluster/grid apps in your favorite 
language.  java is a great choice.

greg bruno of n.p.a.c.i. rocks created a great python class and client 
which imports data from gmond.  is it possible you will be the ganglia 
java star?  if you build a ganglia java class, all i can promise is your 
name in lights.

if you look at the beginning of the gmond output you will see the XML DTD.
----------------------------------------------------------
<!DOCTYPE GANGLIA_XML [
   <!ELEMENT GANGLIA_XML (CLUSTER)+>
   <!ATTLIST GANGLIA_XML VERSION CDATA #REQUIRED
                         SOURCE  CDATA #REQUIRED>
   <!ELEMENT CLUSTER (HOST)+>
   <!ATTLIST CLUSTER NAME  CDATA #REQUIRED
                     LOCALTIME CDATA #REQUIRED>
   <!ELEMENT HOST (METRIC)+>
   <!ATTLIST HOST NAME     CDATA #REQUIRED
                  IP       CDATA #REQUIRED
                  REPORTED CDATA #REQUIRED
                  GMOND_STARTED CDATA #REQUIRED>
   <!ELEMENT METRIC EMPTY>
   <!ATTLIST METRIC NAME   CDATA #REQUIRED
                    VAL    CDATA #REQUIRED
                    TYPE (string|int8|uint8|int16|uint16|
                          int32|uint32|float|double) #REQUIRED
                    UNITS CDATA #IMPLIED
                    SOURCE (gmond|gmetric) #REQUIRED>
]>
---------------------------------------------------
this DTD tells you exactly what to expect as far as XML 
elements/attributes etc.  if the XML spec ever changes, the DTD will be 
your first clue as to how to adapt.

*** each cluster opens with the following (e.g.)

<CLUSTER NAME="My Cluster or whatever" LOCALTIME="1026752221">

simple.  the NAME attribute tells you which cluster the data comes from
(this is set in /etc/gmond.conf).  the LOCALTIME attribute tells you
exactly what time the ganglia XML report was generated.  this timestamp is
important because it's used to determine whether a HOST is down or up (it
also allows you to deal with clusters across multiple timezones).

   ***  each host opens with the following (e.g.)

  <HOST NAME="mynode.mydomain" IP="1.1.1.1" REPORTED="1026752213" 
                               GMOND_STARTED="1026499449">

   the attributes NAME and IP should be easy to understand.  the REPORTED 
   attribute tells you the last time the reporting gmond heard from the 
   host.   so when you subtract this REPORTED timestamp from the CLUSTER 
   LOCALTIME timestamp you get the "number of seconds elapsed since i've heard 
from 
   this host".. we'll call it delta.  this delta is used to determine if a 
   host is up or down.  hosts send out heartbeat messages every 15 seconds 
   so if a delta value is greater than 60 seconds you can be pretty sure that 
   the host is down.  

      *** nested inside each host is a list of METRIC elements.

make sense?  i'd be happy to answer any questions.

-matt

Yesterday, Yujun_Wu wrote forth saying...

> Dear Ganglia Experts:
> 
> Could somebody give me some help?
> 
> I am working on getting the monitoring info out of ganglia and put them
> into a grid-level monitoring tool. I find I can do this in three ways
> after browsing the ganglia documentation:
> 
> 1. telnet remote.cluster.nodename 8649
> 
> 2. gstat
> 
> 3. through rrdb
> 
> The first one (using telnet) gives the richest monitoring
> information and gstat only provides limited info. However, we
> are discouraged from using telnet for security reasons. And I
> am a little bit unwilling to get info through rrdb. Could
> somebody tell me what's the best way to get info out of ganglia
>  and put them into a grid-level monitoring tool? Is there a tool
> similar to gstat that offers richer monitoring info similar to
> the info I get through telnet.
> 
> I am using JAVA as the programming language.
> 
> Thanks in advance for your help.
> 
> Yujun
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Ganglia-general mailing list
> Ganglia-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ganglia-general
> 


Reply via email to