Re: api to query gkrellmd

Bill Nalen <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
On Nov 13, 2006, at 11:28 AM, [email protected] wrote:

> thanks for your answer, but can you more specific, i mean what exactly
> file to look, a little sample.
>

I don't have a sample around, my code is Windows and I'm on a Mac  
now. But here's a snippet from the code I have. Keep in mind this is  
based on my memory and the last version of GKrellM I worked with a  
few years ago.

Create a socket on port 19150 (the default)
Send "gkrellm 1.1.1" (or whatever version of the client you want) to  
the server
Then loop while running and check the socket for read data (you won't  
ever need to write data again)
Parse up the data you receive according to the type of xml node
The data is only sent when a change occurs, so you won't receive full  
data for every monitor on every tick.
Also Bill's xmlish format lacks the closing xml tag to lower bytes  
transmitted.

Here's some Windows specific code (which wasn't at 1.0 yet) that I  
used to read & parse the data:
http://redbog.com/temp/gkrellmserver.txt

To see how to parse the data, take a look at monitor.c in the server  
folder from the latest gkrellm source. (for example the function  
gkrellmd_serve_data which sets up the xml tag and then calls  
functions like serve_cpu_data).

Also you might want to start the server with the -V verbose option to  
see what is being sent to the client. Helps with debugging.

Thanks
Bill

_______________________________________________
Gkrellm mailing list
[email protected]
http://lists.jutley.org/cgi-bin/mailman/listinfo/gkrellm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.