Pages:
Author

Topic: Antminer S1 monitor via snmp/syslog (Read 5262 times)

newbie
Activity: 2
Merit: 0
December 01, 2014, 02:27:40 PM
#29
how can i do this without downloading snmp? i mean i already got talking to the server, do i have to send it commands? can it just send updates to the syslog?

Well the commands given above will return you info on your miner when run at the command prompt.

The SNMP stuff is just one way of running those commands remotely.  You could easily use a command like
    ssh miner /usr/bin/cgminer-api stats
And get the info that way.

Good thing about SNMP is it already offers permissions and networking framework.  I poll from Cacti which likes SNMP.
newbie
Activity: 12
Merit: 0
December 01, 2014, 09:27:51 AM
#28
is there any way to monitor a Antminer S1 via snmp/syslog.
im trying to get the temperature from the Unit.

Yes - I've just done this.

1) log into GUI and go to System --> Software --> [ Update lists ]   then wait a bit
2) Under Status, click the /Available Packages\ tab then click the /S\ tab
3) Scroll down to snmpd and click install.  You can ignore the snmpd-static and snmpd-utils packages.

4) SSH to your miner and log in as root
5) vi  /etc/snmp/snmpd.conf  and set it like this

rocommunity Waizphzbp3
exec minerstatus1 /bin/sh /root/cgminer-api-summary


6) vi /root/cgminer-api-summary    and set the contents like this

/usr/bin/cgminer-api stats      | egrep "temp|fan" | grep -v "Reply was"  | tr -d " []><()" | tr "=" ":"
/usr/bin/cgminer-api coin       | egrep "Time|Difficulty" | grep -v "Reply was"  | tr -d " []><()" | tr "=" ":"


7) Back to the web gui, go to System --> Startup  and "enable snmpd"   then click the start button for snmpd.

Cool FAIL  This is the bit I haven't done yet.  My miner is not publicly accessible, so I simply disabled its firewall.
If you have an uncontrolled environment, you want to permit port 161 UDP from the monitoring host only.

9) To scan it I did this on my remote host.

snmpwalk -Os -c Waizphzbp3 -v 2c 192.168.1.93   .1.3.6.1.4.1.2021.8

which returns this output:

extIndex.1 = INTEGER: 1
extNames.1 = STRING: minerstatus1
extCommand.1 = STRING: /bin/sh /root/cgminer-api-summary
extResult.1 = INTEGER: 0
extOutput.1 = STRING: fan_num:1
fan1:2820
fan2:0
fan3:0
fan4:0
temp_num:2
temp1:41
temp2:44
temp3:0
temp4:0
temp_avg:42
temp_max:45
temp_hi:44
overheat_temp:0
opt_bitmain_temp:50
opt_bitmain_fan_min:32
opt_bitmain_fan_max:160
PoolAttempts:0
CurrentBlockTime:1405304337.011621
NetworkDifficulty:17336316978.50783100
extErrFix.1 = INTEGER: noError(0)
extErrFixCmd.1 = STRING:


So my S1 is at 41 and 44 degrees C, with the front fan doing 2820 RPM .  My rear fan is only 3 wire and doesn't report speeds.


To customise, simply edit the shell script in /root/cgminer-api-summary to suit your needs.
There are a heap of different options that  cgminer-api takes, the shell script simply formats them.
Some of the ones I've looks at:

/usr/bin/cgminer-api devs                      Info on attached asics
/usr/bin/cgminer-api pools                     Info on pools
/usr/bin/cgminer-api switchpool                Change to another configured pool
/usr/bin/cgminer-api notify                    unsure
/usr/bin/cgminer-api devdetails                device info, more details
/usr/bin/cgminer-api stats
/usr/bin/cgminer-api summary
/usr/bin/cgminer-api config         failover info
/usr/bin/cgminer-api coin           stats about current block and difficulty
/usr/bin/cgminer-api usbstats               Lots of stuff
/usr/bin/cgminer-api zero           reset counters ?
/usr/bin/cgminer-api hotplug                ?
/usr/bin/cgminer-api ascset         configure asics on the fly
/usr/bin/cgminer-api asccount               count attached asics
/usr/bin/cgminer-api lockstats              dunno - not compiled
/usr/bin/cgminer-api edevs          devs but for devices that are enabled only
/usr/bin/cgminer-api estats         stats but for enabled devices only.
/usr/bin/cgminer-api lcd                    One liner?  Not compiled in


