Pages:
Author

Topic: cgmon - mining monitor for Linux - auto restart, reboot, sick gpu, ASIC, &more - page 7. (Read 48345 times)

legendary
Activity: 2702
Merit: 1468
Hey jdape - thanks for this. Being a dev myself I started wanting to tinker with it right away. But, I don't know TCL. Smiley

Long story short I ended up re-implementing cgmon in JavaScript with node.js. I think it's pretty close now: node-cgmon.

Not sure if you know JavaScript but if you ever want to consolidate efforts, let me know.

FYI, I cited cgmon in the credits.


Cool.  Node.js is gaining momentum on the server side.  Good to see an effort to use it.

I could not convince bfgminer developer to provide JSONP interface straight from the API.  If we had JSONP straight from the API, it would solve cross-domain issues,
and you could write ONE web page to get the status(es) directly from the miner(s).  Parsing, formatting becomes trivial in JS.

For process monitoring, you still need to have cgmon like script to monitor the process itself.
member
Activity: 110
Merit: 10
sr. member
Activity: 269
Merit: 250
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.

Done.  In the latest version you'll see
Code:
#set conf(BAMT) "no"
at the bottom of the config options.
Uncomment and set to yes to use 'reboot -f -n' before trying other reboot options.
newbie
Activity: 10
Merit: 0
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
Enjoy it! =)
newbie
Activity: 51
Merit: 0
This really is a great script! but 1 condition made me mad!

Cgmon will do nothing when it can't get data from cgminer-api, always cgminer is dead when it is starting, in this condition, cgmon will not take any action.

So could you add the feather that cgmon check the process of cgminer when it can't get the data from cgminer-api, maybe it needs some sleep time, then if there is the cgminer process and no api data, reboot the system.

Thank you!
newbie
Activity: 26
Merit: 0
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
newbie
Activity: 26
Merit: 0
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.
member
Activity: 110
Merit: 10
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.
sr. member
Activity: 269
Merit: 250
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?
member
Activity: 110
Merit: 10
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!
sr. member
Activity: 269
Merit: 250
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.
sr. member
Activity: 269
Merit: 250
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).
sr. member
Activity: 269
Merit: 250
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.
newbie
Activity: 10
Merit: 0
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).
full member
Activity: 127
Merit: 100
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
sr. member
Activity: 269
Merit: 250
newbie
Activity: 9
Merit: 0
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?
newbie
Activity: 26
Merit: 0
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.


newbie
Activity: 10
Merit: 0
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"
sr. member
Activity: 269
Merit: 250
Just what I've been looking for. Thanks for this

Cool.  Let me know if you find any bugs Smiley
Pages:
Jump to: