Author

Topic: [ mining os ] nvoc - page 135. (Read 418546 times)

full member
Activity: 200
Merit: 101
November 16, 2017, 11:17:27 AM

Why do we even need to check the second connection as long as our main connection to the pool is working? Even if the miner is mining dev fee on another pool the utilization will be up and watchdog will not restart the miner

The problem is that when the ZM miner can't hit the dev pool, it stops mining, the GPU utilization goes to zero, and watchdog starts restarting the miner and the host. Further, folks running on USB can have total failures as a result of all of the reboots.

That's a completely different issue that needs to be looked at and come with a solution for ZM.

If ZM can't hit the dev pool and stops mining because of that,  there's not much we can do about it, we can't switch the dev's pool... the only solution would be if ZM is detected as miner and pool is up but utilization is zero (asuming dev's pool is down) to switch to another miner.
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 10:28:28 AM
This is my latest approach to get server and port from 1bash for wdog check
Please check, test and let me know if there is any codes that can be simplified or corrected.

Tested many coins but not all,
Claymore dual Mining included to check main server
ZM dual server check not included but can be done easily if not fixed from dstm.


So many echo included for testing, will be removed later

Code:
#!/bin/bash
source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* || $COIN == "ETH" ||  $COIN == "ETC" || $COIN == "EXP" || $COIN == "UBQ" || $COIN == "MUSIC" || $COIN == "SOIL" ]]
then
  #echo "stratum/ethash"
  PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
  #echo "Server: $PING_SERVER"
  PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
  #echo "Port: $PING_PORT"

  if nc -vzw2 $PING_SERVER $PING_PORT;
  then
    #echo "Strartum Server, INTERNET_IS_GO=1"
    INTERNET_IS_GO=1
  else
    echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN"  | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
    INTERNET_IS_GO=0
  fi


