1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-11-25 19:47:02 +00:00

bitcoin/slush_reward_: convert to unix line endings

This commit is contained in:
Kenyon Ralph 2013-11-03 01:43:54 -07:00
parent 721bad84c1
commit 862bc2134c

View file

@ -1,34 +1,34 @@
#!/usr/bin/python #!/usr/bin/python
# based on https://github.com/pdbrown/munin-custom/blob/master/plugins/hashrate # based on https://github.com/pdbrown/munin-custom/blob/master/plugins/hashrate
# improved by @deveth0 (donation to 1GzHgp9hsDRsf96MnVk2oo6EG1VmWP9jGs :) ) # improved by @deveth0 (donation to 1GzHgp9hsDRsf96MnVk2oo6EG1VmWP9jGs :) )
# usage: link to slush_reward_YOURAPIKEY # usage: link to slush_reward_YOURAPIKEY
import sys import sys
import urllib2 import urllib2
import json import json
SLUSH_URL = 'https://mining.bitcoin.cz/accounts/profile/json/' SLUSH_URL = 'https://mining.bitcoin.cz/accounts/profile/json/'
API_KEY = sys.argv[0][(sys.argv[0].rfind('_')+1):] API_KEY = sys.argv[0][(sys.argv[0].rfind('_')+1):]
SLUSH_STATS = SLUSH_URL + API_KEY SLUSH_STATS = SLUSH_URL + API_KEY
mining_stats_raw = urllib2.urlopen(SLUSH_STATS) mining_stats_raw = urllib2.urlopen(SLUSH_STATS)
mining_stats = json.load(mining_stats_raw) mining_stats = json.load(mining_stats_raw)
command = '' command = ''
if len(sys.argv) > 1: if len(sys.argv) > 1:
command = sys.argv[1] command = sys.argv[1]
if command == 'config': if command == 'config':
print "graph_title Slush Rewards" print "graph_title Slush Rewards"
print "graph_args -l 0" print "graph_args -l 0"
print "graph_vlabel BTC" print "graph_vlabel BTC"
print "graph_category Bitcoin" print "graph_category Bitcoin"
print "unconfirmed_reward.label Unconfirmed Reward" print "unconfirmed_reward.label Unconfirmed Reward"
print "estimated_reward.label Estimeated Reward" print "estimated_reward.label Estimeated Reward"
print "confirmed_reward.label Confirmed Reward" print "confirmed_reward.label Confirmed Reward"
print "send_threshold.label Send Threshold" print "send_threshold.label Send Threshold"
sys.exit(0) sys.exit(0)
print "unconfirmed_reward.value " +mining_stats['unconfirmed_reward'] print "unconfirmed_reward.value " +mining_stats['unconfirmed_reward']
print "estimated_reward.value " +mining_stats['estimated_reward'] print "estimated_reward.value " +mining_stats['estimated_reward']
print "confirmed_reward.value " +mining_stats['confirmed_reward'] print "confirmed_reward.value " +mining_stats['confirmed_reward']
print "send_threshold.value " +mining_stats['send_threshold'] print "send_threshold.value " +mining_stats['send_threshold']