Any questions please ask, and if you have fiddled your firewall please let us know the clean tidy way to do that.



how can i do this without downloading snmp? i mean i already got talking to the server, do i have to send it commands? can it just send updates to the syslog?
newbie
Activity: 12
Merit: 0
December 01, 2014, 08:55:03 AM
#27
it's logging to 514 syslog .. i'm gonna have to wait for it to crash again to see if it says anything other than /usr/bin/cgminer-monitor..

anybody know what i'm saying?
newbie
Activity: 12
Merit: 0
December 01, 2014, 07:08:46 AM
#26
nevermind, adding api-listen worked.. thanks for all the great help..
newbie
Activity: 12
Merit: 0
December 01, 2014, 06:07:31 AM
#25
Mine doesn't work I guess.  I just filled in the IP under GUI SYSTEM/SYSTEM/LOGGING. My log server never shows anything. Is there something else besides this you have to do?
member
Activity: 70
Merit: 10
newbie
Activity: 2
Merit: 0
July 13, 2014, 09:52:08 PM
#23
is there any way to monitor a Antminer S1 via snmp/syslog.
im trying to get the temperature from the Unit.

Yes - I've just done this.

1) log into GUI and go to System --> Software --> [ Update lists ]   then wait a bit
2) Under Status, click the /Available Packages\ tab then click the /S\ tab
3) Scroll down to snmpd and click install.  You can ignore the snmpd-static and snmpd-utils packages.

4) SSH to your miner and log in as root
5) vi  /etc/snmp/snmpd.conf  and set it like this

rocommunity Waizphzbp3
exec minerstatus1 /bin/sh /root/cgminer-api-summary


6) vi /root/cgminer-api-summary    and set the contents like this

/usr/bin/cgminer-api stats      | egrep "temp|fan" | grep -v "Reply was"  | tr -d " []><()" | tr "=" ":"
/usr/bin/cgminer-api coin       | egrep "Time|Difficulty" | grep -v "Reply was"  | tr -d " []><()" | tr "=" ":"


7) Back to the web gui, go to System --> Startup  and "enable snmpd"   then click the start button for snmpd.

8) FAIL  This is the bit I haven't done yet.  My miner is not publicly accessible, so I simply disabled its firewall.
If you have an uncontrolled environment, you want to permit port 161 UDP from the monitoring host only.

9) To scan it I did this on my remote host.

snmpwalk -Os -c Waizphzbp3 -v 2c 192.168.1.93   .1.3.6.1.4.1.2021.8

which returns this output:

extIndex.1 = INTEGER: 1
extNames.1 = STRING: minerstatus1
extCommand.1 = STRING: /bin/sh /root/cgminer-api-summary
extResult.1 = INTEGER: 0
extOutput.1 = STRING: fan_num:1
fan1:2820
fan2:0
fan3:0
fan4:0
temp_num:2
temp1:41
temp2:44
temp3:0
temp4:0
temp_avg:42
temp_max:45
temp_hi:44
overheat_temp:0
opt_bitmain_temp:50
opt_bitmain_fan_min:32
opt_bitmain_fan_max:160
PoolAttempts:0
CurrentBlockTime:1405304337.011621
NetworkDifficulty:17336316978.50783100
extErrFix.1 = INTEGER: noError(0)
extErrFixCmd.1 = STRING:


So my S1 is at 41 and 44 degrees C, with the front fan doing 2820 RPM .  My rear fan is only 3 wire and doesn't report speeds.