elif [[  $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
  #echo "Cant get pool, check google"
  if nc -vzw2 google.com 443
  then
    #echo "Cant get pool, google is up"
    INTERNET_IS_GO=1
  else
    echo "WARNING:  $(date) - Cant reach google"  | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
    INTERNET_IS_GO=0
  fi


elif [[ $CURRENT_COIN == *DUAL*  ]]
then
  CURRENT_COIN=$( head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//' | sed 's/DUAL_//' | cut -d _ -f 1)
  #echo "$CURRENT_COIN"

  CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
  #echo $CURRENT_COIN_POOL

  POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
  #echo "$POOL_SERVER"

  CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
  #echo "$CURRENT_COIN_PORT"

  PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
  #echo "Server: $PING_SERVER"

  PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
  #echo "Port: $PING_PORT"

  #echo "Dual mining, check main server $PING_SERVER "
  if nc -vzw2 $PING_SERVER $PING_PORT;

  then
    #echo "Dual mining, main server $PING_SERVER is up"
    INTERNET_IS_GO=1
  else
    echo "WARNING:  $(date) - Cant reach main server $PING_SERVER " | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
    INTERNET_IS_GO=0
  fi


else

  PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
  #echo "Server: $PING_SERVER"
  PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
  #echo "Port: $PING_PORT"
  if nc -vzw1 $PING_SERVER $PING_PORT
  then
    #echo "Not a stratum server,INTERNET_IS_GO=1" #  | tee -a ${LOG_FILE}
    INTERNET_IS_GO=1
  else
    echo "WARNING:  $(date) - Mining Pool Server $PING_SERVER is DOWN"   | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
    INTERNET_IS_GO=0
  fi

fi




Edit:
All this can be much simpler if all coin addresses become same in 1bash
Example:

new 1bash
Code:
ZCOIN_WORKER="$WORKERNAME"
ZCOIN_ADDRESS="papampi"
ZCOIN_POOL="xzc.suprnova.cc"
ZCOIN_PORT=1569

current 1bash:
Code:
ZCOIN_WORKER="$WORKERNAME"
ZCOIN_ADDRESS="papampi"
ZCOIN_POOL="stratum+tcp://xzc.suprnova.cc:1569"


new 3main:
Code:
if [ $COIN == "ZCOIN" ]
then
HCD='/home/m1/TPccminer/ccminer'

ADDR="$ZCOIN_ADDRESS.$ZCOIN_WORKER"

screen -dmSL miner $HCD -a lyra2z -o stratum+tcp://$ZCOIN_POOL:ZCOIN_PORT -u $ADDR -p x

current 3main:
Code:
screen -dmSL miner $HCD -a lyra2z -o $ZCOIN_POOL -u $ADDR -p x
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 10:26:09 AM


Thanks a lot mate,
I think your approach is much better than stubo which is based on guessing which one is the server

I am thinking that the first IP/port is for the miner's DEV share and I am certain that the second is our connection to the mining pool (us-east.equihash-hub.miningpoolhub.com) since the destination port (20570) matches what I have configured in 1bash. So, assuming all of this is correct, we can then just use the same check to make sure that we can connect to both pools:

But both needs a stable mining process to be running, and when pool has problem we dont have it
So I cant understand when we have all the details in 1bash why we dont strip it from there with some simple commands.

You see any problems in my approach here :

Code:
# Begin papampi Mod

source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* ]]
then
    #echo "stratum"
    PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
    #echo "Server: $PING_SERVER"
    PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
    #echo "Port: $PING_PORT"    

if nc -vzw2 $PING_SERVER $PING_PORT;
    then
        # echo "Strartum Server, INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
elif [[ $CURRENT_COIN == *DUAL*  || $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
    #echo "Dual mining, check google"
    if nc -vzw2 google.com 443
    then
        # echo "Dual mining, google is up"
        #echo "            INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        #echo "Dual mining, google is down"
        echo "WARNING:  $(date) - Cant reach google" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
else
      PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
      #echo "Server: $PING_SERVER"
      PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
      #echo "Port: $PING_PORT"
      if nc -vzw1 $PING_SERVER $PING_PORT
    then
        #echo "Not a stratum server,INTERNET_IS_GO=1" | tee -a ${LOG_FILE}
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
fi


       # End papampi Mod

IMO best way to test pool connectivity is having pool and port in vars from 1bash or whatever (as you pointed out).
I did not know those already exist.

Your idea looks good to me, guess just need a exhaustive testing.  

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

@Papampi, I think the 3 ways are ok as long as code prevents the pitfalls that come along with it.
They are not mutually exclusive, as I said all look good to me as long as well tested.

Tottaly agree that it needs testing
I tested with over 20 coins and that was where I found that zpool_skunk has different naming in 1bash and can not get its pool and server with same approach so for now put it in the google ping part

I will do more testing for sure and expect you experts do the same as well,
will try to get dual mining pools from 1bash and fix them as well.

Sorry I don't have a 19+ installed and that is why I can't do exhaustive testing with different miners. I can not even try your WTM switch which I really want to do.
Any other thing I can help just let me know, but be aware I don't think I'll be very much around next week.

Thanks a lot for all the helps mate
I think its time to update to 19+ after next week ... lol
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 10:24:37 AM

Why do we even need to check the second connection as long as our main connection to the pool is working? Even if the miner is mining dev fee on another pool the utilization will be up and watchdog will not restart the miner

The problem is that when the ZM miner can't hit the dev pool, it stops mining, the GPU utilization goes to zero, and watchdog starts restarting the miner and the host. Further, folks running on USB can have total failures as a result of all of the reboots.

Isnt it fixed in latest version as you said?
Either way we can add a statement to check if zm_or_ewbf=zm then check that other server too
member
Activity: 117
Merit: 10
November 16, 2017, 09:50:05 AM


Thanks a lot mate,
I think your approach is much better than stubo which is based on guessing which one is the server

I am thinking that the first IP/port is for the miner's DEV share and I am certain that the second is our connection to the mining pool (us-east.equihash-hub.miningpoolhub.com) since the destination port (20570) matches what I have configured in 1bash. So, assuming all of this is correct, we can then just use the same check to make sure that we can connect to both pools:

But both needs a stable mining process to be running, and when pool has problem we dont have it
So I cant understand when we have all the details in 1bash why we dont strip it from there with some simple commands.

You see any problems in my approach here :

Code:
# Begin papampi Mod

source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* ]]
then
    #echo "stratum"
    PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
    #echo "Server: $PING_SERVER"
    PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
    #echo "Port: $PING_PORT"    

if nc -vzw2 $PING_SERVER $PING_PORT;
    then
        # echo "Strartum Server, INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
elif [[ $CURRENT_COIN == *DUAL*  || $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
    #echo "Dual mining, check google"
    if nc -vzw2 google.com 443
    then
        # echo "Dual mining, google is up"
        #echo "            INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        #echo "Dual mining, google is down"
        echo "WARNING:  $(date) - Cant reach google" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
else
      PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
      #echo "Server: $PING_SERVER"
      PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
      #echo "Port: $PING_PORT"
      if nc -vzw1 $PING_SERVER $PING_PORT
    then
        #echo "Not a stratum server,INTERNET_IS_GO=1" | tee -a ${LOG_FILE}
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
fi


       # End papampi Mod

IMO best way to test pool connectivity is having pool and port in vars from 1bash or whatever (as you pointed out).
I did not know those already exist.

Your idea looks good to me, guess just need a exhaustive testing.  

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

@Papampi, I think the 3 ways are ok as long as code prevents the pitfalls that come along with it.
They are not mutually exclusive, as I said all look good to me as long as well tested.

Tottaly agree that it needs testing
I tested with over 20 coins and that was where I found that zpool_skunk has different naming in 1bash and can not get its pool and server with same approach so for now put it in the google ping part

I will do more testing for sure and expect you experts do the same as well,
will try to get dual mining pools from 1bash and fix them as well.

Sorry I don't have a 19+ installed and that is why I can't do exhaustive testing with different miners. I can not even try your WTM switch which I really want to do.
Any other thing I can help just let me know, but be aware I don't think I'll be very much around next week.
member
Activity: 224
Merit: 13
November 16, 2017, 09:23:19 AM

Why do we even need to check the second connection as long as our main connection to the pool is working? Even if the miner is mining dev fee on another pool the utilization will be up and watchdog will not restart the miner

The problem is that when the ZM miner can't hit the dev pool, it stops mining, the GPU utilization goes to zero, and watchdog starts restarting the miner and the host. Further, folks running on USB can have total failures as a result of all of the reboots.
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 09:03:25 AM

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

Exactly. We want it to be simple which is why I originally and still stand by the simple check for internet connectivity only in the watchdog script. I have already demonstrated with ZM that looking at 1bash is not sufficient in that it doesn't account for the hidden connection to the pool for the DEV fee. I also presented a potential solution for how to overcome this but I think we all agree that it is too complex for nvOC. So, we are back to where we started.

Thanks.

Why do we even need to check the second connection as long as our main connection to the pool is working? Even if the miner is mining dev fee on another pool the utilization will be up and watchdog will not restart the miner

Thats the same case with dual mining claymore and I'm writing its code to grab the pool/port from 1bash for dual as well
full member
Activity: 200
Merit: 101
November 16, 2017, 08:59:32 AM

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

Exactly. We want it to be simple which is why I originally and still stand by the simple check for internet connectivity only in the watchdog script. I have already demonstrated with ZM that looking at 1bash is not sufficient in that it doesn't account for the hidden connection to the pool for the DEV fee. I also presented a potential solution for how to overcome this but I think we all agree that it is too complex for nvOC. So, we are back to where we started.

Thanks.

Why do we even need to check the second connection as long as our main connection to the pool is working? Even if the miner is mining dev fee on another pool the utilization will be up and watchdog will not restart the miner
member
Activity: 224
Merit: 13
November 16, 2017, 08:42:04 AM

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

Exactly. We want it to be simple which is why I originally and still stand by the simple check for internet connectivity only in the watchdog script. I have already demonstrated with ZM that looking at 1bash is not sufficient in that it doesn't account for the hidden connection to the pool for the DEV fee. I also presented a potential solution for how to overcome this but I think we all agree that it is too complex for nvOC. So, we are back to where we started.

Thanks.
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 08:27:35 AM
I updated 3/5 rigs from 1.3 -> 1.4

The new rigs I seem to get lower sol's when I monitor the miner it has an avg 85watt and 370 sol.

However my powerlimit is set at 105 watt and it should have 100-105watt and 440 sol.

Anybody else experiencing the issues?

This is on all 1.4 systems.

Anybody?

I Do not have lower hash rate since I get to 1.4
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 08:26:43 AM


Thanks a lot mate,
I think your approach is much better than stubo which is based on guessing which one is the server

I am thinking that the first IP/port is for the miner's DEV share and I am certain that the second is our connection to the mining pool (us-east.equihash-hub.miningpoolhub.com) since the destination port (20570) matches what I have configured in 1bash. So, assuming all of this is correct, we can then just use the same check to make sure that we can connect to both pools:

But both needs a stable mining process to be running, and when pool has problem we dont have it
So I cant understand when we have all the details in 1bash why we dont strip it from there with some simple commands.

You see any problems in my approach here :

Code:
# Begin papampi Mod

source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* ]]
then
    #echo "stratum"
    PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
    #echo "Server: $PING_SERVER"
    PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
    #echo "Port: $PING_PORT"    

if nc -vzw2 $PING_SERVER $PING_PORT;
    then
        # echo "Strartum Server, INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
elif [[ $CURRENT_COIN == *DUAL*  || $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
    #echo "Dual mining, check google"
    if nc -vzw2 google.com 443
    then
        # echo "Dual mining, google is up"
        #echo "            INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        #echo "Dual mining, google is down"
        echo "WARNING:  $(date) - Cant reach google" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
else
      PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
      #echo "Server: $PING_SERVER"
      PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
      #echo "Port: $PING_PORT"
      if nc -vzw1 $PING_SERVER $PING_PORT
    then
        #echo "Not a stratum server,INTERNET_IS_GO=1" | tee -a ${LOG_FILE}
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
fi


       # End papampi Mod

IMO best way to test pool connectivity is having pool and port in vars from 1bash or whatever (as you pointed out).
I did not know those already exist.

Your idea looks good to me, guess just need a exhaustive testing.  

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

@Papampi, I think the 3 ways are ok as long as code prevents the pitfalls that come along with it.
They are not mutually exclusive, as I said all look good to me as long as well tested.

Tottaly agree that it needs testing
I tested with over 20 coins and that was where I found that zpool_skunk has different naming in 1bash and can not get its pool and server with same approach so for now put it in the google ping part

I will do more testing for sure and expect you experts do the same as well,
will try to get dual mining pools from 1bash and fix them as well.
newbie
Activity: 54
Merit: 0
November 16, 2017, 08:23:43 AM
I updated 3/5 rigs from 1.3 -> 1.4

The new rigs I seem to get lower sol's when I monitor the miner it has an avg 85watt and 370 sol.

However my powerlimit is set at 105 watt and it should have 100-105watt and 440 sol.

Anybody else experiencing the issues?

This is on all 1.4 systems.

Anybody?
member
Activity: 117
Merit: 10
November 16, 2017, 08:02:40 AM


I don't use (and never did) wdog at all but I think is a must for everyone using it to make sure that the gpu % util is ok.
That's the point to watch that the pool is up and running.
I've elaborated this other example of how to get the data to make that check. I think is quite "universal" and should work with any miner, so if some of you want to test it that would be good info for developers.

Code:
#! /bin/bash

# Find out miner's name
P_NAME=$(ps aux | grep -v grep| grep SCREEN | grep miner | sed 's/ /\n/g' | grep /home/m1 | rev | cut -d"/" -f1 | rev)
# Find out miner's process number (PID)
P_NUMBER=$(pgrep $P_NAME)
# Find out pool ip and port
IP_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f1)
PORT_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f2)

echo "Miner's name : " $P_NAME
echo "Miner PID    : " $P_NUMBER
echo "Pool's IP    : " $IP_POOL
echo "pool's port  : " $PORT_POOL

Hope that Stubo's idea and this one help devs to consolidate wdog.

Thanks a lot mate,
I think your approach is much better than stubo which is based on guessing which one is the server

I am thinking that the first IP/port is for the miner's DEV share and I am certain that the second is our connection to the mining pool (us-east.equihash-hub.miningpoolhub.com) since the destination port (20570) matches what I have configured in 1bash. So, assuming all of this is correct, we can then just use the same check to make sure that we can connect to both pools:

But both needs a stable mining process to be running, and when pool has problem we dont have it
So I cant understand when we have all the details in 1bash why we dont strip it from there with some simple commands.

You see any problems in my approach here :

Code:
# Begin papampi Mod

source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* ]]
then
    #echo "stratum"
    PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
    #echo "Server: $PING_SERVER"
    PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
    #echo "Port: $PING_PORT"    

