Hi, i posted the code in the phoenix tropic, but i place it here. I done this to help me monitor my miners.
What this mod do is add a new command line argument ( -l ), this allow you to set a output filename for the status.
Examples:
That one will output the file to the phoenix folder.
sudo ./phoenix.py -u
http://user:pass@server:port -k kernel device=x WORKSIZE=128 VECTORS AGGRESSION=12 BFI_INT FASTLOOP=FALSE -l /usr/hashrate.txt
That one will place the file intro the /usr folder, sudo is required for permision.
I use .txt as a example, the extension does not matter. You can call it index.html and place intro the apache web folder it you want.
The output is something like this, in a single line, no attachments.
[400.31 Mhash/sec] [0 Accepted] [0 Rejected] [RPC]
You need to edit the code in phoenix.py and ConsoleLogger.py.
phoenix.py
Search for:
Put this below:
self.queue = None
self.logtotext = None
Search for:
parser.add_option("-a", "--avgsamples", dest="avgsamples", type="int",
default=10,
help="how many samples to use for hashrate average")
reemplace with:
parser.add_option("-a", "--avgsamples", dest="avgsamples", type="int",
default=10,
help="how many samples to use for hashrate average"),
parser.add_option("-l", "--logtotext", dest="logtotext", default="none",
help="-l filename.txt log hashrate to text option, disabled by default")
Search for:
self.logger = ConsoleLogger(miner,self.parsedSettings.verbose)
Reemplace with this:
self.logger = ConsoleLogger(miner,self.parsedSettings.verbose,self.parsedSettings.logtotext)
ConsoleLogger.py
Search for:
def __init__(self, miner, verbose=False):
self.verbose = verbose
self.miner = miner
self.lastUpdate = time() - 1
self.rate = 0
self.accepted = 0
self.invalid = 0
self.lineLength = 0
self.connectionType = None
Reemplace with this:
def __init__(self, miner, verbose=False, logtotext="none"):
self.verbose = verbose
self.miner = miner
self.logtotext = logtotext
self.lastUpdate = time() - 1
self.rate = 0
self.accepted = 0
self.invalid = 0
self.lineLength = 0
self.connectionType = None
Search for:
self.say(status)
self.lastUpdate = time()
Reemplace with this:
self.say(status)
if self.logtotext != "none":
try:
f = open(self.logtotext,"w")
f.write(status)
f.close()
except IOError as e:
print("({})".format(e))
self.lastUpdate = time()
All credits are for jedi95, its his miner, i just did a small addon for it.