To customise, simply edit the shell script in /root/cgminer-api-summary to suit your needs.
There are a heap of different options that  cgminer-api takes, the shell script simply formats them.
Some of the ones I've looks at:

/usr/bin/cgminer-api devs                      Info on attached asics
/usr/bin/cgminer-api pools                     Info on pools
/usr/bin/cgminer-api switchpool                Change to another configured pool
/usr/bin/cgminer-api notify                    unsure
/usr/bin/cgminer-api devdetails                device info, more details
/usr/bin/cgminer-api stats
/usr/bin/cgminer-api summary
/usr/bin/cgminer-api config         failover info
/usr/bin/cgminer-api coin           stats about current block and difficulty
/usr/bin/cgminer-api usbstats               Lots of stuff
/usr/bin/cgminer-api zero           reset counters ?
/usr/bin/cgminer-api hotplug                ?
/usr/bin/cgminer-api ascset         configure asics on the fly
/usr/bin/cgminer-api asccount               count attached asics
/usr/bin/cgminer-api lockstats              dunno - not compiled
/usr/bin/cgminer-api edevs          devs but for devices that are enabled only
/usr/bin/cgminer-api estats         stats but for enabled devices only.
/usr/bin/cgminer-api lcd                    One liner?  Not compiled in


Any questions please ask, and if you have fiddled your firewall please let us know the clean tidy way to do that.

sr. member
Activity: 434
Merit: 250
April 14, 2014, 12:18:11 AM
#22
Hi, API are active on Antminer S1, infact if you connect to console ad run the command cgminer-api summary there is an answer like this



but is not allowed to call API from another computer else localhost (127.0.0.1) because in the configuration there aren't all necessary permission. So you need to enable the API for remote access. Someone suggest to edit /etc/config/cgminer. I do not know what solution is correct, but I think it is to edit /etc/init.d/cgminer because the etc/config/cgminer is written directly by Luci interface.

W_M

I think the 'correct' way would be to edit the /etc/config/cgminer config file - you'll see that /etc/config/init.d actually pulls values from it as well. Doesn't really matter I suppose as long as the values are properly passed onto cgminer upon launch.
sr. member
Activity: 434
Merit: 250
April 14, 2014, 12:11:48 AM
#21
....... WHAT......?  Huh  enabling API may caused dead chips? Where you find this?

W_M

Complete bullshit until proven otherwise.

https://bitcointalksearch.org/topic/--412322

Not an unreasonable claim. I've gotten dead chips from simply rebooting. I've had to unplug the antminer and plug it back in to resolve them.

I disagree, and still call bullshit. Unless there is some other underlying issue (software corruption?) simply enabling the API shouldn't cause "dead chips".
member
Activity: 103
Merit: 10
April 13, 2014, 08:18:11 AM
#20
Hi, API are active on Antminer S1, infact if you connect to console ad run the command cgminer-api summary there is an answer like this

