From b074075c58ea664e858b06f03409338e2c3e6dc9 Mon Sep 17 00:00:00 2001
From: EUcancER
Date: Wed, 31 Aug 2011 13:31:18 +0200
Subject: gold/scoreboard: initial commit
Add a copy/paste branch of the original btc_logger. I couldn't import
the whole repo as it contains tons of passwords and keys (which is not a
good thing as these are somewhat special for me :)
scoreboard contains a number of modules which do a number of things:
ati_temper: log temperature data of an ati_temper enabled host :
see //gold/miner/bin/ati_temper
solidcoin : graph solidcoin informations
bitcoin : s.a.
In addition to that live stats are generated by the script
//gold/scoreboard/profile contains all the important paths and variables
which are sourced by the modules. In a new installation this file needs
to be customized.
//gold/scoreboard/util/schedule_logger is the scheduler for generating
the graphs every 5 minutes.
you will need to run /modules/available/$MODULE/init before using the
scoreboard as a whole.
the modules directory is still a bit cluttered, sorry about that.
---
gold/scoreboard/.gitignore | 3 +
gold/scoreboard/README | 15 ++
gold/scoreboard/modules/active/bitcoin | 1 +
gold/scoreboard/modules/active/chinaman_temper | 1 +
gold/scoreboard/modules/active/solidcoin | 1 +
.../scoreboard/modules/available/ati_temper/gather | 14 ++
gold/scoreboard/modules/available/ati_temper/index | 4 +
gold/scoreboard/modules/available/ati_temper/init | 25 +++
gold/scoreboard/modules/available/ati_temper/plot | 10 ++
gold/scoreboard/modules/available/bitcoin/gather | 12 ++
gold/scoreboard/modules/available/bitcoin/index | 4 +
gold/scoreboard/modules/available/bitcoin/init | 47 +++++
gold/scoreboard/modules/available/bitcoin/plot | 11 ++
gold/scoreboard/modules/available/bitcoin/render | 10 ++
.../available/bitcoinpool/bitcoinpool_stats | 11 ++
.../modules/available/bitcoinslc/bitcoinslc_live | 8 +
.../modules/available/bitcoinslc/bitcoinslc_stats | 18 ++
.../modules/available/btcguild/btcguild_stats | 22 +++
.../modules/available/btcguild/btcguild_stats_self | 15 ++
gold/scoreboard/modules/available/create_gnuplot | 196 +++++++++++++++++++++
gold/scoreboard/modules/available/solidcoin/gather | 12 ++
gold/scoreboard/modules/available/solidcoin/index | 4 +
gold/scoreboard/modules/available/solidcoin/init | 47 +++++
gold/scoreboard/modules/available/solidcoin/plot | 11 ++
gold/scoreboard/modules/available/solidcoin/render | 10 ++
gold/scoreboard/modules/available/static/init | 32 ++++
gold/scoreboard/profile | 26 +++
gold/scoreboard/util/run-folder | 6 +
gold/scoreboard/util/schedule_logger | 13 ++
29 files changed, 589 insertions(+)
create mode 100644 gold/scoreboard/.gitignore
create mode 100644 gold/scoreboard/README
create mode 120000 gold/scoreboard/modules/active/bitcoin
create mode 120000 gold/scoreboard/modules/active/chinaman_temper
create mode 120000 gold/scoreboard/modules/active/solidcoin
create mode 100755 gold/scoreboard/modules/available/ati_temper/gather
create mode 100755 gold/scoreboard/modules/available/ati_temper/index
create mode 100755 gold/scoreboard/modules/available/ati_temper/init
create mode 100755 gold/scoreboard/modules/available/ati_temper/plot
create mode 100755 gold/scoreboard/modules/available/bitcoin/gather
create mode 100755 gold/scoreboard/modules/available/bitcoin/index
create mode 100755 gold/scoreboard/modules/available/bitcoin/init
create mode 100755 gold/scoreboard/modules/available/bitcoin/plot
create mode 100644 gold/scoreboard/modules/available/bitcoin/render
create mode 100755 gold/scoreboard/modules/available/bitcoinpool/bitcoinpool_stats
create mode 100755 gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_live
create mode 100755 gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_stats
create mode 100755 gold/scoreboard/modules/available/btcguild/btcguild_stats
create mode 100755 gold/scoreboard/modules/available/btcguild/btcguild_stats_self
create mode 100755 gold/scoreboard/modules/available/create_gnuplot
create mode 100755 gold/scoreboard/modules/available/solidcoin/gather
create mode 100755 gold/scoreboard/modules/available/solidcoin/index
create mode 100755 gold/scoreboard/modules/available/solidcoin/init
create mode 100755 gold/scoreboard/modules/available/solidcoin/plot
create mode 100644 gold/scoreboard/modules/available/solidcoin/render
create mode 100755 gold/scoreboard/modules/available/static/init
create mode 100644 gold/scoreboard/profile
create mode 100755 gold/scoreboard/util/run-folder
create mode 100755 gold/scoreboard/util/schedule_logger
(limited to 'gold/scoreboard')
diff --git a/gold/scoreboard/.gitignore b/gold/scoreboard/.gitignore
new file mode 100644
index 00000000..657e895d
--- /dev/null
+++ b/gold/scoreboard/.gitignore
@@ -0,0 +1,3 @@
+/plot/
+/profile
+/archive/
diff --git a/gold/scoreboard/README b/gold/scoreboard/README
new file mode 100644
index 00000000..180cbd0d
--- /dev/null
+++ b/gold/scoreboard/README
@@ -0,0 +1,15 @@
+Scoreboard
+==========
+a non-interactive gold logger/plotter
+
+Install
+======
+* install lighttpd
+* configure the profile template file accordingly
+* [currently] do:
+ cd modules/available/ ati_temper; $EDITOR gather # change the host
+ * add the host key file to keys/
+* [currently] run:
+ modules/available/{ati_temper,bitcoin,solidcoin,static}/init
+* run:
+ util/schedule_logger
diff --git a/gold/scoreboard/modules/active/bitcoin b/gold/scoreboard/modules/active/bitcoin
new file mode 120000
index 00000000..86564edb
--- /dev/null
+++ b/gold/scoreboard/modules/active/bitcoin
@@ -0,0 +1 @@
+/root/btc_logger/modules/available/bitcoin/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/active/chinaman_temper b/gold/scoreboard/modules/active/chinaman_temper
new file mode 120000
index 00000000..31935833
--- /dev/null
+++ b/gold/scoreboard/modules/active/chinaman_temper
@@ -0,0 +1 @@
+/root/btc_logger/modules/available/ati_temper/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/active/solidcoin b/gold/scoreboard/modules/active/solidcoin
new file mode 120000
index 00000000..0062d804
--- /dev/null
+++ b/gold/scoreboard/modules/active/solidcoin
@@ -0,0 +1 @@
+/root/btc_logger/modules/available/solidcoin/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/available/ati_temper/gather b/gold/scoreboard/modules/available/ati_temper/gather
new file mode 100755
index 00000000..15f0b4f2
--- /dev/null
+++ b/gold/scoreboard/modules/available/ati_temper/gather
@@ -0,0 +1,14 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+
+# machine to check for
+MACHINE=chinaman
+MACHINE_KEY=$MDIR/keys/$MACHINE
+LF=${MACHINE}_ati_temper
+mkdir -p $ADIR
+mkdir -p $LDIR
+
+# write into live directory and archive
+[ ! -e $MACHINE_KEY ] && echo "No Key for $MACHINE" && exit 1
+echo "$(date +%Y-%m-%dT%H:%M:%S) $(ssh -i $MACHINE_KEY worker@$MACHINE '~/bin/ati_temper')" | tee $LDIR/$LF >> $ADIR/$LF
diff --git a/gold/scoreboard/modules/available/ati_temper/index b/gold/scoreboard/modules/available/ati_temper/index
new file mode 100755
index 00000000..19c21825
--- /dev/null
+++ b/gold/scoreboard/modules/available/ati_temper/index
@@ -0,0 +1,4 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+$HERE/gather
+$HERE/plot
diff --git a/gold/scoreboard/modules/available/ati_temper/init b/gold/scoreboard/modules/available/ati_temper/init
new file mode 100755
index 00000000..88a0ed10
--- /dev/null
+++ b/gold/scoreboard/modules/available/ati_temper/init
@@ -0,0 +1,25 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+mkdir -p $PDIR
+cat > $PDIR/chinaman.conf <$PDIR/chinaman_last_day.conf
diff --git a/gold/scoreboard/modules/available/ati_temper/plot b/gold/scoreboard/modules/available/ati_temper/plot
new file mode 100755
index 00000000..06f20c24
--- /dev/null
+++ b/gold/scoreboard/modules/available/ati_temper/plot
@@ -0,0 +1,10 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+umask 000
+export GDFONTPATH=/usr/share/fonts/truetype/msttcorefonts
+mkdir -p $GDIR
+gnuplot $PDIR/chinaman.conf> $GDIR/chinaman_overall.png
+tail -n288 $ADIR/chinaman_ati_temper > $ADIR/chinaman_last_day
+gnuplot $PDIR/chinaman_last_day.conf > $GDIR/chinaman_24h.png
diff --git a/gold/scoreboard/modules/available/bitcoin/gather b/gold/scoreboard/modules/available/bitcoin/gather
new file mode 100755
index 00000000..8b996428
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoin/gather
@@ -0,0 +1,12 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+LF=bitcoin
+mkdir -p $ADIR
+mkdir -p $LDIR
+
+
+# write into live directory and archive
+$BITCOIND_PATH getinfo | python $HERE/render | tee $LDIR/$LF >> $ADIR/$LF
+
+echo `date +"%Y-%m-%dT%H:%M:%S"` `$KREBSDIR/bin/mtgox_ticker` | sed -e 's/High: //' -e 's/Low: //' -e 's/Last: //' | tee $LDIR/ticker_${LF}>> $ADIR/ticker_${LF}
diff --git a/gold/scoreboard/modules/available/bitcoin/index b/gold/scoreboard/modules/available/bitcoin/index
new file mode 100755
index 00000000..19c21825
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoin/index
@@ -0,0 +1,4 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+$HERE/gather
+$HERE/plot
diff --git a/gold/scoreboard/modules/available/bitcoin/init b/gold/scoreboard/modules/available/bitcoin/init
new file mode 100755
index 00000000..c4ddf32f
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoin/init
@@ -0,0 +1,47 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+mkdir -p $PDIR
+cat > $PDIR/bitcoin.conf <$PDIR/bitcoin_last_day.conf
diff --git a/gold/scoreboard/modules/available/bitcoin/plot b/gold/scoreboard/modules/available/bitcoin/plot
new file mode 100755
index 00000000..209f662c
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoin/plot
@@ -0,0 +1,11 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+umask 000
+export GDFONTPATH=/usr/share/fonts/truetype/msttcorefonts
+mkdir -p $GDIR
+gnuplot $PDIR/bitcoin.conf> $GDIR/bitcoin.png
+tail -n288 $ADIR/bitcoin > $ADIR/bitcoin_last_day
+tail -n288 $ADIR/ticker_bitcoin > $ADIR/ticker_bitcoin_last_day
+gnuplot $PDIR/bitcoin_last_day.conf > $GDIR/bitcoin_24h.png
diff --git a/gold/scoreboard/modules/available/bitcoin/render b/gold/scoreboard/modules/available/bitcoin/render
new file mode 100644
index 00000000..19545b21
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoin/render
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+import json,urllib,datetime,sys
+today = datetime.datetime.now()
+
+result = json.load(sys.stdin)
+print today.strftime("%Y-%m-%dT%H:%M:%S"),
+print '%s' % result["blocks"],
+print '%s' % result["difficulty"],
+print '%s' % result["keypoololdest"],
+print '%s' % result["keypoolsize"]
diff --git a/gold/scoreboard/modules/available/bitcoinpool/bitcoinpool_stats b/gold/scoreboard/modules/available/bitcoinpool/bitcoinpool_stats
new file mode 100755
index 00000000..599ef9ff
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoinpool/bitcoinpool_stats
@@ -0,0 +1,11 @@
+#!/usr/bin/python2
+import simplejson,urllib,datetime
+url="http://bitcoinpool.com/pooljson.php"
+f = open('/home/makefu/log/bitcoinpool_stats',mode='a')
+today = datetime.datetime.now()
+
+result = simplejson.load(urllib.urlopen(url))
+print >>f, today.strftime("%Y-%m-%dT%H:%M:%S"),
+for k,v in result.iteritems():
+ print >>f ,'%s' % v,
+print >>f
diff --git a/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_live b/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_live
new file mode 100755
index 00000000..9fcbc6af
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_live
@@ -0,0 +1,8 @@
+#!/bin/sh
+LF=`basename $0`
+token=`curl -A 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0' http://www.bitcoins.lc -c cookiejar 2>/dev/null | grep -E '_csrf_token' | tail -n 1 | sed -n 's/.*value="\([0-9a-f]*\)".*/\1/p'`
+
+curl --keepalive -v -A 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0' -e http://www.bitcoins.lc/ -d "_csrf_token=$token" -d "action=login" -d "email=$BITCOINSLC_MAIL" -d "password=$BITCOINSLC_PASS" -d "login=Proceed" -b cookiejar -c cookiejar https://www.bitcoins.lc/ -k 2>/dev/null
+#Your current total hashrate
765.94 Mhash/s
+mkdir -p $LDIR
+echo $(date +%Y-%m-%dT%H:%M:%S) `curl -b cookiejar -A 'Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0' https://www.bitcoins.lc/stats --keepalive 2>/dev/null| sed -n 's/.*Your current total hashrate<\/strong>
\([0-9.]*\).*/\1/p'` > $ADIR/chinaman_$LF
diff --git a/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_stats b/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_stats
new file mode 100755
index 00000000..29508486
--- /dev/null
+++ b/gold/scoreboard/modules/available/bitcoinslc/bitcoinslc_stats
@@ -0,0 +1,18 @@
+#!/usr/bin/python2
+import simplejson,urllib,datetime,sys
+url="https://www.bitcoins.lc/stats.json"
+f = open(sys.env['ADIR']+'/bitcoinslc_stats',mode='a')
+today = datetime.datetime.now()
+
+result = simplejson.load(urllib.urlopen(url))
+print >>f, today.strftime("%Y-%m-%dT%H:%M:%S"),
+# hash_rate current_block active_workers total_workers total_users round_shares valid_round_shares total_shares
+print >>f , ("%s" % result['hash_rate'] ),
+print >>f , ("%s" % result['current_block'] ),
+print >>f , ("%s" % result['active_workers'] ),
+print >>f , ("%s" % result['total_workers'] ),
+print >>f , ("%s" % result['total_users'] ),
+print >>f , ("%s" % result['round_shares'] ),
+print >>f , ("%s" % result['valid_round_shares'] ),
+print >>f , ("%s" % result['total_shares'] ),
+print >>f
diff --git a/gold/scoreboard/modules/available/btcguild/btcguild_stats b/gold/scoreboard/modules/available/btcguild/btcguild_stats
new file mode 100755
index 00000000..58d72f75
--- /dev/null
+++ b/gold/scoreboard/modules/available/btcguild/btcguild_stats
@@ -0,0 +1,22 @@
+#!/usr/bin/python2
+import simplejson,urllib,datetime
+url="http://www.btcguild.com/pool_stats.php"
+f = open('/home/makefu/log/btcguild_stats',mode='a')
+today = datetime.datetime.now()
+
+result = simplejson.load(urllib.urlopen(url))
+try:
+ print >>f, today.strftime("%Y-%m-%dT%H:%M:%S"),
+ # uk_speed round_time round_shares active_workers useast_speed uscentral_speed uswest_speed hash_rate nl_speed
+ print >>f , ("%s" % '0' ).replace('.',''),
+ print >>f , ("%s" % result['round_time'] ).replace('.',''),
+ print >>f , ("%s" % result['round_shares'] ).replace('.',''),
+ print >>f , ("%s" % result['active_workers'] ).replace('.',''),
+ print >>f , ("%s" % result['useast_speed'] ).replace('.',''),
+ print >>f , ("%s" % result['uscentral_speed'] ).replace('.',''),
+ print >>f , ("%s" % result['uswest_speed'] ).replace('.',''),
+ print >>f , ("%s" % result['hash_rate'] ).replace('.',''),
+ print >>f , ("%s" % 0 ).replace('.',''),
+ print >>f
+except:
+ pass
diff --git a/gold/scoreboard/modules/available/btcguild/btcguild_stats_self b/gold/scoreboard/modules/available/btcguild/btcguild_stats_self
new file mode 100755
index 00000000..9cb65590
--- /dev/null
+++ b/gold/scoreboard/modules/available/btcguild/btcguild_stats_self
@@ -0,0 +1,15 @@
+#!/usr/bin/python2
+import simplejson,urllib,datetime,sys
+url="http://www.btcguild.com/api.php?api_key="+sys.env['BTCGUILD_APIKEY']
+f = open('/home/makefu/log/btcguild_stats_self',mode='a')
+today = datetime.datetime.now()
+
+#result = simplejson.load(urllib.urlopen(url))
+#print >>f, today.strftime("%Y-%m-%dT%H:%M:%S"),
+
+# TODO do the right thing with the data (aka this loop is wrong, fixme
+#for k,v in result.iteritems():
+# data = '%s' % v
+# data = data.replace('.','')
+# print >>f ,data,
+#print >>f
diff --git a/gold/scoreboard/modules/available/create_gnuplot b/gold/scoreboard/modules/available/create_gnuplot
new file mode 100755
index 00000000..95a6d170
--- /dev/null
+++ b/gold/scoreboard/modules/available/create_gnuplot
@@ -0,0 +1,196 @@
+#!/bin/sh
+#set -x
+umask 000
+MDIR=/home/makefu/log
+DDIR=/srv/http/tmp
+mkdir -p $DDIR/graphs
+cat > $DDIR/.htaccess << EOF
+order allow,deny
+allow from all
+EOF
+
+#
+# chinaman
+#
+cat > $MDIR/plot/chinaman.conf <$MDIR/plot/chinaman_last_day.conf
+
+cat $MDIR/plot/chinaman.conf | gnuplot > $DDIR/graphs/chinaman_overall.png
+tail -n288 $MDIR/chinaman_ati_temper > $MDIR/chinaman_last_day
+cat $MDIR/plot/chinaman_last_day.conf | gnuplot > $DDIR/graphs/chinaman_24h.png
+rm $MDIR/chinaman_last_day
+
+#
+#bitcoinpool
+#
+cat > $MDIR/plot/bitcoinpool.conf <$MDIR/plot/bitcoinpool_last_day.conf
+
+cat $MDIR/plot/bitcoinpool.conf | gnuplot > $DDIR/graphs/bitcoinpool.png
+tail -n288 $MDIR/bitcoinpool_stats > $MDIR/bitcoinpool_last_day
+cat $MDIR/plot/bitcoinpool_last_day.conf | gnuplot > $DDIR/graphs/bitcoinpool_24h.png
+rm $MDIR/bitcoinpool_last_day
+
+# uk_speed round_time round_shares active_workers useast_speed uscentral_speed uswest_speed hash_rate nl_speed
+cat > $MDIR/plot/btcguild.conf <$MDIR/plot/btcguild_last_day.conf
+
+gnuplot $MDIR/plot/btcguild.conf > $DDIR/graphs/btcguild.png
+tail -n288 $MDIR/btcguild_stats > $MDIR/btcguild_last_day
+gnuplot $MDIR/plot/btcguild_last_day.conf > $DDIR/graphs/btcguild_24h.png
+rm $MDIR/btcguild_last_day
+
+#
+#bitcoinslc
+#
+cat > $MDIR/plot/bitcoinslc.conf <$MDIR/plot/bitcoinslc_last_day.conf
+
+cat $MDIR/plot/bitcoinslc.conf | gnuplot > $DDIR/graphs/bitcoinslc.png
+tail -n288 $MDIR/bitcoinslc_stats > $MDIR/bitcoinslc_last_day
+cat $MDIR/plot/bitcoinslc_last_day.conf | gnuplot > $DDIR/graphs/bitcoinslc_24h.png
+rm $MDIR/bitcoinslc_last_day
diff --git a/gold/scoreboard/modules/available/solidcoin/gather b/gold/scoreboard/modules/available/solidcoin/gather
new file mode 100755
index 00000000..b4fe81f2
--- /dev/null
+++ b/gold/scoreboard/modules/available/solidcoin/gather
@@ -0,0 +1,12 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+LF=solidcoin
+mkdir -p $ADIR
+mkdir -p $LDIR
+
+
+# write into live directory and archive
+$SOLIDCOIND_PATH sc_getinfo | python $HERE/render | tee $LDIR/$LF >> $ADIR/$LF
+
+echo `date +"%Y-%m-%dT%H:%M:%S"` `$KREBSDIR/bin/scex_ticker` | sed -e 's/High: //' -e 's/Low: //' -e 's/Last: //' | tee $LDIR/ticker_${LF}>> $ADIR/ticker_${LF}
diff --git a/gold/scoreboard/modules/available/solidcoin/index b/gold/scoreboard/modules/available/solidcoin/index
new file mode 100755
index 00000000..19c21825
--- /dev/null
+++ b/gold/scoreboard/modules/available/solidcoin/index
@@ -0,0 +1,4 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+$HERE/gather
+$HERE/plot
diff --git a/gold/scoreboard/modules/available/solidcoin/init b/gold/scoreboard/modules/available/solidcoin/init
new file mode 100755
index 00000000..c12a6586
--- /dev/null
+++ b/gold/scoreboard/modules/available/solidcoin/init
@@ -0,0 +1,47 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+mkdir -p $PDIR
+cat > $PDIR/solidcoin.conf <$PDIR/solidcoin_last_day.conf
diff --git a/gold/scoreboard/modules/available/solidcoin/plot b/gold/scoreboard/modules/available/solidcoin/plot
new file mode 100755
index 00000000..d1feae88
--- /dev/null
+++ b/gold/scoreboard/modules/available/solidcoin/plot
@@ -0,0 +1,11 @@
+#!/bin/sh
+#set -x
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+umask 000
+export GDFONTPATH=/usr/share/fonts/truetype/msttcorefonts
+mkdir -p $GDIR
+gnuplot $PDIR/solidcoin.conf> $GDIR/solidcoin.png
+tail -n288 $ADIR/solidcoin > $ADIR/solidcoin_last_day
+tail -n288 $ADIR/ticker_solidcoin > $ADIR/ticker_solidcoin_last_day
+gnuplot $PDIR/solidcoin_last_day.conf > $GDIR/solidcoin_24h.png
diff --git a/gold/scoreboard/modules/available/solidcoin/render b/gold/scoreboard/modules/available/solidcoin/render
new file mode 100644
index 00000000..19545b21
--- /dev/null
+++ b/gold/scoreboard/modules/available/solidcoin/render
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+import json,urllib,datetime,sys
+today = datetime.datetime.now()
+
+result = json.load(sys.stdin)
+print today.strftime("%Y-%m-%dT%H:%M:%S"),
+print '%s' % result["blocks"],
+print '%s' % result["difficulty"],
+print '%s' % result["keypoololdest"],
+print '%s' % result["keypoolsize"]
diff --git a/gold/scoreboard/modules/available/static/init b/gold/scoreboard/modules/available/static/init
new file mode 100755
index 00000000..a7dc8859
--- /dev/null
+++ b/gold/scoreboard/modules/available/static/init
@@ -0,0 +1,32 @@
+#!/bin/sh
+# TODO use active modules to find out which to build
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../../../profile
+cat <$GDIR/index.html
+
+
+ Stats
+
+
+
+
+ Chinaman
+
+ Solidcoin
+
+ Bitcoin
+
+
+
+
+
+EOF
diff --git a/gold/scoreboard/profile b/gold/scoreboard/profile
new file mode 100644
index 00000000..ccd7c2b5
--- /dev/null
+++ b/gold/scoreboard/profile
@@ -0,0 +1,26 @@
+# the webpage directory
+WDIR=/srv/http/tmp
+LDIR=$WDIR/live
+GDIR=$WDIR/graphs/gold
+
+# the root directory
+KREBSDIR=/krebs
+MDIR=$KREBSDIR/gold/scoreboard
+
+# folder where plot configs are written into
+PDIR=$MDIR/plot
+# the archive directory
+ADIR=$MDIR/archive
+
+TEMPDIR=/tmp
+
+# bitcoinslc login/password
+BITCOINSLC_MAIL=
+BITCOINSLC_PASS=
+
+# binaries
+SOLIDCOIND_PATH=/root/bin/solidcoind
+BITCOIND_PATH=/root/bin/bitcoind
+
+# BTCGUILD
+BTCGUILD_APIKEY=
diff --git a/gold/scoreboard/util/run-folder b/gold/scoreboard/util/run-folder
new file mode 100755
index 00000000..ae5c96ac
--- /dev/null
+++ b/gold/scoreboard/util/run-folder
@@ -0,0 +1,6 @@
+#!/bin/sh
+ls -1 $1 | while read script; do
+ echo "Running $script"
+ $1/$script &
+done
+
diff --git a/gold/scoreboard/util/schedule_logger b/gold/scoreboard/util/schedule_logger
new file mode 100755
index 00000000..6d071ba9
--- /dev/null
+++ b/gold/scoreboard/util/schedule_logger
@@ -0,0 +1,13 @@
+#!/bin/sh
+HERE=$(dirname $(readlink -f $0))
+. $HERE/../profile
+RUN_PARTS=$HERE/run-folder
+echo "adding getlogs to crontab"
+
+crontab -l 2>/dev/null | grep -v "$MDIR/modules/active" > $TEMPDIR/currcron
+echo "*/5 * * * * /bin/date >>$TEMPDIR/debug_log && $RUN_PARTS $MDIR/modules/active >>$TEMPDIR/btc_logger_debug_log 2>&1" >> $TEMPDIR/currcron
+
+cat $TEMPDIR/currcron
+
+crontab $TEMPDIR/currcron
+rm $TEMPDIR/currcron
--
cgit v1.2.3
From a001a6f2e5bf9a594e42038f5f7b49381ed8ca04 Mon Sep 17 00:00:00 2001
From: EUcancER
Date: Wed, 31 Aug 2011 14:02:09 +0200
Subject: scoreboard: generalization of modules
symlinks to active will be created when calling init in the modules
ati_temper/init script is more general (holds hostname variable)
update README with last commit message.
---
gold/scoreboard/README | 14 ++++++++++++++
gold/scoreboard/modules/active/.placeholder | 0
gold/scoreboard/modules/active/bitcoin | 1 -
gold/scoreboard/modules/active/chinaman_temper | 1 -
gold/scoreboard/modules/active/solidcoin | 1 -
gold/scoreboard/modules/available/ati_temper/init | 21 ++++++++++++---------
gold/scoreboard/modules/available/bitcoin/init | 1 +
gold/scoreboard/modules/available/bitcoin/render | 2 +-
gold/scoreboard/modules/available/solidcoin/init | 1 +
9 files changed, 29 insertions(+), 13 deletions(-)
create mode 100644 gold/scoreboard/modules/active/.placeholder
delete mode 120000 gold/scoreboard/modules/active/bitcoin
delete mode 120000 gold/scoreboard/modules/active/chinaman_temper
delete mode 120000 gold/scoreboard/modules/active/solidcoin
(limited to 'gold/scoreboard')
diff --git a/gold/scoreboard/README b/gold/scoreboard/README
index 180cbd0d..8e59ab03 100644
--- a/gold/scoreboard/README
+++ b/gold/scoreboard/README
@@ -2,6 +2,20 @@ Scoreboard
==========
a non-interactive gold logger/plotter
+scoreboard contains a number of modules which do a number of things:
+ati_temper: log temperature data of an ati_temper enabled host :
+ see //gold/miner/bin/ati_temper
+solidcoin : graph solidcoin informations
+bitcoin : s.a.
+
+//gold/scoreboard/profile contains all the important paths and variables
+which are sourced by the modules. In a new installation this file needs
+to be customized.
+
+//gold/scoreboard/util/schedule_logger is the scheduler for generating
+the graphs every 5 minutes.
+
+
Install
======
* install lighttpd
diff --git a/gold/scoreboard/modules/active/.placeholder b/gold/scoreboard/modules/active/.placeholder
new file mode 100644
index 00000000..e69de29b
diff --git a/gold/scoreboard/modules/active/bitcoin b/gold/scoreboard/modules/active/bitcoin
deleted file mode 120000
index 86564edb..00000000
--- a/gold/scoreboard/modules/active/bitcoin
+++ /dev/null
@@ -1 +0,0 @@
-/root/btc_logger/modules/available/bitcoin/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/active/chinaman_temper b/gold/scoreboard/modules/active/chinaman_temper
deleted file mode 120000
index 31935833..00000000
--- a/gold/scoreboard/modules/active/chinaman_temper
+++ /dev/null
@@ -1 +0,0 @@
-/root/btc_logger/modules/available/ati_temper/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/active/solidcoin b/gold/scoreboard/modules/active/solidcoin
deleted file mode 120000
index 0062d804..00000000
--- a/gold/scoreboard/modules/active/solidcoin
+++ /dev/null
@@ -1 +0,0 @@
-/root/btc_logger/modules/available/solidcoin/index
\ No newline at end of file
diff --git a/gold/scoreboard/modules/available/ati_temper/init b/gold/scoreboard/modules/available/ati_temper/init
index 88a0ed10..af99bfbb 100755
--- a/gold/scoreboard/modules/available/ati_temper/init
+++ b/gold/scoreboard/modules/available/ati_temper/init
@@ -2,24 +2,27 @@
#set -x
HERE=$(dirname $(readlink -f $0))
. $HERE/../../../profile
+MACHINE=chinaman
+ln -s $HERE/index $HERE/../../active/${MACHINE}_ati_temper
mkdir -p $PDIR
-cat > $PDIR/chinaman.conf < $PDIR/$MACHINE.conf <$PDIR/chinaman_last_day.conf
+ -e "s/set title.*/set title \"${MACHINE} 24 hours Temperature\"/" \
+ -e "s/${MACHINE}_ati_temper/${MACHINE}_last_day/g" \
+ $PDIR/${MACHINE}.conf >$PDIR/${MACHINE}_last_day.conf
+
diff --git a/gold/scoreboard/modules/available/bitcoin/init b/gold/scoreboard/modules/available/bitcoin/init
index c4ddf32f..cc5688bd 100755
--- a/gold/scoreboard/modules/available/bitcoin/init
+++ b/gold/scoreboard/modules/available/bitcoin/init
@@ -3,6 +3,7 @@
HERE=$(dirname $(readlink -f $0))
. $HERE/../../../profile
mkdir -p $PDIR
+ln -s $HERE/index $HERE/../../active/bitcoin
cat > $PDIR/bitcoin.conf < $PDIR/solidcoin.conf <