SIMPLE CGMINER REMOTE MONITORING SCRIPT NOW WITH ALERTSI made this script so I can check status for my rigs from anywhere not just my local computer.
I know there is ANUBIS but it is too heavy for me. I just needed a simple status script.
You will need:
- Webserver / webhosting with PHP (with socket support enabled)
- Crontab access for Alerts
- Postfix or Sendmail for sending Email Alerts
- Miners using Cgminer
1. CONFIGURING CGMINEREnable API support with adding this to the cgminer.conf:
"api-port" : "4001",
"api-listen" : true,
"api-allow" : "YOUR_WEBSERVER_IP",
or cgminer command line:
--api-port 4001 --api-listen --api-allow "YOUR_WEBSERVER_IP"
Change YOUR_WEBSERVER_IP to your webserver REMOTE IP.
With --api-allow only webserver remote IP has the read only access to the cgminer API. This has to be set for security reasons.
Each rig needs its own api-port! Ports numbers can be ANYTHING you want as long the are not already taken. For example you can set port 4001 for Rig #1, 4002 for Rig #2, 4003 for Rig #3, etc.2. OPEN PORTS ON ROUTER / FIREWALLIf you have a router or a firewall you will need to open ports you have chosen for your rigs. In my example you will need to open ports 4001, 4002, 4003.
To do this you will have to know your rigs local IPs and set the port forwarding on router to these IPs.
You get the rig's local IP number with:
on windows open command prompt and run:
ipconfig
Look at "IPv4 Address" of your network adapter.
on linux run command:
ifconfig
Look at "inet addr:" of your network adapter.
3. SETUP MONITORING PHP SCRIPTSDownload files from here:
https://github.com/Paxxil/cgminer_remote_monitoringOpen functions.inc.php in your text editor.
Follow the instructions inside and add your miner rigs settings there.
After you made the changes, FTP to your webserver, navigate to your public www directory, create subdirectory "monitoring" and upload the files to it.
If you set everything right you should get the monitoring stats when you navigate to
http://your_webserver_ip/monitoring/ (or if you have a domain
http://wwww.your_domain.com/monitoring/)
4. CONFIGURING ALERTSOpen functions.php.inc in your text editor.
Edit the settings (email, alert configs) in the # SETUP ALERTS # Section.
Next you will have to make the file
email.lock writable by the script.
In linux you do it with command:
chmod 666 email.lock
Now open crontab editor:
crontab -e
And put ABSULUTE path to the monitoring_cron.php script
*/2 * * * * php /path/to/your/monitoring_cron.php >/dev/null 2>&1
This will execute monitoring_cron.php every 2 minutes.
If you want to check the server less frequently change */2 * * * * part.
Some examples:
* * * * * => every minute
*/5 * * * * => every 5 minutes
0 * * * * => every hour
0 0 * * * => once a day at midnight server time
Save the file and shut down one cgminer to test the script. If you receive the email then everything works.
If you can not get it to work just PM me and I will help you.
If you like it please support it with donating:
LTC : LdQ1UHiRy24Tvmm8NHbhAdHL3Qf3JqrUbG
BTC : 1EA8UrpifP9hi7LZHjJphCJQ6Hh45mb5pP
Good Luck!
--p4xil
EDIT
2014-01-02 : v2.1.1 Fixed some bugs
2013-12-29 : v2.1 Added ASC and PGA support
2013-06-13 : Fixed some bugs
2013-06-04 : v2.0 Added Email Alerts