Bitcoin Forum
November 01, 2024, 07:44:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 »  All
  Print  
Author Topic: cgmon - mining monitor for Linux - auto restart, reboot, sick gpu, ASIC, &more  (Read 48334 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
bomberb17
Hero Member
*****
Offline Offline

Activity: 773
Merit: 528



View Profile
February 15, 2014, 10:17:16 AM
 #181

I'm not getting any mail. Also if I debug, I get the message
Code:
invalid bareword "exited"
in expression "exited - 11";
should be "$exited" or "{exited}" or "exited(...)" or ...
    (parsing expression "exited - 11")
    invoked from within
"expr  $current_accepted($n) -  $previous_accepted($n)"
    (procedure "check_status" line 190)
    invoked from within
"check_status"
    (file "./cgmon.tcl" line 579)
rorbit
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
February 15, 2014, 03:09:55 PM
 #182

Hi,

if I add the following to the end of the cgminer command in cgmon-mine.sh shouldn't it capture the output?

2>> ~/log/_cgminer_log.txt

I want to be able to track whenever a pool failover happens.

This creates the log file but nothing is written to it.


cgmon-mine.sh is created whenever cgmon starts cgminer.  So you actually make that change within cgmon.tcl.  Try adding it to the end of your $cgminer_gpu_options line in cgmon.tcl

Actually the issue is with screen...  When I try logging to a file it only works when NOT using screen...  

You can log cgminer ouput by adding -L to the screen options in cgmon.tcl.

Code:
set screen_cmd "screen -mdL"

Will leave a screenlog.0 file in the current working directory.  Let me know if you find another way to do it.



Thanks jdape.

This works.

You can also copy /etc/screenrc file to your working directory and rename it .screenrc to modify screen variables.

E.g. add the following line to customise your log filename to cgminer_log_2014_02_15.txt:

logfile "/home/user/log/cgminer_log_20%y_%m_%d.txt"
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 15, 2014, 04:47:07 PM
 #183

In the file change "Ubuntu: apt-get install libtcl tcl-tls" to "Ubuntu: apt-get install tcllib tcl-tls"

Fixed, thanks!

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 15, 2014, 04:55:30 PM
 #184

I'm not getting any mail. Also if I debug, I get the message
Code:
invalid bareword "exited"
in expression "exited - 11";
should be "$exited" or "{exited}" or "exited(...)" or ...
    (parsing expression "exited - 11")
    invoked from within
"expr  $current_accepted($n) -  $previous_accepted($n)"
    (procedure "check_status" line 190)
    invoked from within
"check_status"
    (file "./cgmon.tcl" line 579)

Run this command and send me the output please.
Code:
php -f /tmp/cgmon-api.php devs | grep "Accepted] =>" | grep -v Diff

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
technocoma
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
February 15, 2014, 05:25:02 PM
 #185

Just what I've been looking for. Thanks for this
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 15, 2014, 07:36:38 PM
 #186

Just what I've been looking for. Thanks for this

Cool.  Let me know if you find any bugs Smiley

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
ckopobapka
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 15, 2014, 11:29:57 PM
 #187

I've made a simple startup init-script for BAMT that runs cgmon in virtual screen without using cron. I think it's more convenient way to debug and control cgmon.

1. copy cgmon_wrapper.sh from http://yadi.sk/d/34zlbFhWHx4ua to any directory you want. I keep it in "/opt/cgmon/"

2. copy cgmon_daemon from http://yadi.sk/d/aKU8Zr6nHx4ug to "/etc/init.d/" directory on your BAMT.
Configure it according to your system:
a) At the end of the 4th line:
Code:
# Required-Start:    $remote_fs $syslog mine
... I've added word "mine", because cgmon_daemon needs to be runned only after "/etc/init.d/mine" script. You may add your own here...

b) In the 22th line:
Code:
DAEMON_ARGS="-DmS cgmon_daemon /opt/cgmon/cgmon_wrapper.sh"
... if you saved cgmon_wrapper.sh in other dirctory, you need to fix the line according to your cgmon_wrapper.sh path.