if nc -vzw2 $PING_SERVER $PING_PORT;
    then
        # echo "Strartum Server, INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
elif [[ $CURRENT_COIN == *DUAL*  || $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
    #echo "Dual mining, check google"
    if nc -vzw2 google.com 443
    then
        # echo "Dual mining, google is up"
        #echo "            INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        #echo "Dual mining, google is down"
        echo "WARNING:  $(date) - Cant reach google" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
else
      PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
      #echo "Server: $PING_SERVER"
      PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
      #echo "Port: $PING_PORT"
      if nc -vzw1 $PING_SERVER $PING_PORT
    then
        #echo "Not a stratum server,INTERNET_IS_GO=1" | tee -a ${LOG_FILE}
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
fi


       # End papampi Mod

IMO best way to test pool connectivity is having pool and port in vars from 1bash or whatever (as you pointed out).
I did not know those already exist.

Your idea looks good to me, guess just need a exhaustive testing.  

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand

@Papampi, I think the 3 ways are ok as long as code prevents the pitfalls that come along with it.
They are not mutually exclusive, as I said all look good to me as long as well tested.
member
Activity: 117
Merit: 10
November 16, 2017, 07:56:11 AM

Mmmm, I see, thx for testing the code. I only use claymore and ewbf, never found so many open connection from the miner.
I think @Papampi's idea and yours are both great.

About my code and your output I've notice that only 2 ips (guess must be pool's ips) are public and all others are private.
In case of need should be easy to find the local network range and remove ip+port for those ones and keep only the public ips+ports.
That way it does not matter how many ips has the pool, it would be possible to ping all of them.
Anyway, just thinking aloud. All approaches look good to me, 

Yes. I did that intentionally to prove the point that once you open the can of worms that is testing for pool connectivity, a lot of scenarios come up that makes the problem a lot more difficult than one would think at first. In that example, as I say, I am using not only the ZM miner to mine for ZEC but also cpuminer to mine for XMR. Most people don't realize that DSTM's ZM miner uses 2 connections: 1) for his connection to the pool he uses to mine for his dev share 2) the connection to whatever pool you are mining.  (Side Note: As of the 0.5.4* version, BOTH connections had to work or the miner would not mine. Those that use that miner are all too familiar with that because the pool he uses (flypool in EU) was down for a few hours last week and his miner stopped working. Needless to say, this caused quite an uproar with his users (see https://bitcointalk.org/index.php?topic=2021765.1060) and he took a savage beating.)

*Fortunately, DSTM has just released version 0.5.5 that supposedly will not block if his dev pool connection is unavailable.

Thx for sharing :-).
Talking about "can of worms", that's why we test code  Grin
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 07:50:56 AM


I don't use (and never did) wdog at all but I think is a must for everyone using it to make sure that the gpu % util is ok.
That's the point to watch that the pool is up and running.
I've elaborated this other example of how to get the data to make that check. I think is quite "universal" and should work with any miner, so if some of you want to test it that would be good info for developers.

Code:
#! /bin/bash

# Find out miner's name
P_NAME=$(ps aux | grep -v grep| grep SCREEN | grep miner | sed 's/ /\n/g' | grep /home/m1 | rev | cut -d"/" -f1 | rev)
# Find out miner's process number (PID)
P_NUMBER=$(pgrep $P_NAME)
# Find out pool ip and port
IP_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f1)
PORT_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f2)