Code:
root@antMiner:~# cgminer-api summary
Reply was 'STATUS=S,When=1397386095,Code=11,Msg=Summary,Description=cgminer 3.12.0|SUMMARY,Elapsed=13063,GHS 5s=175.97,GHS av=178.78,Found Blocks=156,Getworks=797,Accepted=1422,Rejected=13,Hardware Errors=5,Utility=6.53,Discarded=1523,Stale=0,Get Failures=0,Local Work=805471,Remote Failures=0,Network Blocks=503,Total MH=2335392761.6234,Work Utility=2497.56,Difficulty Accepted=520544.00000000,Difficulty Rejected=5584.00000000,Difficulty Stale=0.00000000,Best Share=1976710,Device Hardware%=0.0009,Device Rejected%=1.0269,Pool Rejected%=1.0613,Pool Stale%=0.0000,Last getwork=1397386094|'
[STATUS] =>
(
   [STATUS] => S
   [When] => 1397386095
   [Code] => 11
   [Msg] => Summary
   [Description] => cgminer 3.12.0
)
[SUMMARY] =>
(
   [0] => SUMMARY
   [Elapsed] => 13063
   [GHS 5s] => 175.97
   [GHS av] => 178.78
   [Found Blocks] => 156
   [Getworks] => 797
   [Accepted] => 1422
   [Rejected] => 13
   [Hardware Errors] => 5
   [Utility] => 6.53
   [Discarded] => 1523
   [Stale] => 0
   [Get Failures] => 0
   [Local Work] => 805471
   [Remote Failures] => 0
   [Network Blocks] => 503
   [Total MH] => 2335392761.6234
   [Work Utility] => 2497.56
   [Difficulty Accepted] => 520544.00000000
   [Difficulty Rejected] => 5584.00000000
   [Difficulty Stale] => 0.00000000
   [Best Share] => 1976710
   [Device Hardware%] => 0.0009
   [Device Rejected%] => 1.0269
   [Pool Rejected%] => 1.0613
   [Pool Stale%] => 0.0000
   [Last getwork] => 1397386094

but is not allowed to call API from another computer else localhost (127.0.0.1) because in the configuration there aren't all necessary permission. So you need to enable the API for remote access. Someone suggest to edit /etc/config/cgminer. I do not know what solution is correct, but I think it is to edit /etc/init.d/cgminer because the etc/config/cgminer is written directly by Luci interface.

W_M[/code]

Go to S1 config  - /etc/config/cgminer
Set:
        option api-listen
        option api_allow 'W:127.0.0.1,10.0.0.XX' 

 (10.0.0.XX) is IP of the computer where you want to monitor S1.
member
Activity: 103
Merit: 10
April 13, 2014, 08:13:39 AM
#19
Use CGRemote - http://manotechnology.blogspot.cz/p/cgremote.html - it gives you all you need for mining.
Great SW for monitoring.
legendary
Activity: 1018
Merit: 1001
April 13, 2014, 06:06:19 AM
#18
Hi, API are active on Antminer S1, infact if you connect to console ad run the command cgminer-api summary there is an answer like this

Code:
root@antMiner:~# cgminer-api summary
Reply was 'STATUS=S,When=1397386095,Code=11,Msg=Summary,Description=cgminer 3.12.0|SUMMARY,Elapsed=13063,GHS 5s=175.97,GHS av=178.78,Found Blocks=156,Getworks=797,Accepted=1422,Rejected=13,Hardware Errors=5,Utility=6.53,Discarded=1523,Stale=0,Get Failures=0,Local Work=805471,Remote Failures=0,Network Blocks=503,Total MH=2335392761.6234,Work Utility=2497.56,Difficulty Accepted=520544.00000000,Difficulty Rejected=5584.00000000,Difficulty Stale=0.00000000,Best Share=1976710,Device Hardware%=0.0009,Device Rejected%=1.0269,Pool Rejected%=1.0613,Pool Stale%=0.0000,Last getwork=1397386094|'
[STATUS] =>
(
   [STATUS] => S
   [When] => 1397386095
   [Code] => 11
   [Msg] => Summary
   [Description] => cgminer 3.12.0
)
[SUMMARY] =>
(
   [0] => SUMMARY
   [Elapsed] => 13063
   [GHS 5s] => 175.97
   [GHS av] => 178.78
   [Found Blocks] => 156
   [Getworks] => 797
   [Accepted] => 1422
   [Rejected] => 13
   [Hardware Errors] => 5
   [Utility] => 6.53
   [Discarded] => 1523
   [Stale] => 0
   [Get Failures] => 0
   [Local Work] => 805471
   [Remote Failures] => 0
   [Network Blocks] => 503
   [Total MH] => 2335392761.6234
   [Work Utility] => 2497.56
   [Difficulty Accepted] => 520544.00000000
   [Difficulty Rejected] => 5584.00000000
   [Difficulty Stale] => 0.00000000
   [Best Share] => 1976710
   [Device Hardware%] => 0.0009
   [Device Rejected%] => 1.0269
   [Pool Rejected%] => 1.0613
   [Pool Stale%] => 0.0000
   [Last getwork] => 1397386094

but is not allowed to call API from another computer else localhost (127.0.0.1) because in the configuration there aren't all necessary permission. So you need to enable the API for remote access. Someone suggest to edit /etc/config/cgminer. I do not know what solution is correct, but I think it is to edit /etc/init.d/cgminer because the etc/config/cgminer is written directly by Luci interface.

W_M[/code]
member
Activity: 106
Merit: 10
🤖UBEX.COM 🤖
April 12, 2014, 09:06:35 PM
#17
....... WHAT......?  Huh  enabling API may caused dead chips? Where you find this?

W_M

Complete bullshit until proven otherwise.

https://bitcointalksearch.org/topic/--412322

Not an unreasonable claim. I've gotten dead chips from simply rebooting. I've had to unplug the antminer and plug it back in to resolve them.
sr. member
Activity: 434
Merit: 250
April 11, 2014, 01:18:54 AM
#16
....... WHAT......?  Huh  enabling API may caused dead chips? Where you find this?

W_M

Complete bullshit until proven otherwise.
legendary
Activity: 1018
Merit: 1001
April 11, 2014, 01:15:08 AM
#15
....... WHAT......?  Huh  enabling API may caused dead chips? Where you find this?

W_M
member
Activity: 106
Merit: 10
🤖UBEX.COM 🤖
April 11, 2014, 12:16:51 AM
#14
I wrote this in java with Selenium. Only 11 lines. I can add a temp check so if it exceeds a certain temp, it will automatically ssh in and kill cgminer, sleep for a set amount of time to cooldown(I think once cgminer is killed the webpage won't have the temp so I can't monitor if it cooled down), soft link in an asic-freq with the min frequency, then reboot. I'll have to add JSCH so it can ssh in. I can slap a gui on it and add the ability to monitor multiple antminers. The cgminer API is clunky and requires cgminer config file modification which a lot of owners probably won't feel comfortable to mess with. Plus, after reading that enabling the api may have caused dead chips, I don't want to touch it.

newbie
Activity: 15
Merit: 0
April 10, 2014, 02:36:18 PM
#13
thx fot that, but i cant get it to run ...
cgminer doesnt start
sr. member
Activity: 434
Merit: 250
April 10, 2014, 02:05:00 PM
#12
ok cgremote doing a good job but there is no notification system for temperature reaches critical level.
and really big problem is --> if temperature goes critical the ant should shutdown

nobody else have this problems?
nobody afraid of burning down your serverroom or house?


Very much so, and I fought with the S1's thermal management (or lack thereof) for quite a while. Then Kano released custom cgminer binaries for the S1 that actually allow for a user specified temp threshold after which the miner goes into a cooldown mode (with a lower hashrate).

You can find them here: https://github.com/kanoi/cgminer-binaries/tree/master/AntS1
newbie
Activity: 15
Merit: 0
April 09, 2014, 01:46:11 PM
#11
ok cgremote doing a good job but there is no notification system for temperature reaches critical level.
and really big problem is --> if temperature goes critical the ant should shutdown

nobody else have this problems?
nobody afraid of burning down your serverroom or house?
member
Activity: 108
Merit: 10
April 09, 2014, 03:41:33 AM
#10
Quote
You're aware there's a web UI? Temp data can be seen in the 'miner status' tab.

But i dont want to open 7 Webinterfaces for checking temperature.
And i want to get notification if the temperature reaches a critical level.
you can use this service http://cgminermonitor.com/
and use this command in linux
socat TCP4-LISTEN:4028,fork TCP4:192.168.1.99:4028
because cgminermonitor can only access to cgminer that running in the same machine
Pages:
Jump to: