On Wed, Mar 5, 2008 at 10:31 AM, <[EMAIL PROTECTED]> wrote: > Hello,
Hello. > I am a last year student of IT, and for my final project I was looking > to find a way to provide information about a GRID using java web > services. I found Ganglia monitoring system and decided to use it as a > source of information for my web service. To do that I need to dig out > information collected by ganglia from rrd database. I have a few ways > to get information for my java web service: I'm not completely sure of what you are doing here. It sounds as though you want to use the data collected by Ganglia as input into another program. Is that correct? > I already have a path that makes ganglia not only store information to > rrd database, but also redirect them to stdout. The information are > then taken from std out, using a pipe, and stored in jRobin database. > This provides easy access to rrd (jRobin) database from java. The > problem here is that the pipe consumes a lot of CPU. Using pipes should not impose a large overhead. All data sent through a pipe is done via kernel buffers in memory, so it should be fast. Now, the programs using the data may be slow, relatively speaking. If you have modified gemtad to report each metric it receives to stdout, I can see how this could be a problem on a moderate or large system. Since JRobin is a Java program, it *probably* isn't as rrdtool, and likely uses a lot more CPU cycles and RAM. (Yes, I'm biased.) > Another solution is to rewrite the whole gmetad to java and only use > jRobin, but this would be a huge change and interference to the source > code. You're certainly welcome to write whatever you'd like. That said, I don't know of any plans to move away from the two current languages: PHP on the web interface, and C for everything else. For what Ganglia needs to do, both are quite portable, and work well. > I can also try other java tools to get information from rrd database. > But here I face some problems also. jRRD is very simple and has not > been developed for past 6 years. Running rrdtool from java using > System.exec() is slow and you need to parse results. Maybe I should > try rrdjtool... So you think it's a good idea? If all you need to do is extract data from the .rrd files, then calling rrdtool and parsing the data isn't very hard. Look at using 'rrdtool fetch', the output format is pretty simple: rrdtool fetch hd_temp.rrd AVERAGE 1204831440: 1.3600000000e+03 5.1000000000e+01 1204831455: 1.3606666667e+03 5.1000000000e+01 1204831470: 1.3606666667e+03 5.1000000000e+01 1204831485: 1.3610000000e+03 5.1000000000e+01 [...etc...] I would think that pulling that part of the code from an existing project should not bee too hard, nor writing a small bit of code to read the .rrd files directly. > On the other hand, I can make information from rrdtool accessible via > web service written in perl. This solution has an advantage, because I > can provide information to my java web service about more than one GRID. > I want to ask You guys what do you suggest? Which method should I > choose? ( rewrite gmetad, rrdjtool, perl ). Well, it depends on what you want. Gmetad open port 8651 that dumps the current metric data via XML. If you just need metric updates, then connecting to that port and parsing that is probably the easiest thing to do. If you need the historical data stored in the .rrd files, then you'll have to have some way of importing older data. -- Jesse Becker GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Ganglia-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ganglia-general

