Bitcoin Forum
May 14, 2024, 06:30:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Skript: Wenn Hashrate zu niedrig, PC reboot  (Read 161 times)
BudSpenser (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
January 23, 2018, 11:43:13 AM
Last edit: January 24, 2018, 02:40:26 AM by BudSpenser
 #1

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!

Code:
@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
)
1715668202
Hero Member
*
Offline Offline

Posts: 1715668202

View Profile Personal Message (Offline)

Ignore
1715668202
Reply with quote  #2

1715668202
Report to moderator
1715668202
Hero Member
*
Offline Offline

Posts: 1715668202

View Profile Personal Message (Offline)

Ignore
1715668202
Reply with quote  #2

1715668202
Report to moderator
1715668202
Hero Member
*
Offline Offline

Posts: 1715668202

View Profile Personal Message (Offline)

Ignore
1715668202
Reply with quote  #2

1715668202
Report to moderator
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
nathan_tek
Member
**
Offline Offline

Activity: 248
Merit: 26


View Profile
February 23, 2018, 02:57:45 PM
 #2

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!

Code:
@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?

⬣⬣⬣⬣⬣⬣⬣⬣    ⬣⬣⬣⬣    ⬣⬣    ⬣     C O M B O     ⬣    ⬣⬣    ⬣⬣⬣⬣    ⬣⬣⬣⬣⬣⬣⬣⬣
A leading provider of scaling solutions for Web3 game developers
|      Twitter      |    Telegram    |     Discord     |     Medium     |      GitHub      |
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!