rodneymo / rig-monitor

monitoring solution for mining rigs
https://randomcryptostuff.blogspot.nl/2017/08/monitoring-ethereum-mining-farm-using.html
GNU General Public License v3.0
30 stars 12 forks source link

MINER MODULES: w3m vs curl #44

Open wishbone1138 opened 6 years ago

wishbone1138 commented 6 years ago

I've never gotten around to asking you this. Why are we using w3m instead of curl just with claymore? Looks like it has some extra format option you're using?

rodneymo commented 6 years ago

w3m stripes out the html tags and outputs only the text. I could not find a way to the the same, while keeping the format with curl

wishbone1138 commented 6 years ago

There is some sort of json alternative in claymore but it's probably more work than it's worth at this point and I don't know if it will give you all the same data. I'm going to go with this isn't broken, so I won't worry about it for now.

wishbone1138 commented 6 years ago

Not to beat a dead horse.. This works pretty well

curl claymore:3333 | sed -e 's/<[^>]*>//g'

Only thing I saw was some &nbsp, which could also be removed pretty easily if we needed to.

rodneymo commented 6 years ago

No worries. Reducing dependencies makes sense. It's good to have someone challenging some of my coding shortcomings 👍
Have you tried this on claymore miner? I have all my miners go sgminer and I am travelling so I cannot test it on my PC. If you have and it works then let's replace it

wishbone1138 commented 6 years ago

I'll give it a shot when I get a chance. I'll be traveling this weekend as well. Wow sgminer? Isn't that a scrypt one? I wouldn't think GPUs would be competitive there any longer.

rodneymo commented 6 years ago

there's an AMD GPU version. I got the highest hr with it vs claymore's and XMR STAK. Granted I haven't modded the BIOS (all modded for eth) but I haven't had the time to play around with the bios and other miners

wishbone1138 commented 6 years ago

this is what I came up with that works. I'm not sure it's better, but it doesn't use w3m.. lol
curl -s http://${RIG_IP}:3333 | sed -e 's/<[^>]*>//g' | sed -e 's/&nbsp;//g' | tac | grep 'GPU #0' -m 1 -B 9999 | tac

There might be a better way to do the last tac|grep|tac in awk instead. I was following the method you were using to try and only grab the last output.

Another interesting option that I'm working on for my cgminer support (that works in claymore) uses raw tcp sockets to hit the claymore json API. This returns nice json output. However, you will lose the specific stats on shares per gpu. That does seem like useful data. Notice I couldn't figure out how to make curl send raw data (it's obviously designed for http), so I'm using nc in this example. The API is documented in API.txt in the claymore package.

nc claymoreip 3333 <<< '{"id":0,"jsonrpc":"2.0","method":"miner_getstat1"}' | jq -r '.'
{
  "id": 0,
  "result": [
    "9.8 - ETH",
    "514",
    "187346;1178;0",
    "23349;23445;23378;23371;23431;23464;23471;23433",
    "1873457;361;0",
    "233498;234456;233784;233717;234316;234640;234710;234336",
    "55;55;57;57;56;57;60;60;58;57;60;60;61;61;58;58",
    "pool1:9999;pool2:7777",
    "0;0;0;1"
  ],
  "error": null
}