3. Make the scripts executable:
Code:
sudo chmod 755 /etc/init.d/cgmon_daemon
sudo chmod 755 /opt/cgmon/cgmon_wrapper.sh #write here your own cgmon_wrapper.sh path if it differs

4. Enable autostart:
Code:
sudo update-rc.d cgmon_daemon defaults
sudo update-rc.d cgmon_daemon enable

5. You may start it by hands:
Code:
sudo /etc/init.d/cgmon_daemon start
Also, you restart and stop it.

6. To view a virtual screen use:
Code:
sudo screen -r cgmon_daemon
To exit from the screen use "Ctrl+a d"
miner777
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
February 16, 2014, 01:11:24 AM
Last edit: February 16, 2014, 02:32:44 AM by miner777
 #188

ckopobapka, thank you so much for posting that.  I am having cron problems so maybe this will be my answer. I hope some other people can chime in as to if this is a good solution to use.

I only got a little confused at this part:

"... I've added word "mine", because cgmon_daemon needs to be runned only after "/etc/init.d/mine" script. You may add your own here..."

Can I just leave that part alone and put it in as it is?


I MUST get this program working. I woke up to a sick gpu this morning, what a bummer.


funkycold
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
February 16, 2014, 04:09:17 AM
 #189

Hi Jdape....Im enjoying the newer versions of cgmon so far (01b16)!

a quick bug report:

1) The rebooting of the rig if hasrate or pool is not communicating is a great thing. Only i did experiment it and i found that if the internet connection is not back after the reboot it will keep trying to reboot sgminer instead of rebooting the rig. Wouldn't it be better to reboot the rig, in case it has an issue?

Thanks for the report!

Maybe.  If one reboot didn't fix it, is another going to?  We probably don't want a rig to keep rebooting over and over.

3) Is it possible to add a scrypt (optional to user) to reboot the rig once in a while. Im not sure about this, but is it possible that we are stuck on old shares? Ive noticed i am more productive when i reboot the rig once in a while. Maybe rebooting the rig 3-4 times a day isn't a bad idea, considering Ubuntu takes less than a minute to reboot.

Thx again!

You can use a shell script like this:
Code:
#!/bin/sh
/sbin/shutdown -r now

Pop that in a file, chmod +x it, then add it to /etc/crontab to reboot every so many hours.

How safe is it to shutdown or reboot a rig while sgminer is running?
When i add a line in the BASH file to stop sgminer cgmon tries to re-open it (since I am running it every 2 minutes). Is there a way to halt the cronjob until the next reboot?
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 16, 2014, 04:40:49 AM
 #190

Completely safe.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
Angela8488
Full Member
***
Offline Offline

Activity: 127
Merit: 100


View Profile
February 16, 2014, 04:57:40 PM
 #191

First thank you for the great job done
if use option like this
Quote
set conf(cgminer_gpu_options) "--keccak -c /root/.cgminer/cgminer.conf.1"
the pool in # Primary mining pool will appear in cgminer as the last pool
if use option like this
Quote
set conf(cgminer_gpu_options) ""
the pool in # Primary mining pool will be the first pool
can you change it to alway first
i think maybe it's because cgmon.tcl run script like this
Quote
/root/cgminer_keccak/bin/cgminer --api-listen  --keccak -c /root/.cgminer/cgminer.conf.max -o pool_url -u xxx -p x
so can you change it to
Quote
/root/cgminer_keccak/bin/cgminer --api-listen  --keccak  -o pool_url -u xxx -p x -c /root/.cgminer/cgminer.conf.max
ckopobapka
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
February 16, 2014, 08:55:22 PM
 #192

I only got a little confused at this part:
"... I've added word "mine", because cgmon_daemon needs to be runned only after "/etc/init.d/mine" script. You may add your own here..."
Can I just leave that part alone and put it in as it is?
If you are sure, that your miner autostarts by script "/etc/init.d/mine" (this is default behavior in BAMT), you can put it in as it is (with word mine).
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 16, 2014, 09:01:37 PM
 #193