echo "Miner's name : " $P_NAME
echo "Miner PID    : " $P_NUMBER
echo "Pool's IP    : " $IP_POOL
echo "pool's port  : " $PORT_POOL

Hope that Stubo's idea and this one help devs to consolidate wdog.

Thanks a lot mate,
I think your approach is much better than stubo which is based on guessing which one is the server

I am thinking that the first IP/port is for the miner's DEV share and I am certain that the second is our connection to the mining pool (us-east.equihash-hub.miningpoolhub.com) since the destination port (20570) matches what I have configured in 1bash. So, assuming all of this is correct, we can then just use the same check to make sure that we can connect to both pools:

But both needs a stable mining process to be running, and when pool has problem we dont have it
So I cant understand when we have all the details in 1bash why we dont strip it from there with some simple commands.

You see any problems in my approach here :

Code:
# Begin papampi Mod

source /home/m1/1bash

CURRENT_COIN=$(head -n 200 /home/m1/1bash | grep COIN= | sed 's/COIN=//' | sed 's/\"//' | sed 's/\"//')
#echo "$CURRENT_COIN"

CURRENT_COIN_POOL=$(echo {$CURRENT_COIN}_POOL |sed 's/{//' | sed 's/}//' )
#echo $CURRENT_COIN_POOL

