Bitcoin Forum
May 25, 2024, 09:03:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Need simple batch restart miner when GPU not working  (Read 354 times)
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 14, 2018, 12:23:04 PM
 #1

I am using a batch restart miner every hour.

I need a simple GPU watcher, every 10 second check if GPU is over 99%, after triple check if it is lower than 99%, it autorestart miner.

I need just to add another loop in the batch checking GPU.

This is the original code

:loop1
START CMD /C "c:\Users\Administrator\Desktop\ccminer.bat"
timeout /T 3600
taskkill /F /IM ccminer.exe
timeout /T 2
goto loop1
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 14, 2018, 04:41:43 PM
 #2

 Roll Eyes
DJMinerOne
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 14, 2018, 05:04:33 PM
 #3

Here’s an alternative for you.  Install Hardware Info64 (HWiNFO).  Within that tool on the “Alerts” tab you can trigger a batch file when a sensor exceeds a boundary you define.  For instance, I have it set to send me a text message (via BLAT) whenever my GPU temperatures fall below 30c (which means they are not working).

The batch file could also trigger the “shutdown /r” command.
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 14, 2018, 07:51:36 PM
 #4

Here’s an alternative for you.  Install Hardware Info64 (HWiNFO).  Within that tool on the “Alerts” tab you can trigger a batch file when a sensor exceeds a boundary you define.  For instance, I have it set to send me a text message (via BLAT) whenever my GPU temperatures fall below 30c (which means they are not working).

The batch file could also trigger the “shutdown /r” command.


Really cool is that what I am searching for months.

Thank you a lot.

Maybe is more faster to look at wattage instead temperature.

BTW i write a batch, when temperature is less than 55 degrees it restart miner automatically.

Maybe it is better make 2 alerts.
If a gpu still with low temp the system will restart.

DJMinerOne
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 14, 2018, 09:32:51 PM
 #5

I’m glad I could help! 

I've found that the temperature falls pretty fast (within about 5-10 seconds).

I’d suggest putting a timer before automatically restarting… or some feature that allows you to stop the auto-restart.  It’s really annoying when I stop the miner for some rig maintenance, then the darn thing automatically reboots!

If you’re looking for information on how to send a text from a batch file, I found this article helpful.   https://blog.frogslayer.com/sending-an-email-through-google-smtp-via-windows-command-line/

One more thing I’ve found to help improve my uptime is the ability to reboot my rig from my phone when it’s totally hung up and I’m not home.  A device similar to “Z-Wave Plus Wireless Smart Lighting Control Appliance Module” ($40 Amazon) is very helpful!  Using that with TeamViewer on my phone really helps me monitor/control the health of my rigs.
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 14, 2018, 11:50:59 PM
 #6

I’m glad I could help! 

I've found that the temperature falls pretty fast (within about 5-10 seconds).

I’d suggest putting a timer before automatically restarting… or some feature that allows you to stop the auto-restart.  It’s really annoying when I stop the miner for some rig maintenance, then the darn thing automatically reboots!

If you’re looking for information on how to send a text from a batch file, I found this article helpful.   https://blog.frogslayer.com/sending-an-email-through-google-smtp-via-windows-command-line/

One more thing I’ve found to help improve my uptime is the ability to reboot my rig from my phone when it’s totally hung up and I’m not home.  A device similar to “Z-Wave Plus Wireless Smart Lighting Control Appliance Module” ($40 Amazon) is very helpful!  Using that with TeamViewer on my phone really helps me monitor/control the health of my rigs.


Yes I put 30 seconds before it restarts the rig and in addition I check the internet connection,  if it is lost I don't want the rig loop restart.

I have similar device, if it lags i force restart, there is also usb watchdog do the same automatically i will test.

The email send maybe will be the long part to configure but for now i am pretty happy.
VyprBTC
Full Member
***
Offline Offline

Activity: 350
Merit: 100



View Profile
January 15, 2018, 12:34:52 AM
 #7

I’m glad I could help! 

I've found that the temperature falls pretty fast (within about 5-10 seconds).

I’d suggest putting a timer before automatically restarting… or some feature that allows you to stop the auto-restart.  It’s really annoying when I stop the miner for some rig maintenance, then the darn thing automatically reboots!

If you’re looking for information on how to send a text from a batch file, I found this article helpful.   https://blog.frogslayer.com/sending-an-email-through-google-smtp-via-windows-command-line/

One more thing I’ve found to help improve my uptime is the ability to reboot my rig from my phone when it’s totally hung up and I’m not home.  A device similar to “Z-Wave Plus Wireless Smart Lighting Control Appliance Module” ($40 Amazon) is very helpful!  Using that with TeamViewer on my phone really helps me monitor/control the health of my rigs.


Yes I put 30 seconds before it restarts the rig and in addition I check the internet connection,  if it is lost I don't want the rig loop restart.

I have similar device, if it lags i force restart, there is also usb watchdog do the same automatically i will test.

The email send maybe will be the long part to configure but for now i am pretty happy.



Issue I was having is these scripts don't work if the entire rig freezes so you 100% need a smart plug or another way to remote reboot the actual PSU
DJMinerOne
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 15, 2018, 02:16:31 AM
 #8

Totally agree!  One way I helped with the automation on that is to have a non-mining PC that is on the same network do a ping to the miner at a specific time interval.  If the ping fails, then it sends a text to my phone and make it my decision on whether or not to re-boot via the smart plug.  (That central PC could also issue the command to the smart plug to reboot, but I figured at some point a human has to get involved).

Here's a snippet of code from that .bat


:STARTPING1

PING -n 1 %IPV4_MINER1%
PING -n 1 %IPV4_MINER1%|find "TTL" >NUL
IF     ERRORLEVEL 1 goto :MINER1OFFLINE
IF %MINER1_CTR% NEQ 1 (
   blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %ONLINE1% -body "%DATE% - %TIME%"
   set /a MINER1_CTR=1
   )
goto :STARTPING2

:MINER1OFFLINE

if %MINER1_CTR% gtr 2 goto :STARTPING2
blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %SUBJECT1% -body "%DATE% - %TIME%"
set /a MINER1_CTR+=1

:STARTPING2
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 15, 2018, 02:25:24 PM
 #9

Do you know if it is possible to ping a Teamviewer id instead ip number ?

Because ip number can be changed, teamviewer id still the same.
mshordja
Member
**
Offline Offline

Activity: 146
Merit: 10


View Profile WWW
January 15, 2018, 04:24:15 PM
 #10

Totally agree!  One way I helped with the automation on that is to have a non-mining PC that is on the same network do a ping to the miner at a specific time interval.  If the ping fails, then it sends a text to my phone and make it my decision on whether or not to re-boot via the smart plug.  (That central PC could also issue the command to the smart plug to reboot, but I figured at some point a human has to get involved).

Here's a snippet of code from that .bat


:STARTPING1

PING -n 1 %IPV4_MINER1%
PING -n 1 %IPV4_MINER1%|find "TTL" >NUL
IF     ERRORLEVEL 1 goto :MINER1OFFLINE
IF %MINER1_CTR% NEQ 1 (
   blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %ONLINE1% -body "%DATE% - %TIME%"
   set /a MINER1_CTR=1
   )
goto :STARTPING2

:MINER1OFFLINE

if %MINER1_CTR% gtr 2 goto :STARTPING2
blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %SUBJECT1% -body "%DATE% - %TIME%"
set /a MINER1_CTR+=1

:STARTPING2

can you attach here the bat file Smiley not so practice with that Cheesy

DJMinerOne
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 15, 2018, 08:37:34 PM
 #11

Totally agree!  One way I helped with the automation on that is to have a non-mining PC that is on the same network do a ping to the miner at a specific time interval.  If the ping fails, then it sends a text to my phone and make it my decision on whether or not to re-boot via the smart plug.  (That central PC could also issue the command to the smart plug to reboot, but I figured at some point a human has to get involved).

Here's a snippet of code from that .bat




can you attach here the bat file Smiley not so practice with that Cheesy

Hope it meets your needs...

