Hi Igor, unless you want to rewrite "gmetad" completely, this is the way to query the "database". Basically port 8651 gives you everything, while 8652 allows to do specific queries. Not sure where/whether the query mechanism is actually documented outside the "gmetad" sources. You can have a look at how the web-frontend uses port 8652.
Cheers Martin ------------------------------------------------------ Martin Knoblauch email: k n o b i AT knobisoft DOT de www: http://www.knobisoft.de ----- Original Message ---- > From: Igor Rosenberg <[EMAIL PROTECTED]> > To: "Hu, Wenzhong " <[EMAIL PROTECTED]> > Cc: [email protected] > Sent: Wednesday, May 7, 2008 9:54:57 AM > Subject: Re: [Ganglia-general] Is there any APIs or DB data I can use to > getmetrics? > > Hi > Well, I looked for a way to make sure ganglia was working. The doc suggests > polling these interfaces with telnet. Then I understood this only was opening > a > socket. I decided to make my own in java when I counld't find any existing > example. But I'm not sure it's the best way. I am quite certain there must be > a > way to perform database queries directly. > Best > Igor > > -----Original Message----- > From: Hu, Wenzhong [mailto:[EMAIL PROTECTED] > Sent: miƩrcoles, 07 de mayo de 2008 5:01 > To: Igor Rosenberg > Cc: [email protected] > Subject: RE: [Ganglia-general] Is there any APIs or DB data I can use to > getmetrics? > > Thanks Igor, > > How did you find out this method? It's quite amazing. > > I will try it on other versions if I have time. And maybe somebody somewhere > can > try on other versions also, hopefully :) > > Regards, > Stephen > > -----Original Message----- > From: Igor Rosenberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 06, 2008 9:57 PM > To: Hu, Wenzhong [CMB-IT] > Cc: [email protected] > Subject: RE: [Ganglia-general] Is there any APIs or DB data I can use to > getmetrics? > > > Hello, > I've also come upon the same need, and have resolved (by lack of > information) to polling directly the gmetad. My solution works for > version 3.0.6, I've never tested any other. You can connect a socket to > ports 8651 and 8652 of the machine running gmetad (I don't know what is > the difference between both ports). You receive an XML file of the last > status monitored. The schema of the result is provided within the > answer. I've attached sample output to this mail (one Grid containing > one cluster containing one machine). To test the gmetad output yourself, > see it running > telnet ip 8651 > where ip is the IP of the machine running gmetad > > If you speak java, you may use ganglia in your programs modifying the > following code snippet : > > /** > * Get a reader on the Ganglia output, whihc you can then parse > with your prefered XML parser > * @see > http://www.mail-archive.com/[EMAIL PROTECTED]/msg > 03642.html > **/ > protected BufferedReader openGangliaSocket() throws > UnknownHostException, IOException { > String gangliaHost ="192.168.1.2"; > int gangliaPort = 8651; > String socketCall = ""; // another poll string can be > something matching "/GRIDNAME/MACHINENAME/METRIC" > System.out.println("Polling socket " + gangliaHost + ":" > + gangliaPort + > ", cmd = " + > socketCall); > Socket gangliaSocket = new Socket(gangliaHost, > gangliaPort); > PrintWriter gangliaWriter = new > PrintWriter(gangliaSocket.getOutputStream(), true); > gangliaWriter.println(socketCall); > BufferedReader gangliaReader; > gangliaReader = new BufferedReader( new > InputStreamReader(gangliaSocket.getInputStream()) ); > return gangliaReader; > } > > Hope that helps somebody somewhere :) > > Igor > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Hu, > Wenzhong > Sent: lunes, 05 de mayo de 2008 15:04 > To: Carlo Marcelo Arenas Belon > Cc: [email protected] > Subject: Re: [Ganglia-general] Is there any APIs or DB data I can use to > getmetrics? > > Hi Carlo, > > Your explanation is very clear. Now I know where I should start. > > Thanks very much indeed. > Stephen > > -----Original Message----- > From: Carlo Marcelo Arenas Belon [mailto:[EMAIL PROTECTED] > Sent: Monday, May 05, 2008 7:30 PM > To: Hu, Wenzhong [CMB-IT] > Cc: Ron Wellnitz; [email protected] > Subject: Re: [Ganglia-general] Is there any APIs or DB data I can use to > get metrics? > > > On Mon, May 05, 2008 at 06:11:51PM +0800, Hu, Wenzhong wrote: > > > > What I need is the rrdtool schema or something for Ganglia :) > > rrdtool is a time series database, so there is technically no such thing > as a > "schema" (like you would expect on a relational database), as each > metric is > stored in an independent file (of fixed size and continuously doing > summarizations), and the cluster is represented by a directory tree on > disk. > > the definition of which and how many "buckets" (known as RRAs) to have > for > each metric is done in the code for gmetad (check gmetad/conf.c) and can > be > overridden through its configuration (check gmetad/gmetad.conf). > > > Anyway, I've never used rrdtool before. So the link you sent is of > great help also. > > `rrdtool dump` or `rrdtool xport` could be used as a starting point. > > Carlo > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/j > avaone > _______________________________________________ > Ganglia-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ganglia-general > > ------------------------------------------------------------------ > This e-mail and the documents attached are confidential and intended solely > for the addressee; it may also be privileged. If you receive this e-mail > in error, please notify the sender immediately and destroy it. > As its integrity cannot be secured on the Internet, the Atos Origin group > liability cannot be triggered for the message content. Although the > sender endeavours to maintain a computer virus-free network, the sender does > not warrant that this transmission is virus-free and will not be liable for > any damages resulting from any virus transmitted. > > Este mensaje y los ficheros adjuntos pueden contener informacion > confidencial destinada solamente a la(s) persona(s) mencionadas > anteriormente. Pueden estar protegidos por secreto profesional Si usted > recibe este correo electronico por error, gracias de informar inmediatamente > al remitente y destruir el mensaje. > Al no estar asegurada la integridad de este mensaje sobre la red, Atos > Origin no se hace responsable por su contenido. Su contenido no constituye > ningun compromiso para el grupo Atos Origin, salvo ratificacion escrita por > ambas partes. > Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor > no puede garantizar nada al respecto y no sera responsable de cualesquiera > danos que puedan resultar de una transmision de virus > ------------------------------------------------------------------ > > > ------------------------------------------------------------------ > This e-mail and the documents attached are confidential and intended solely > for the addressee; it may also be privileged. If you receive this e-mail > in error, please notify the sender immediately and destroy it. > As its integrity cannot be secured on the Internet, the Atos Origin group > liability cannot be triggered for the message content. Although the > sender endeavours to maintain a computer virus-free network, the sender does > not warrant that this transmission is virus-free and will not be liable for > any damages resulting from any virus transmitted. > > Este mensaje y los ficheros adjuntos pueden contener informacion > confidencial destinada solamente a la(s) persona(s) mencionadas > anteriormente. Pueden estar protegidos por secreto profesional Si usted > recibe este correo electronico por error, gracias de informar inmediatamente > al remitente y destruir el mensaje. > Al no estar asegurada la integridad de este mensaje sobre la red, Atos > Origin no se hace responsable por su contenido. Su contenido no constituye > ningun compromiso para el grupo Atos Origin, salvo ratificacion escrita por > ambas partes. > Aunque se esfuerza al maximo por mantener su red libre de virus, el emisor > no puede garantizar nada al respecto y no sera responsable de cualesquiera > danos que puedan resultar de una transmision de virus > ------------------------------------------------------------------ > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Ganglia-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ganglia-general ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