First thank you for the great job done
if use option like this
Quote
set conf(cgminer_gpu_options) "--keccak -c /root/.cgminer/cgminer.conf.1"
the pool in # Primary mining pool will appear in cgminer as the last pool
if use option like this
Quote
set conf(cgminer_gpu_options) ""
the pool in # Primary mining pool will be the first pool
can you change it to alway first
i think maybe it's because cgmon.tcl run script like this
Quote
/root/cgminer_keccak/bin/cgminer --api-listen  --keccak -c /root/.cgminer/cgminer.conf.max -o pool_url -u xxx -p x
so can you change it to
Quote
/root/cgminer_keccak/bin/cgminer --api-listen  --keccak  -o pool_url -u xxx -p x -c /root/.cgminer/cgminer.conf.max

Done.  This is now the default behavior in cgmon 1.0.5.

If you have 1.0.3 or 1.0.4 now, run
Code:
 ./cgmon.tcl update
to upgrade to 1.0.5.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 16, 2014, 09:04:35 PM
 #194

So, I guess that means I better officially release 1.0.5...


# 1.0.4
#   notify_on_manual_runs was not being obeyed.
#   Added quiet flag (-q) to wget when version checking.
# 1.0.5
#   Now adds mining pools before gpu options when setting up the mining command (request by Angela8488).

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 16, 2014, 09:13:28 PM
 #195

There was a tiny bug in the 1.0.x versions that was preventing emails (and possibly reboots) when SMTP auth was NOT being used.  So if you have 1.0.x please update to 1.0.6.

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
MrBobC
Member
**
Offline Offline

Activity: 110
Merit: 10


View Profile
February 17, 2014, 12:01:44 AM
 #196

jdape,

   Wondering if you can change the sbin/shutdown -r now command to reboot -f for all of them, or set an option for bamt so that it just uses reboot -f only?  The autoupdate is awesome but I manually change the sbin/shutdowns to reboot -f -n on all of them, otherwise it would be as easy as running the update and moving the file.  Thanks!
jdape (OP)
Sr. Member
****
Offline Offline

Activity: 269
Merit: 250


View Profile WWW
February 17, 2014, 02:10:12 AM
 #197

jdape,

   Wondering if you can change the sbin/shutdown -r now command to reboot -f for all of them, or set an option for bamt so that it just uses reboot -f only?  The autoupdate is awesome but I manually change the sbin/shutdowns to reboot -f -n on all of them, otherwise it would be as easy as running the update and moving the file.  Thanks!

Currently cgmon attempts a 'shutdown -r now'.  If that fails, it will try 'reboot -f'.  Does the default reboot behavior still not work correctly on BAMT?

Fork Networking - VPS, Colocation, Dedicated Servers for Bitcoin & Litecoin. Since 1994! www.forked.net
MrBobC
Member
**
Offline Offline

Activity: 110
Merit: 10


View Profile
February 17, 2014, 03:11:40 AM
 #198

I was trying to save the time of the delay is all.  Could you maybe make it an option that if BAMT = "yes" then call a different BAMT_reboot procedure that only has "reboot -f" or even "reboot -f -n"?  Sometimes reboot -f doesn't work and I have to use reboot -f -n.
miner777
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
February 17, 2014, 03:16:33 AM
 #199

I only got a little confused at this part:
"... I've added word "mine", because cgmon_daemon needs to be runned only after "/etc/init.d/mine" script. You may add your own here..."
Can I just leave that part alone and put it in as it is?
If you are sure, that your miner autostarts by script "/etc/init.d/mine" (this is default behavior in BAMT), you can put it in as it is (with word mine).
ckopobapka, I sincerely appreciate this. Thank you.  Smiley    I am going install it tomorrow.
miner777
Newbie
*
Offline Offline

Activity: 26
Merit: 0


View Profile
February 17, 2014, 04:05:18 AM
 #200

ckopobapka, I decided to go for it and install it tonight. And it works!!!!  This is so awesome. Thank you!  You have made my day.  Smiley
Pages: « 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 »  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!