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:
# 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:
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:
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:
sudo update-rc.d cgmon_daemon defaults
sudo update-rc.d cgmon_daemon enable
5. You may start it by hands:
sudo /etc/init.d/cgmon_daemon start
Also, you restart and stop it.
6. To view a virtual screen use:
sudo screen -r cgmon_daemon
To exit from the screen use "Ctrl+a d"