mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-12 00:44:43 +00:00
move bitcoin to currency folder
This commit is contained in:
parent
f5715e5eba
commit
f81bdebc3b
4 changed files with 0 additions and 0 deletions
|
@ -1,41 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
# based on https://github.com/pdbrown/munin-custom/blob/master/plugins/hashrate
|
||||
# improved by @deveth0 (donation to 1GzHgp9hsDRsf96MnVk2oo6EG1VmWP9jGs :) )
|
||||
# usage: link to btcguild_hashrate_YOURAPIKEY
|
||||
import sys
|
||||
import urllib2
|
||||
import json
|
||||
|
||||
URL = 'https://www.btcguild.com/api.php?api_key='
|
||||
API_KEY = sys.argv[0][(sys.argv[0].rfind('_')+1):]
|
||||
|
||||
STATS = URL + API_KEY
|
||||
|
||||
print STATS
|
||||
|
||||
command = ''
|
||||
if len(sys.argv) > 1:
|
||||
command = sys.argv[1]
|
||||
|
||||
header = {'User-Agent':'Mozilla/5.0'}
|
||||
request = urllib2.Request(STATS,headers=header)
|
||||
mining_stats_raw = urllib2.urlopen(request)
|
||||
mining_stats = json.load(mining_stats_raw)
|
||||
workers = mining_stats['workers']
|
||||
|
||||
|
||||
if command == 'config':
|
||||
print "graph_title BTCGuild Hashrate"
|
||||
print "graph_args --upper-limit 3000 -l 0"
|
||||
print "graph_vlabel MHash/s"
|
||||
print "graph_category htc"
|
||||
for worker in workers:
|
||||
label = workers[worker]['worker_name']
|
||||
print label + ".label " + label
|
||||
sys.exit(0)
|
||||
|
||||
for worker in workers:
|
||||
hash_rate = workers[worker]['hash_rate']
|
||||
label = workers[worker]['worker_name']
|
||||
print label + ".value %d" % int(hash_rate)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue