Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: thejfk on June 27, 2011, 05:48:46 PM



Title: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on June 27, 2011, 05:48:46 PM
I wrote a small patch for phoenix that adds support for querying the current hash rate, the amount of accepted and rejected results and the timestamp of the last result through an XML-RPC interface. Thus you can monitor phoenix in monitoring solutions like ganglia, munin, cacti or nagios. As of now it can only applied to the Linux version of phoenix, if somebody is interested to have that on Windows I'd look into it.

The patch for 1.50 is available at http://robertlacroix.com/files/phoenix-xmlrpc.diff (http://robertlacroix.com/files/phoenix-xmlrpc.diff) and has to be applied to phoenix 1.50 (http://svn3.xp-dev.com/svn/phoenix-miner/files/phoenix-1.50.tar.bz2) with

Code:
# patch -p0 < phoenix-xmlrpc.diff

The patch is also available for 1.6.2 at http://robertlacroix.com/files/phoenix-1.6.2-xmlrpc.diff (http://robertlacroix.com/files/phoenix-1.6.2-xmlrpc.diff) and has to be applied to the latest GitHub checkout phoenix 1.6.2 (https://github.com/jedi95/Phoenix-Miner) with

Code:
# patch -p0 < phoenix-1.6.2-xmlrpc.diff

Afterwards with the optional parameter -x [xmlrpcport] you can specify on which port phoenix should listen for XML-RPC requests. It binds to 127.0.0.1 and can only be queried locally. For security reasons I think that's fine for now and ganglia and munin query those things locally anyways.

http://robertlacroix.com/files/queryPhoenix.py (http://robertlacroix.com/files/queryPhoenix.py) allows you to query phoenix using queryPhoenix.py <xmlrpcport> <command> then.

Code:
Available commands:

# queryPhoenix.py <xmlrpcport> getrate      #queries the current hash rate
# queryPhoenix.py <xmlrpcport> getaccepted  #queries the amount of accepted results
# queryPhoenix.py <xmlrpcport> getrejected  #queries the amount of rejected results
# queryPhoenix.py <xmlrpcport> getlastfound #queries the time of last result (unix timestamp, accepted or rejected)
     to convert that timestamp to a string pipe it through # awk '{print strftime("%c",$1)}'

Used with munin, it creates those beautiful graphs of your hashing power:

http://robertlacroix.com/files/phoenixhashrates-day.png

If you like my work, please donate to 1EhQ1dbeZnxs7wZKngegsHLheAjUK37k7m.

/Robert


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: Reikoku on June 27, 2011, 07:04:38 PM
I'm very impressed with this, and would love to see addition of accepted/declined shares.

I am planning to implement your script in Autominer v0.3.1 to add miner hashrates to the main screen.


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: entens on June 27, 2011, 07:55:03 PM
XML-RPC should be a defacto standard in all miners! I'd also like to see JSON-RPC as it seems to be the protocol favored by the majority of bitcoin projects. I patched guiminer, but I'm now thinking it would be better to implement directly in phoenix/poclbm (https://github.com/entens/poclbm/commit/7420e4560ae5517b01d0a758b15b16a6874cba4d#guiminer.py).


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: gigica viteazu` on June 27, 2011, 08:50:20 PM
if somebody is interested to have that on Windows I'd look into it.

this will be great on Windows too :)


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: PcChip on June 27, 2011, 08:51:10 PM
Of course we want Windows support!

All my miners (and many others) are running Windows (1100 MH/s from 4 cards)


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on June 28, 2011, 05:49:25 PM
I will check out both Windows support and more counters this weekend.


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: Reikoku on June 28, 2011, 07:02:45 PM
I have implemented this in Autominer 0.3.2, see sig.


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on July 02, 2011, 04:34:32 PM
Updated to add the promised counters!


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: drgr33n on July 05, 2011, 03:29:19 PM
Hey guys

I can seem to download the patch  ? wget gets to 77% then stops ?


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on July 05, 2011, 07:51:09 PM
Hmmm, it works fine for me!? Do you still have the problem?


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: cottoneyeJoe on July 07, 2011, 03:28:46 AM
Cool beans. I'll have to check it out. I've been running poclbm and this gives me another reason to try phoenix.

Meanwhile, I have implemented my own RRD feeder by tailing the poclbm verbose output to a python script that sends stuff from multiple miner rigs to an RRDCached daemon I run on another box.

I was new to RRD and got things going pretty well but couldnt get a legend all lined up like you are showing there.

Would you mind sharing/posting the RRD script youre using to get the legend in colums like that. GPPRINT new line and column aligment wasnt nice to me.

TIA & nice work.


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: Kris on July 07, 2011, 03:41:34 AM
Fine work indeed thejfk, I will see if I can incorporate this into my monitoring site, for faster updates of hashrate, shares and stales information from phoenix.

If I use it, and it proves better then my current solutions, you can bet on me donating.

Kind regards
Kris


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on July 07, 2011, 08:18:09 AM
@cottoneyeJoe I didn't tinker with RRDTool directly and used munin instead! Check out http://forum.bitcoin.org/index.php?topic=10233.0 for more information.


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: inh on July 31, 2011, 03:04:16 AM
Thank you for this!


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: inh on August 16, 2011, 10:26:48 PM
Can you update this for phoenix 1.6 please?


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: thejfk on August 18, 2011, 08:51:23 PM
Updated for 1.6.2


Title: Re: XML-RPC interface for phoenix allows monitoring
Post by: deti on August 28, 2011, 10:45:14 PM
Used with munin, it creates those beautiful graphs of your hashing power:

http://robertlacroix.com/files/phoenixhashrates-day.png
How did you configure munin to show this graph?