Bitcoin Forum
October 15, 2019, 05:05:36 AM *
News: If you like a topic and you see an orange "bump" link, click it. More info.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: btcguild python idle monitor script  (Read 4465 times)
frozen
Full Member
***
Offline Offline

Activity: 196
Merit: 100



View Profile WWW
June 03, 2011, 08:27:28 PM
 #1

I've written a script that can be used with the btcguild api to query worker progress and detect any idle workers. The script has the capability of sending an email, if configured. It is defaulted to gmail's SMTP server, but you can use whatever SMTP you want.

Currently it will just print out what it receives. It's a small script so it has the most flexibility when you customize it for your own needs.

https://gist.github.com/1007083

Usage:

  • chmod +x btcguild.py
  • ./btcguild.py APIKEY

Example Output:

worker1 42.95 0.0151% 6 seconds
worker2 276.79 0.0515% 52 seconds
worker3 257.7 0.0424% 35 seconds
worker4 305.42 0.0666% 5 seconds
worker5 262.47 0.0727% 6 seconds
total 1145.33 0.2483%

There are a few ways you could use this script... 1) install a cron and have it run every 30 minutes, or 2) write a bash script (see below) that loops and sleeps to execute this script

Code:
#!/bin/bash
while true; do ./btcguild.py APIKEY && sleep 1800; done

I am aware that btcguild supports idle notification already, but 1) just for donators, and 2) this is a bit more flexible

1571115936
Hero Member
*
Offline Offline

Posts: 1571115936

View Profile Personal Message (Offline)

Ignore
1571115936
Reply with quote  #2

1571115936
Report to moderator
1571115936
Hero Member
*
Offline Offline

Posts: 1571115936

View Profile Personal Message (Offline)

Ignore
1571115936
Reply with quote  #2

1571115936
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1571115936
Hero Member
*
Offline Offline

Posts: 1571115936

View Profile Personal Message (Offline)

Ignore
1571115936
Reply with quote  #2

1571115936
Report to moderator
kbsbtc
Newbie
*
Offline Offline

Activity: 54
Merit: 0


View Profile
June 28, 2011, 04:22:03 PM
Last edit: June 28, 2011, 08:00:39 PM by kbsbtc
 #2

Just got it running on my macbook. Tweaked it a little bit to fit my needs but all in all awesome script. Thanks!
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!