POOL_SERVER=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
#echo "$POOL_SERVER"

CURRENT_COIN_PORT=$(echo {$CURRENT_COIN}_PORT | sed 's/{//' | sed 's/}//')
#echo "$CURRENT_COIN_PORT"

if [[ $POOL_SERVER == *stratum* ]]
then
    #echo "stratum"
    PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | cut -d':' -f1 )
    #echo "Server: $PING_SERVER"
    PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//' | sed 's/stratum+tcp\?:\/\///' | grep -Eo '[0-9]+$' )
    #echo "Port: $PING_PORT"    

if nc -vzw2 $PING_SERVER $PING_PORT;
    then
        # echo "Strartum Server, INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Stratum Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
elif [[ $CURRENT_COIN == *DUAL*  || $CURRENT_COIN == *ZPOOL_SKUNK* || $CURRENT_COIN == *SALFTER*  ]]
then
    #echo "Dual mining, check google"
    if nc -vzw2 google.com 443
    then
        # echo "Dual mining, google is up"
        #echo "            INTERNET_IS_GO=1"
        INTERNET_IS_GO=1
    else
        #echo "Dual mining, google is down"
        echo "WARNING:  $(date) - Cant reach google" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
    
else
      PING_SERVER=$( cat /home/m1/1bash | grep $CURRENT_COIN_POOL | grep -o '".*"' | sed 's/"//'| sed 's/"//')
      #echo "Server: $PING_SERVER"
      PING_PORT=$(cat /home/m1/1bash | grep $CURRENT_COIN_PORT | grep -o '".*"' | sed 's/"//' |sed 's/"//')
      #echo "Port: $PING_PORT"
      if nc -vzw1 $PING_SERVER $PING_PORT
    then
        #echo "Not a stratum server,INTERNET_IS_GO=1" | tee -a ${LOG_FILE}
        INTERNET_IS_GO=1
    else
        echo "WARNING:  $(date) - Mining Pool Server is DOWN" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
        INTERNET_IS_GO=0
    fi
fi


       # End papampi Mod

IMO best way to test pool connectivity is having pool and port in vars from 1bash or whatever (as you pointed out).
I did not know those already exist.

Your idea looks good to me, guess just need a exhaustive testing.  

I'm with you,
Dont see why going through all the problem to get them from else where when all available in 1bash

When pool is down there is no connectivity to get pool and port from and there may be no miner up to get them from running miner as well

When we can get them with some simple cat | grep | sed ... why go through all the complexity?
Isnt our goal is to make nvoc as simple as possible?

Dont understand
member
Activity: 117
Merit: 10
November 16, 2017, 07:50:37 AM
I don't use (and never did) wdog at all but I think is a must for everyone using it to make sure that the gpu % util is ok.
That's the point to watch that the pool is up and running.
I've elaborated this other example of how to get the data to make that check. I think is quite "universal" and should work with any miner, so if some of you want to test it that would be good info for developers.

Code:
#! /bin/bash

# Find out miner's name
P_NAME=$(ps aux | grep -v grep| grep SCREEN | grep miner | sed 's/ /\n/g' | grep /home/m1 | rev | cut -d"/" -f1 | rev)
# Find out miner's process number (PID)
P_NUMBER=$(pgrep $P_NAME)
# Find out pool ip and port
IP_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f1)
PORT_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f2)

echo "Miner's name : " $P_NAME
echo "Miner PID    : " $P_NUMBER
echo "Pool's IP    : " $IP_POOL
echo "pool's port  : " $PORT_POOL

Hope that Stubo's idea and this one help devs to consolidate wdog.

That is a neat idea. The code worked until I determining the IP of the pool and port. Those were set to huge strings full of IPs and ports:

Code:
m1@Testy:~$ echo "Miner's name : " $P_NAME
Miner's name :  zm
m1@Testy:~$ echo "Miner PID    : " $P_NUMBER
Miner PID    :  2191
m1@Testy:~$ echo "Pool's IP    : " $IP_POOL
Pool's IP    :  192.168.1.178 192.168.1.5 45.79.223.173 94.23.12.63 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5

m1@Testy:~$ echo "pool's port  : " $PORT_POOL
pool's port  :  42000 54332 20570 3443 64395 64396 64546 64571 64589 64608 64627 64644 64660 64677 64694 64711 64718 64734 64748 64767 64782 64795 64820 64833 64849 64860 64869 64884 64899 64918 64935 64945 64977 64988 65008 65027 65044 65064 65086 65107 65127 65145 65168 65186 65203 65219 65235 65249 65263 65277


I still don't think that checking for connectivity to a mining pool is a good idea because of all of the pitfalls in doing so as well as the odds of a good pool being down. That being said, I spent a little bit of time to develop my idea a little bit fuller. The following in totally untested in the sense that I have not put it into the watchdog and tried it out on my test rig. I have tested the logic however:

# This statement needs to be near the top of the watchdog script
Code:
NUM_MINER_CONS=0