echo off
rem *****************************************************************************************************************
rem *                                                                                                               *
rem *  Objective:  Determine if an IP address is pingable (online).  If not                                         *
rem *              send a text message using gmail.  (I know this code could be tightened up... but it works.       *
rem *                                                                                                               *
rem *  Components:  BLAT.exe ( https://sourceforge.net/projects/blat/?source=typ_redirect)                          *
rem *               STUNNEL.exe (https://www.stunnel.org/downloads.html)                                            *
rem *                    Follow these instructions to install the above:                                            *
rem *                    https://blog.frogslayer.com/sending-an-email-through-google-smtp-via-windows-command-line/ *
rem *                                                                                                               *
rem *  IMPORTANT:  Password is stored unencrypted in this batch file.  So do not use an important e-mail account    *
rem *                                                                                                               *
rem *  Create date:  2017-10-29 DJJ                                                                                 *
rem *  Change log:                                                                                                  *
rem *                                                                                                               *
rem *****************************************************************************************************************

rem *** This is gmail's server
set SERVER=127.0.0.1:1099

set USER=your-gmail-address-here@gmail.com
set PW=your-gmail-password-here
set FROMNAME=your-name

rem ***   Put the send-to phone number for SMS below.  "@vtext.com" works for verizon, you'd have to find appropriate domain for your carrier.
set TO=1234567890@vtext.com
set SUBJECT1="Miner1 did not respond to ping"
set SUBJECT2="Miner2 did not respond to ping"
set SUBJECT3="Miner3 did not respond to ping"
set ONLINE1="Miner1 now responding to ping"
set ONLINE2="Miner2 now responding to ping"
set ONLINE3="Miner3 now responding to ping"

rem *** Note this will only work for static IP addresses.  You can also use computer name.  "set IPV4_MINER1=Miner1" (assuming "Miner1" is computer name).
set IPV4_MINER1=10.0.0.39
set IPV4_MINER2=10.0.0.40
set IPV4_MINER3=10.0.0.42
set IPV4_TEST=10.0.0.19

rem *** The idea behind the counter is I only want two messages sent to me when miner goes down.
set /a MINER1_CTR=1
set /a MINER2_CTR=1
set /a MINER3_CTR=1

:STARTPING1

PING -n 1 %IPV4_MINER1%
PING -n 1 %IPV4_MINER1%|find "TTL" >NUL
IF     ERRORLEVEL 1 goto :MINER1OFFLINE
IF %MINER1_CTR% NEQ 1 (
   blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %ONLINE1% -body "%DATE% - %TIME%"
   set /a MINER1_CTR=1
   )
goto :STARTPING2

:MINER1OFFLINE

if %MINER1_CTR% gtr 2 goto :STARTPING2
blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %SUBJECT1% -body "%DATE% - %TIME%"
set /a MINER1_CTR+=1

:STARTPING2
PING -n 1 %IPV4_MINER2%
PING -n 1 %IPV4_MINER2%|find "TTL" >NUL
IF     ERRORLEVEL 1 goto :MINER2OFFLINE
IF %MINER2_CTR% NEQ 1 (
   blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %ONLINE2% -body "%DATE% - %TIME%"
   set /a MINER2_CTR=1
   )
goto :STARTPING3

:MINER2OFFLINE

if %MINER2_CTR% gtr 2 goto :WAIT
blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %SUBJECT2% -body "%DATE% - %TIME%"
set /a MINER2_CTR+=1

:STARTPING3
PING -n 1 %IPV4_MINER3%
PING -n 1 %IPV4_MINER3%|find "TTL" >NUL
IF     ERRORLEVEL 1 goto :MINER3OFFLINE
IF %MINER2_CTR% NEQ 1 (
   blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %ONLINE3% -body "%DATE% - %TIME%"
   set /a MINER3_CTR=1
   )
goto :STARTPING4

:MINER3OFFLINE

if %MINER3_CTR% gtr 2 goto :WAIT
blat -server %SERVER% -f %FROMNAME% -u %USER% -pw %PW% -to %TO% -subject %SUBJECT3% -body "%DATE% - %TIME%"
set /a MINER3_CTR+=1

:STARTPING4

:WAIT

rem ** Wait 10 minutes and try again.
timeout /t 600
goto :STARTPING1
DJMinerOne
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
January 15, 2018, 09:03:26 PM
 #12

Do you know if it is possible to ping a Teamviewer id instead ip number ?

Because ip number can be changed, teamviewer id still the same.

I haven't tried that.  But TeamViewer does have an extensive suite of API's:  https://dl.tvcdn.de/integrate/TeamViewer_API_Documentation.pdf
martyroz
Full Member
***
Offline Offline

Activity: 325
Merit: 110


View Profile
January 15, 2018, 09:19:58 PM
 #13

Totally agree!  One way I helped with the automation on that is to have a non-mining PC that is on the same network do a ping to the miner at a specific time interval.  If the ping fails, then it sends a text to my phone and make it my decision on whether or not to re-boot via the smart plug.

Here's what I do;

* Set up 'Mining Observer' (android) on your phone.
* It vibrates / illuminates / plays a sound when a rigs hashrate drops below a user-specified level (I set it to 90% indicating rig failure) You also set the query interval
* First attempt to remote in to see if it's miner-related, if remote viewer fails;
* Flick smart plug

I get about 5% false-positives on Mining Observer due to Cryptonight rigs hitting a lean spot.

I will admit this needs optimization - I want to monitor the hashrate of my windows rigs and automatically restart miner after a crash or when Vegas overheat and stop hashing.
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 15, 2018, 09:41:51 PM
 #14

Totally agree!  One way I helped with the automation on that is to have a non-mining PC that is on the same network do a ping to the miner at a specific time interval.  If the ping fails, then it sends a text to my phone and make it my decision on whether or not to re-boot via the smart plug.

Here's what I do;

* Set up 'Mining Observer' (android) on your phone.
* It vibrates / illuminates / plays a sound when a rigs hashrate drops below a user-specified level (I set it to 90% indicating rig failure) You also set the query interval
* First attempt to remote in to see if it's miner-related, if remote viewer fails;
* Flick smart plug

I get about 5% false-positives on Mining Observer due to Cryptonight rigs hitting a lean spot.

I will admit this needs optimization - I want to monitor the hashrate of my windows rigs and automatically restart miner after a crash or when Vegas overheat and stop hashing.

I tried but it works only with public pools.
What if I need to check rig mining in solo?
BitBustah
Hero Member
*****
Offline Offline

Activity: 1218
Merit: 534



View Profile
January 16, 2018, 04:23:17 AM
 #15

Do you know if it is possible to ping a Teamviewer id instead ip number ?

Because ip number can be changed, teamviewer id still the same.


You _could_ use a No-IP service (https://www.noip.com/). Have the little program run in the back and you can always ping your hostname, no matter what your IP is.


I have been using 3 No-IP hostnames for my security cameras for over 3 years. Never had a problem.
BitBustah
Hero Member
*****
Offline Offline

Activity: 1218
Merit: 534



View Profile
January 16, 2018, 04:30:23 AM
 #16

Issue I was having is these scripts don't work if the entire rig freezes so you 100% need a smart plug or another way to remote reboot the actual PSU

You would need one of these:
https://www.amazon.com/Computer-Dongle-Watchdog-Mining-Unattended/dp/B0767GL858

https://www.2dehands.be/computer-game-consoles/computer-onderdelen/videokaarten/usb-mining-crash-tool-394814590.html



I think 20 euros is not a lot if it actually works.
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
January 18, 2018, 12:44:56 PM
 #17

Strange that there is no ready to go system to check if a teamviewer ID is not online or chrome remote desktop control API or app to check if an host is online or not.

I think is very simple but I searched nothing found for now.
ibinsad (OP)
Sr. Member
****
Offline Offline

Activity: 616
Merit: 250


View Profile
February 08, 2018, 09:08:42 PM
 #18

If using Anydesk instead Teamviewer I notice that I don't have license issues.

Then in Anydesk there is a function to know the status of a computer
 --get-status

Is there anyone can make a batch with  --get-status function?

If one or more rigs is not reached it can delivery an email to notify.
BitBustah
Hero Member
*****
Offline Offline

Activity: 1218
Merit: 534



View Profile
February 08, 2018, 09:26:30 PM
 #19

Strange that there is no ready to go system to check if a teamviewer ID is not online or chrome remote desktop control API or app to check if an host is online or not.

I think is very simple but I searched nothing found for now.


It's not simple, I checked.
Read the TV API manual. You'll see.
CryptoWatcher420
Sr. Member
****
Offline Offline

Activity: 462
Merit: 258

Small Time Miner, Rig Builder, Crypto Trader


View Profile
February 08, 2018, 09:41:08 PM
 #20

here is the best solution, if you have a gpu that is having issues that means you've got an underlying problem somewhere which should be checked out, if you rig CANNOT RUN for 30+ days without any problems there's an issue you need to fix and its as simple as that, stop trying to use some script or little program to reboot the rig when clearly you've got a problem somewhere. the one thing everyone posted on this thread has FAILED to even mention.
a good running rig can run for months with no problems what so ever, the fact you are having issues shows there's a problem somewhere

6pin to EPS 12v 4+4pin w/pigtail & 2.5mm barrel plug for Pico Psu for SERVER PSU ONLY GPU MINING RIGS! | Donations: BTC-  | Join Me on Discord! https://discord.gg/VDwWFcK
Pages: [1] 2 »  All
  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!