anselal / antminer-monitor

Cryptocurrency ASIC mining hardware monitor using a simple web interface
GNU General Public License v3.0
228 stars 145 forks source link

Help with checking miner model #114

Closed errand closed 5 years ago

errand commented 6 years ago

Hello @anselal ! You're doing great thanks! While i'm still learning could you please advise how to check the miner model because i'd like to reboot S9 which is probably damaged and goes to 8Gh/s in a while. Currently i'm dong this: if(miner.model.model == "S9"): if ghs5s < 12: rebootit(miner.ip) #custom reboot function using paramiko

anselal commented 6 years ago

Thank you !!!

This looks correct.

errand commented 6 years ago

Ahaha! You're right man, except S9s are in TH/s so the right code is if(miner.model.model == "S9"): if ghs5s < 12000: rebootit(miner.ip) #custom reboot function using paramiko Thanx!

anselal commented 6 years ago

No problem. Can you share the code for rebooting to compare it with mine ?

anselal commented 6 years ago

Thnx. I will compare it with mine and reply

errand commented 6 years ago

Sure. I'm sure it's not the best. I think it is better to write ips to the file and reboot them via cron..

`import paramiko

def rebootit(ip): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip, username='[REDACTED]', password='[REDACTED]', allow_agent=False, look_for_keys=False, timeout=40) try: stdin, stdout, stderr = ssh.exec_command("/sbin/reboot -f > /dev/null 2>&1 &") except AuthenticationException, e: print '' finally: ssh.close()`

had to delete comment