# These statements need to be done continually [because of profit switching]
#  where we know that the miner is connected and mining, toward the end of wdog
Code:
# Store active miner connection info into MINER_CONS array
FILTER=$(ss -tn state listening | gawk 'NR > 1 {n=split($3,A,":"); B[NR-1]=A[n]} END {for (i=1; iMINER_CONS=( $(ss -tn state established dst :* | grep -P -v "$FILTER" | grep -v Port |tr -s ' '|cut -d ' ' -f 4) )
NUM_MINER_CONS=${#MINER_CONS[@]}
if [ $NUM_MINER_CONS -eq 0 ]
then
   echo "$(date) - Cannot detect active miner connections" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
fi

# This is the check that should be done if the miner is down or the GPU utilization is low
Code:
# Make sure we can connect to the mining pools iff 1 or more known miner connections
if [ $NUM_MINER_CONS -gt 0 ]
then
   CAN_HIT_POOL=0
   while [ CAN_HIT_POOL -eq 0 ]
   do
      CAN_HIT_POOL = 1
      for CON in "${MINER_CONS[@]}"
      do
         POOL_IP=$(echo $CON| cut -d':' -f 1)
         POOL_PORT=$(echo $CON| cut -d':' -f 2)
         if ! nc -vzw1 $POOL_IP $POOL_PORT;
         then
            CAN_HIT_POOL=0
            echo "$(date) - Cannot connect to mining pool $POOL_IP, port $POOL_PORT, checking again in 30 seconds..." | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
         fi
      done
      if [ CAN_HIT_POOL -eq 0 ]
      then
         sleep 30
      fi  
   done
fi

Part of the difficulty here is that some miners will have multiple connections. One such is DSTM's zm. Also, folks can be using "plusCPU". Here is what the ss code I use spits out on my test rig with that case:
Code:
m1@Testy:~$ ss -tn state established dst :* | grep -P -v "$FILTER" | grep -v Port |tr -s ' '|cut -d ' ' -f 4
172.104.94.15:20580
45.79.223.173:20570
188.165.195.21:3443
so we need to handle the IPs and ports as an array and make sure we can get to all of them, right? Anyway, my sample code does that but I still have no plans to use it. I like the simple check for basic internet connectivity better.

Thanks.


Guys, you are overthinking and overcomplicating this pool/port detection.

Isn't the simplest solution to ps/grep/awk miner process and extract the  pool_address/port from the actual command that miner is running? Don't all miners use pool_addr/port as an argument?

I'm sorry I can't pitch in with an actual code and I am just throwing ideas here... I've been extremely busy and don't have spare time to write/test any code now. Many thanks to all members that are thinkering/coding to make nvOC even better than it is!

@Leenoox, that's my thinking too. As long as we grep for "SCREEN" and "miner", pool and port will be there, but as @Stubo stated that way needs a little more elaboration because no all miners behave the same in connectivity terms.
full member
Activity: 686
Merit: 140
Linux FOREVER! Resistance is futile!!!
November 16, 2017, 07:46:05 AM

Done.
Either restart your rig or restart miner with :
Code:
pkill -e screen
pkill -f 3main

Way to go dude. Everyone should change their contributions to include this. Use it as template.

BTW, the last paragraph, if you not gonna restart the rig I think you will need to kill watchdog as well.

This will kill wdog, temp, miner and 3main
when 3main get killed it will restart all those as well
Code:
pkill -e screen
pkill -f 3main
member
Activity: 224
Merit: 13
November 16, 2017, 07:45:37 AM

Mmmm, I see, thx for testing the code. I only use claymore and ewbf, never found so many open connection from the miner.
I think @Papampi's idea and yours are both great.

About my code and your output I've notice that only 2 ips (guess must be pool's ips) are public and all others are private.
In case of need should be easy to find the local network range and remove ip+port for those ones and keep only the public ips+ports.
That way it does not matter how many ips has the pool, it would be possible to ping all of them.
Anyway, just thinking aloud. All approaches look good to me, 

Yes. I did that intentionally to prove the point that once you open the can of worms that is testing for pool connectivity, a lot of scenarios come up that makes the problem a lot more difficult than one would think at first. In that example, as I say, I am using not only the ZM miner to mine for ZEC but also cpuminer to mine for XMR. Most people don't realize that DSTM's ZM miner uses 2 connections: 1) for his connection to the pool he uses to mine for his dev share 2) the connection to whatever pool you are mining.  (Side Note: As of the 0.5.4* version, BOTH connections had to work or the miner would not mine. Those that use that miner are all too familiar with that because the pool he uses (flypool in EU) was down for a few hours last week and his miner stopped working. Needless to say, this caused quite an uproar with his users (see https://bitcointalk.org/index.php?topic=2021765.1060) and he took a savage beating.)

*Fortunately, DSTM has just released version 0.5.5 that supposedly will not block if his dev pool connection is unavailable.
full member
Activity: 200
Merit: 101
November 16, 2017, 07:39:46 AM
My approach to move logs to tmpfs :
Please check, test and share if you have better solution
We also gonna need that dirty log rotate with some modification to clear the tmpfs


Hope this helps our friends with small USB installs, I think you need at least 4GB Ram
I set the size to 512Mb, change it if you like.

First :

Code:
mkdir /home/m1/nvoc_logs

Add this line to the end of fstab : "sudo nano /etc/fstab"
Code:
tmpfs /home/m1/nvoc_logs tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=512M 0 0


While you are in /etc/fstab you can comment out last 2 lines

Code:
$
#UUID=55184403759586FB /mnt/55184403759586FB auto nosuid,nodev,nofail,x-gvfs-sh ....
#/dev/disk/by-id/usb-SanDisk_Cruzer_Blade_4C530001260812105231-0:0-part1 /mnt/u ....

mount your new tmpfs without restart:
Code:
sudo mount -a

Change in IAmNotAJeep_and_Maxximus007_WATCHDOG

Code:
# Creating a log file to record restarts
LOG_FILE="/home/m1/nvoc_logs/5_restartlog"
if [ -e "$LOG_FILE" ] ; then
  #Limit the logfile, just keep the last 2K
 echo "$( cat $LOG_FILE |  tail -n 2k)" > $LOG_FILE
fi

change in Maxximus007_AUTO_TEMPERATURE_CONTROL

Code:
# Creating a log file to record restarts
LOG_FILE="/home/m1/nvoc_logs/6_autotemplog"
if [ -e "$LOG_FILE" ] ; then
  #Limit the logfile, just keep the last 2K
 echo "$( cat $LOG_FILE |tail -n 2k)" > $LOG_FILE
fi

Change for screenlog :

Code:
sudo nano /etc/screenrc

add to end:
Code:
logfile  /home/m1/nvoc_logs/screenlog.0

Changes in /home/m1/www/cgi-bin/minerinfo :


Code:
TEMP_FAN_POWER=$(tail  -n 50 /home/m1/nvoc_logs/6_autotemplog  | grep GPU | awk '{gsub(/:/,": ")}1' |tail -n $GPU_COUNT | awk '{print $0,"
"}' )

########################### Miner Logs ###########################

if [  $COIN == "BTCZ"  ] || $COIN == "ZEC"  ] || [  $COIN == "ZEN"  ] || [  $COIN == "ZCL"  ] || [  $COIN == "HUSH"  ] || [  $COIN == "KMD"  ] && [  $ZM_or_EWBF == "ZM"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 | grep -e GPU -e "====" |grep -v '#' | tail -n $TAIL_GPU_COUNT |sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

elif [  $COIN == "BTCZ"  ] || [  $COIN == "ZEC"  ] || [  $COIN == "ZEN"  ] || [  $COIN == "ZCL"  ] || [  $COIN == "HUSH"  ] || [  $COIN == "KMD"  ] && [  $ZM_or_EWBF == "EWBF"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 | grep -E 'GPU0|Total' | grep -v Temp |grep -v INFO |  tail -n $TAIL_GPU_COUNT  |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

elif  [  $COIN == "SIB"  ] || [  $COIN == "LBC"  ] || [  $COIN == "MONA"  ] || [  $COIN == "SIA"  ] || [  $COIN == "ZPOOL_LYRA2V2"  ] || [  $COIN == "ZPOOL_LBRY"  ]  || [  $COIN == "ZPOOL_BLAKE2S"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 |  grep -e "S/A/T" | tail -n $TAIL_GPU_COUNT |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

elif [ $COIN == "FTC"  ] || [ $COIN == "ORB"  ] || [ $COIN == "PXC"  ] || [ $COIN == "KRB"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 |  grep -e "accepted" | tail -n $TAIL_GPU_COUNT |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

elif [ $COIN == "ETH"  ] || [  $COIN == "ETC"  ] || [  $COIN == "EXP"  ] || [  $COIN == "UBQ"  ] || [  $COIN == "MUSIC"  ] || [  $COIN == "SOIL"  ]  && [  $ETHMINER_or_GENOIL_or_CLAYMORE == "ETHMINER"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 |  grep -e "ethminer" | tail -n $TAIL_GPU_COUNT |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

elif [ $COIN == "ETH"  ] || [  $COIN == "ETC"  ] || [  $COIN == "EXP"  ] || [  $COIN == "UBQ"  ] || [  $COIN == "MUSIC"  ] || [  $COIN == "SOIL"  ] || [  $COIN == "DUAL_*"  ] && [  $ETHMINER_or_GENOIL_or_CLAYMORE == "CLAYMORE"  ]
then
MINER_LOG=$(tail -n 150 /home/m1/nvoc_logs/screenlog.0 |  grep -Ev 'DevFee|New job|SHARE FOUND|Share accepted' | tail -n $TAIL_GPU_COUNT |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' | awk '{print $0,"
"}')

else
MINER_LOG=$(tail -n $TAIL_GPU_COUNT /home/m1/nvoc_logs/screenlog.0 |  sed -r 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' |  awk '{print $0,"
"}')
fi

telegram papampi :

Code:


GPU_UTILIZATIONS=$(tail -n 5 /home/m1/nvoc_logs/5_restartlog | grep 'GPU UTILIZATION' | awk '{gsub(/GPU UTILIZATION:  /,"")}1' | tail -n 1)
TEMP_FAN_POWER=$(tail  -n 30 /home/m1/nvoc_logs/6_autotemplog  | grep GPU | awk '{gsub(/:/,": ")}1' |tail -n $GPU_COUNT )


Done.
Either restart your rig or restart miner with :
Code:
pkill -e screen
pkill -f 3main

Way to go dude. Everyone should change their contributions to include this. Use it as template.

BTW, the last paragraph, if you not gonna restart the rig I think you will need to kill watchdog as well.
full member
Activity: 200
Merit: 101
November 16, 2017, 07:32:54 AM
I don't use (and never did) wdog at all but I think is a must for everyone using it to make sure that the gpu % util is ok.
That's the point to watch that the pool is up and running.
I've elaborated this other example of how to get the data to make that check. I think is quite "universal" and should work with any miner, so if some of you want to test it that would be good info for developers.

Code:
#! /bin/bash

# Find out miner's name
P_NAME=$(ps aux | grep -v grep| grep SCREEN | grep miner | sed 's/ /\n/g' | grep /home/m1 | rev | cut -d"/" -f1 | rev)
# Find out miner's process number (PID)
P_NUMBER=$(pgrep $P_NAME)
# Find out pool ip and port
IP_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f1)
PORT_POOL=$(sudo lsof -e /run/user/1000/gvfs -Pan -p "$P_NUMBER" -i | grep "$P_NAME" | sed 's/->/ /' | rev | cut -d" " -f2 | rev | cut -d":" -f2)

echo "Miner's name : " $P_NAME
echo "Miner PID    : " $P_NUMBER
echo "Pool's IP    : " $IP_POOL
echo "pool's port  : " $PORT_POOL

Hope that Stubo's idea and this one help devs to consolidate wdog.

That is a neat idea. The code worked until I determining the IP of the pool and port. Those were set to huge strings full of IPs and ports:

Code:
m1@Testy:~$ echo "Miner's name : " $P_NAME
Miner's name :  zm
m1@Testy:~$ echo "Miner PID    : " $P_NUMBER
Miner PID    :  2191
m1@Testy:~$ echo "Pool's IP    : " $IP_POOL
Pool's IP    :  192.168.1.178 192.168.1.5 45.79.223.173 94.23.12.63 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5 192.168.1.5

m1@Testy:~$ echo "pool's port  : " $PORT_POOL
pool's port  :  42000 54332 20570 3443 64395 64396 64546 64571 64589 64608 64627 64644 64660 64677 64694 64711 64718 64734 64748 64767 64782 64795 64820 64833 64849 64860 64869 64884 64899 64918 64935 64945 64977 64988 65008 65027 65044 65064 65086 65107 65127 65145 65168 65186 65203 65219 65235 65249 65263 65277


I still don't think that checking for connectivity to a mining pool is a good idea because of all of the pitfalls in doing so as well as the odds of a good pool being down. That being said, I spent a little bit of time to develop my idea a little bit fuller. The following in totally untested in the sense that I have not put it into the watchdog and tried it out on my test rig. I have tested the logic however:

# This statement needs to be near the top of the watchdog script
Code:
NUM_MINER_CONS=0


# These statements need to be done continually [because of profit switching]
#  where we know that the miner is connected and mining, toward the end of wdog
Code:
# Store active miner connection info into MINER_CONS array
FILTER=$(ss -tn state listening | gawk 'NR > 1 {n=split($3,A,":"); B[NR-1]=A[n]} END {for (i=1; iMINER_CONS=( $(ss -tn state established dst :* | grep -P -v "$FILTER" | grep -v Port |tr -s ' '|cut -d ' ' -f 4) )
NUM_MINER_CONS=${#MINER_CONS[@]}
if [ $NUM_MINER_CONS -eq 0 ]
then
   echo "$(date) - Cannot detect active miner connections" | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
fi

# This is the check that should be done if the miner is down or the GPU utilization is low
Code:
# Make sure we can connect to the mining pools iff 1 or more known miner connections
if [ $NUM_MINER_CONS -gt 0 ]
then
   CAN_HIT_POOL=0
   while [ CAN_HIT_POOL -eq 0 ]
   do
      CAN_HIT_POOL = 1
      for CON in "${MINER_CONS[@]}"
      do
         POOL_IP=$(echo $CON| cut -d':' -f 1)
         POOL_PORT=$(echo $CON| cut -d':' -f 2)
         if ! nc -vzw1 $POOL_IP $POOL_PORT;
         then
            CAN_HIT_POOL=0
            echo "$(date) - Cannot connect to mining pool $POOL_IP, port $POOL_PORT, checking again in 30 seconds..." | tee -a ${LOG_FILE} ${ALERT_LOG_FILE}
         fi
      done
      if [ CAN_HIT_POOL -eq 0 ]
      then
         sleep 30
      fi  
   done
fi

Part of the difficulty here is that some miners will have multiple connections. One such is DSTM's zm. Also, folks can be using "plusCPU". Here is what the ss code I use spits out on my test rig with that case:
Code:
m1@Testy:~$ ss -tn state established dst :* | grep -P -v "$FILTER" | grep -v Port |tr -s ' '|cut -d ' ' -f 4
172.104.94.15:20580
45.79.223.173:20570
188.165.195.21:3443
so we need to handle the IPs and ports as an array and make sure we can get to all of them, right? Anyway, my sample code does that but I still have no plans to use it. I like the simple check for basic internet connectivity better.

Thanks.


Guys, you are overthinking and overcomplicating this pool/port detection.

Isn't the simplest solution to ps/grep/awk miner process and extract the  pool_address/port from the actual command that miner is running? Don't all miners use pool_addr/port as an argument?

I'm sorry I can't pitch in with an actual code and I am just throwing ideas here... I've been extremely busy and don't have spare time to write/test any code now. Many thanks to all members that are thinkering/coding to make nvOC even better than it is!
Jump to: