Title: Skript: Wenn Hashrate zu niedrig, PC reboot
Post by: BudSpenser on January 23, 2018, 11:43:13 AM
Hallo Ich suche ein Skript, die mir bei Claymore die Hashrate Gesamt und des jeweiligen GPU's ausließt. Ich hab mir eine eigene Fehlersuch-Batch geschrieben, wenn Fehler, soll Miner oder PC neu gestartet werden. Funktion: 1. IF z.B. GPU 1 gleich kleiner 20.000 Mh/s, dann soll goto :Neustart (erstelle danach :Afterburner des jeweilgen Profiles) else goto :run2ME IF else natürlich 2. If Total Speed gleich kleiner 70.000Mh/s, dann soll goto :shutdown Else goto :run2ME 3. Diese beiden sollen die Hashrate alle 15 Sekunden abgefragt werden! Nur ich habe keine Ahnung wie ich jedes einzelne GPU auslese und dann die Hashrate verzweige, dass der PC rebootet. Ich habe es mit Findstr versucht, ging nicht. Auch mit FIND habe ich es probiett, weil ich zumindest eine zeit setzten kann, was aber auch fehl schlug. Bitte um Hilfe Falls mal wer eine Fehlersuche Skript braucht. Shutdown.txt muss vorher erstellt werden! @echo off
:start SET loopnum=0
echo Initializing... cd "D:\Ethermine\" START worker1.bat timeout 30 goto :run goto :run GPU
:run timeout 15 SET /A loopnum=loopnum+1 echo Script has completed %loopnum% loops. @echo off
for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f echo Parsing for errors...
goto :nex0
:run2ME timeout 10 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again ... goto :before neustart new check ) ELSE ( echo All is well. goto :noerrors )
:noerrors echo No issues detected. Resume mining... goto :run
:before neustart new check timeout 15 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again agin... goto :neustart ) ELSE ( echo All is well. goto :noerrors )
:neustart timeout 10
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo %date% %time% Miner has died of dysentery ... echo Loggin into shutdowns.txt - Check for details as to why the shutdown. echo Line count match %lines% , %lines1% , %lines2%>> "D:\Ethermine\shutdowns.txt" echo %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%> "D:\Ethermine\shutdowns.txt" echo %date% %time%> "D:\Ethermine\shutdowns.txt" echo Miner becomes Neustart
taskkill /FI "WINDOWTITLE eq worker1" timeout 5 start D:\Ethermine\worker1.bat timeout 30 goto :new check ) ELSE ( goto :noerrors )
:new check timeout 10 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo Miner has died of dysentery ... goto :shutdown ) ELSE ( echo %date% %time% Close but all is well. timeout 3 goto :noerrors )
:before shutdown new check for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i timeout 10
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again ... goto :shutdown ) ELSE ( echo All is well. goto :noerrors )
:shutdown for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo %date% %time% Close but all is well. timeout 3 goto :noerrors ) ELSE ( echo %date% %time% Miner has died of dysentery ... echo Loggin into shutdowns.txt - Check for details as to why the shutdown. echo Line count match %lines% , %lines1% , %lines2%>> "D:\Ethermine\shutdowns.txt" echo %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%> "D:\Ethermine\shutdowns.txt" echo %date% %time%> "D:\Ethermine\shutdowns.txt" echo Shutting down now ... pause shutdown /r /t 10 )
:nex0 findstr /I /C:"CUDA error" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% CUDA Errors found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex1 )
:nex1 findstr /I /C:"failed GPU" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Failed GPU string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex2 ) :nex2 findstr /I /C:"unspecified launch failure" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Unspecified Launch Failure string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex3 ) :nex3 findstr /I /C:"Miner thread hangs, need to restart miner!" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner thread hangs, need to restart miner! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex4 )
:nex4 set Programm=EthDcrMiner64.exe
tasklist | find /i "%Programm%" if %errorlevel% == 0 ( echo Prozess "%Programm%" läuft goto :nex5 ) else ( echo %date% %time% Prozess "%Programm%" läuft nicht goto :run2ME )
:nex5 findstr /I /C:"Cannot connect to eu1.ethermine.org:4444" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner Cannot Connect! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex6 )
:nex6 findstr /I /C:"Socket was closed remotely (by pool)" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner Cannot Connect! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :noerrors )
Title: Re: Skript: Wenn Hashrate zu niedrig, PC reboot
Post by: nathan_tek on February 23, 2018, 02:57:45 PM
Hallo Ich suche ein Skript, die mir bei Claymore die Hashrate Gesamt und des jeweiligen GPU's ausließt. Ich hab mir eine eigene Fehlersuch-Batch geschrieben, wenn Fehler, soll Miner oder PC neu gestartet werden. Funktion: 1. IF z.B. GPU 1 gleich kleiner 20.000 Mh/s, dann soll goto :Neustart (erstelle danach :Afterburner des jeweilgen Profiles) else goto :run2ME IF else natürlich 2. If Total Speed gleich kleiner 70.000Mh/s, dann soll goto :shutdown Else goto :run2ME 3. Diese beiden sollen die Hashrate alle 15 Sekunden abgefragt werden! Nur ich habe keine Ahnung wie ich jedes einzelne GPU auslese und dann die Hashrate verzweige, dass der PC rebootet. Ich habe es mit Findstr versucht, ging nicht. Auch mit FIND habe ich es probiett, weil ich zumindest eine zeit setzten kann, was aber auch fehl schlug. Bitte um Hilfe Falls mal wer eine Fehlersuche Skript braucht. Shutdown.txt muss vorher erstellt werden! @echo off
:start SET loopnum=0
echo Initializing... cd "D:\Ethermine\" START worker1.bat timeout 30 goto :run goto :run GPU
:run timeout 15 SET /A loopnum=loopnum+1 echo Script has completed %loopnum% loops. @echo off
for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f echo Parsing for errors...
goto :nex0
:run2ME timeout 10 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again ... goto :before neustart new check ) ELSE ( echo All is well. goto :noerrors )
:noerrors echo No issues detected. Resume mining... goto :run
:before neustart new check timeout 15 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again agin... goto :neustart ) ELSE ( echo All is well. goto :noerrors )
:neustart timeout 10
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo %date% %time% Miner has died of dysentery ... echo Loggin into shutdowns.txt - Check for details as to why the shutdown. echo Line count match %lines% , %lines1% , %lines2%>> "D:\Ethermine\shutdowns.txt" echo %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%> "D:\Ethermine\shutdowns.txt" echo %date% %time%> "D:\Ethermine\shutdowns.txt" echo Miner becomes Neustart
taskkill /FI "WINDOWTITLE eq worker1" timeout 5 start D:\Ethermine\worker1.bat timeout 30 goto :new check ) ELSE ( goto :noerrors )
:new check timeout 10 for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo Miner has died of dysentery ... goto :shutdown ) ELSE ( echo %date% %time% Close but all is well. timeout 3 goto :noerrors )
:before shutdown new check for /F "tokens=*" %%f in ('dir /od /b "D:\Ethermine\*.txt"') do set _lastFile=%%f for /f %%i in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines=%%i timeout 10
for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines1=%%I if %lines% == %lines1% ( echo %date% %time% Looks like miner may have crashed, checking again ... goto :shutdown ) ELSE ( echo All is well. goto :noerrors )
:shutdown for /f %%I in ('find /v /c "" ^< D:\Ethermine\%_lastFile%') do set /a lines2=%%I if %lines1% == %lines2% ( echo %date% %time% Close but all is well. timeout 3 goto :noerrors ) ELSE ( echo %date% %time% Miner has died of dysentery ... echo Loggin into shutdowns.txt - Check for details as to why the shutdown. echo Line count match %lines% , %lines1% , %lines2%>> "D:\Ethermine\shutdowns.txt" echo %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%> "D:\Ethermine\shutdowns.txt" echo %date% %time%> "D:\Ethermine\shutdowns.txt" echo Shutting down now ... pause shutdown /r /t 10 )
:nex0 findstr /I /C:"CUDA error" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% CUDA Errors found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex1 )
:nex1 findstr /I /C:"failed GPU" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Failed GPU string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex2 ) :nex2 findstr /I /C:"unspecified launch failure" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Unspecified Launch Failure string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex3 ) :nex3 findstr /I /C:"Miner thread hangs, need to restart miner!" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner thread hangs, need to restart miner! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex4 )
:nex4 set Programm=EthDcrMiner64.exe
tasklist | find /i "%Programm%" if %errorlevel% == 0 ( echo Prozess "%Programm%" läuft goto :nex5 ) else ( echo %date% %time% Prozess "%Programm%" läuft nicht goto :run2ME )
:nex5 findstr /I /C:"Cannot connect to eu1.ethermine.org:4444" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner Cannot Connect! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :nex6 )
:nex6 findstr /I /C:"Socket was closed remotely (by pool)" "D:\Ethermine\%_lastFile%" if %ERRORLEVEL% == 0 ( echo %date% %time% Miner Cannot Connect! string found> "D:\Ethermine\shutdowns.txt" goto :run2ME ) ELSE ( goto :noerrors )
Sorry, aber zu was braucht man so ein Skript? Sollte die Hashrate deines Rigs immer wieder abfallen und dies dann nur durch einen Neustart behoben werden können, würde ich den Fehler zuerst mal in deinem Rig Setup suchen. Oder hab ich vlcht. den Nutzen des Skripts falsch verstanden?
|