3)differences between this and flexible miner proxy?
This one hops. Oh and it changes servers in the case of server death etc... We also have LP support
I know they have support for individual worker statistics which we don't have yet.
Can you (or someone) post a screenshot of the web interface so I can compare it to Flexible Proxy? I'd love to get started with pool hopping and this project sounds interesting. Flexible Proxy does have LP support, just in case anyone is wondering.
Um... individual worker stats, that is very useful and I'd certainly want to have that info displayed. I can add those to this pool hopping proxy quite easily if someone isn't already working on it. Also, let me just post this here code that I wrote this weekend. It adds health stats to the flexible proxy but can easily be modified so it adds the same health stats to the pool hopping proxy (as long as you're ok with adding a couple of tables to the mysql schema). Basically you just run one cronjob per miner on you servers and it polls aticonfig for device temperature, core clock speed, mem speed, fan speed, and then inserts those values into the DB.
I'm pretty good with Python so I could add miner stats (mhash/s, submitted shares, stales, etc) and health stats (from this script) to the pool hopping proxy if you want, just let me know and I'll get started.
#!/bin/bash
#########################################################
# Reports worker stats to BTC Mining Proxy 'modified' #
# See schema changes below to setup database for script #
# Author: shotgun #
# Date: 2011 07 22 #
# Donations welcome: 1BUV1p5Yr3xEtSGbixLSospmK6B8NCdqiW #
#########################################################
## Database settings for BTCproxy server. This should be a
## separate user that only has INSERT,SELECT on the
## worker_health table so that things are secure on the db
U="btcinsert"
P="password"
H="ip_address_of_proxy_database_server"
DB="btcproxy"
## SQL to create table in BTCproxy schema and GRANT
## statement for user that will insert health reports.
## This table and user must exist before running the script
## For [network] use only the class C address, ex: 10.1.1.%
## For [password] be secure, use the MD5 of a random string
## For [schema] set to the schema name from btc proxy
##
# CREATE TABLE worker_health_current (
# id int(32) NOT NULL auto_increment,
# worker_id int(11) NOT NULL,
# temp int(5) NOT NULL,
# speed_clock int(4) NOT NULL,
# speed_mem int(4) NOT NULL,
# speed_fan int(3) NOT NULL,
# date datetime NOT NULL,
# PRIMARY KEY (id),
# UNIQUE KEY worker_id_ix (worker_id)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
#
# CREATE TABLE worker_health_archive (
# id int(32) NOT NULL auto_increment,
# worker_id int(11) NOT NULL,
# temp int(5) NOT NULL,
# speed_clock int(4) NOT NULL,
# speed_mem int(4) NOT NULL,
# speed_fan int(3) NOT NULL,
# date datetime NOT NULL,
# PRIMARY KEY (id),
# KEY worker_id_ix (worker_id)) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
#
# GRANT UPDATE,SELECT,INSERT ON [schema].worker_health_current TO 'btcinsert'@'[network]' IDENTIFIED BY '[password]';
# GRANT SELECT,INSERT ON [schema].worker_health_archive TO 'btcinsert'@'[network]' IDENTIFIED BY '[password]';
# GRANT SELECT ON [schema].worker TO 'btcinsert'@'[network]' IDENTIFIED BY '[password]';
#
## END DATABASE CHANGES
## CRONTAB entries to run health report on schedule
## I recommend polling at 5 minute intervals, but use whatever
## you need for your setup. You need one line entry per worker
## Set the arguments correctly, or your reporting won't work.
## Example below. Remove the leading # character when pasting
## into /etc/crontab, set the script location per your setup.
#
# ATI GPU Health Monitoring
# * * * * * exec-user script-location worker_name device_number > logfile
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ └───── day of week (0 - 7) (Sunday=0 or 7)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59) or interval (*/5 = every 5 minutes)
# */5 * * * * user /opt/phoenix-1.50_patched/worker-health.sh worker0 0 > /tmp/worker_health-0.log
# */5 * * * * user /opt/phoenix-1.50_patched/worker-health.sh worker1 1 > /tmp/worker_health-1.log
#
## Check for help
if [ $1 = "-h" ] || [ $1 = "help" ]; then
echo "Usage: worker_health.sh [worker_name] [device number]"
echo "Example: worker_health.sh quad0c0 0"
exit 0
fi
## Check for arguments
if [ $# -ne 2 ]; then
echo "Usage: worker_health.sh [worker_name] [device number]"
exit 65
fi
WORKER=$1
DEVICE=$2
## Environment variables
export AMDAPPSDKSAMPLESROOT=/opt/AMD-APP-SDK-v2.4-lnx64
export LD_LIBRARY_PATH=/opt/AMD-APP-SDK-v2.4-lnx64/lib/x86_64:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/phoenix-1.50_patched
export AMDAPPSDKROOT=/opt/AMD-APP-SDK-v2.4-lnx64
export HOME=/home/user
export LOGNAME=user
export DISPLAY=:0
export _=/usr/bin/env
## Get health values
FAN=`/usr/bin/aticonfig --pplib-cmd "get fanspeed 0"|grep "Fan Speed"|awk -F: '{print $3}'`
TEMP=`/usr/bin/aticonfig --odgt --adapter=$DEVICE | grep -o '[0-9][0-9].[0-9][0-9]' | sed 's/\.[0-9][0-9]//g'`
CLOCK=`/usr/bin/aticonfig --odgc --adapter=$DEVICE | grep "Current Clock"| grep -o '[0-9][0-9][0-9]'|head -n 1`
MEM=`/usr/bin/aticonfig --odgc --adapter=$DEVICE | grep "Current Clock"| grep -o '[0-9][0-9][0-9][0-9]'|tail -n 1`
SQL0="INSERT INTO worker_health_archive (id,worker_id,temp,speed_clock,speed_mem,speed_fan,date) VALUES (NULL,(SELECT id FROM worker WHERE name='$WORKER'),'$TEMP','$CLOCK','$MEM','$FAN',NOW());"
SQL1="INSERT INTO worker_health_current (id,worker_id,temp,speed_clock,speed_mem,speed_fan,date) VALUES (NULL,(SELECT id FROM worker WHERE name='$WORKER'),'$TEMP','$CLOCK','$MEM','$FAN',NOW()) ON DUPLICATE KEY UPDATE temp='$TEMP', speed_clock='$CLOCK', speed_mem='$MEM', speed_fan='$FAN', date=NOW();"
## Locate mysql client binary
mysqlbinary=`which mysql`
if [ $mysqlbinary = "" ]; then
echo "MySQL client not found in PATH=$PATH. Please install or put binary into path."
exit 1
fi
## Insert SQL to the database
$mysqlbinary --user=$U --password=$P --host=$H $DB -e "$SQL0"
if [ "$?" = "0" ]; then
$mysqlbinary --user=$U --password=$P --host=$H $DB -e "$SQL1"
if [ "$?" = "0" ]; then
echo "Health reported to database: successful. w: $WORKER d: $DEVICE"
exit 0
else
echo "Health reported to database: failed current sql. Check user permissions. w: $WORKER d: $DEVICE"
fi
else
echo "Health reported to database: failed archive sql. Check user permissions. w: $WORKER d: $DEVICE"
exit 1
fi