Bitcoin Forum
December 03, 2016, 06:58:50 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: Cacti template for CGMINER monitoring  (Read 8823 times)
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 13, 2012, 04:22:51 AM
 #1

Hi folks,

I have had this on my todo list for months, but finally got a few cycles to get started. These templates provide graphs for the stats available from cgminer >=2.1.0 (>=2.3.2 for PGA support) JSON API to compliment my earlier work on pool and AMD GPU Cacti templates.


Sample graphs from my 6990-based GPU miner:

Summary Totals

Total Average Hash Rate (from MHS av)


Total Hash Rate (computed from Total MH)


Total Utility


Total Work


Total Efficiency (computed from Accepted and Getworks)


Total Errors


Devs

5s Average Hash Rate


Average Hash Rate


Fan Percent


Fan Speed


GPU Activity


GPU Clock


GPU Voltage


Hash Rate


Memory Clock


Temperature


Utility


Work


Pools

Work (primary pool)


Work (secondary pool)


Errors (primary pool)


Errors (secondary pool)


Efficiency (primary pool)


Efficiency (secondary pool) Looks like I may have more work to do here




Release History
  • v0.01 4/15/2012
    First working version. Supports cgminer >=2.1.0 API JSON format (>=2.3.2 for PGA support). Supports stats from summary, pools and devs responses. Only tested with GPU support as no PGA or CPU miners were available at the time of release (caveat emptor).

Prerequisites

  • Installed and operational instance of Cacti (Spine and cmd.php pollers both work fine)
  • Perl 5.8.5 or later
  • HTTP::Request Perl module
  • LWP Perl module
  • JSON Perl module
  • JSON::XS Perl module

Install procedure
  • Grab latest script/templates package from here.
  • Unzip the archive
  • Move cgminer_devs_stats.xml and cgminer_pools_stats.xml into your script_queries directory (i.e. cacti/resource/script_queries/)
  • Move query_cgminer_stats.pl into your scripts directory (i.e. cacti/scripts/)
  • Ensure query_cgminer_stats.pl runs (perl query_cgminer_stats.pl generates the help text). If this doesn't work (you see an error about something missing) see the troubleshooting section for resolving Perl issues.
  • Ensure query_cgminer_stats.pl can connect to your CGMINER host, and has read access to the API (perl query_cgminer_stats.pl HOSTNAME summary). If this doesn't work, check your CGMINER options for API access to ensure the requesting host has the appropriate (read-only or read-write) rights.
  • Import the cacti_host_template_cgminer_host.xml host template from the Cacti web GUI.
  • Create a new host in Cacti, selecting the CGMINER Host host template. Set the hostname to your CGMINER hostname or IP. Be sure to disable Downed Host Detection and SNMP unless you have SNMP operational on your host.

Trouble Shooting

Perl issues
  • The most common Perl issue is missing modules. Have a look at this link for assistance in setting up CPAN and testing for missing modules.
  • If you have a Redhat-based distro (RHEL, CentOS, etc), and would prefer to use the RPMs instead of mucking about with CPAN, the perl-libwww-perl RPM (from upstream provider) contains HTTP::Request and other LWP modules. perl-JSON, perl-JSON-XS and perl-Cache-Memcached RPMs are available on RPM Forge and/or EPEL
  • These modules are also available in PPM form for ActiveState's ActivePerl on Windows, but as I don't run Windows I can't verify the details.

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
1480748330
Hero Member
*
Offline Offline

Posts: 1480748330

View Profile Personal Message (Offline)

Ignore
1480748330
Reply with quote  #2

1480748330
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480748330
Hero Member
*
Offline Offline

Posts: 1480748330

View Profile Personal Message (Offline)

Ignore
1480748330
Reply with quote  #2

1480748330
Report to moderator
The LT
Full Member
***
Offline Offline

Activity: 188



View Profile WWW
April 13, 2012, 11:20:41 AM
 #2

This is absolutely awesome, keep it up and let us know when we can test it out!
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 15, 2012, 07:46:46 PM
 #3

I made significant progress on the devs API support over the past 24 hours and expect to post some additional sample graphs after I have a full 24 hours of data collected.

I don't have access to a cgminer supported PGA, or have CPU mining enabled on my rigs so there might be a few bugs in those areas. If anyone has either of these, would you mind posting the API output from the devs API call, e.g. php api-example.php devs it would help out immensely.

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 16, 2012, 09:03:43 PM
 #4

Initial version posted. Graphs for pool stats are forthcoming.

  • v0.01 4/15/2012
    First working version. Supports cgminer >=2.1.0 API JSON format (>=2.3.2 for PGA support). Supports stats from summary, pools and devs responses. Only tested with GPU support as no PGA or CPU miners were available at the time of release (caveat emptor).


Have at it and let me know if anything looks amiss.

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742



View Profile WWW
April 16, 2012, 09:28:54 PM
 #5

Very cool.  I was looking at doing something similar until I started using BAMT.

The LT
Full Member
***
Offline Offline

Activity: 188



View Profile WWW
April 16, 2012, 11:18:16 PM
 #6

Will do some preliminary testing as soon as I have the time! Grand thanks to the author!
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 17, 2012, 04:42:33 PM
 #7

Very cool.  I was looking at doing something similar until I started using BAMT.

BAMT is pretty cool and has it's place. This is more for folks who run mining farms and want aggregate their monitoring, who prefer to run other OS/platform combinations than are supported by BAMT or want to extend/enhance their monitoring capabilities beyond what is possible in BAMT alone. Since Cacti and CGMINER are both multi-platform you can easily support mixed environments of Linux and Windows.


Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 17, 2012, 04:47:29 PM
 #8

I just added some sample pool graphs from two of the mining pools my rigs use.

The Efficiency numbers are calculated from (Accepted/Getworks) * 100 and don't appear to be working properly for anything other than the active pool. More research is needed here....

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
vapourminer
Legendary
*
Offline Offline

Activity: 890

what is this "brake pedal" you speak of?


View Profile
April 19, 2012, 10:38:43 AM
 #9

this looks great!

soon as I have some free time (next week I hope) Ill give it a go.
dlasher
Sr. Member
****
Offline Offline

Activity: 468



View Profile WWW
April 26, 2012, 03:41:51 PM
 #10


just wanted to say.. well done...

downloaded, followed the directions, and it just -- worked --

Thanks, for this, and the other scripts of yours I'm running. /clap

JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
April 26, 2012, 11:25:53 PM
 #11


just wanted to say.. well done...

downloaded, followed the directions, and it just -- worked --

Thanks, for this, and the other scripts of yours I'm running. /clap



Glad to hear it! Let me know if you see anything weird.

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
evilscoop
Full Member
***
Offline Offline

Activity: 196



View Profile WWW
June 12, 2013, 11:46:10 AM
 #12

Just wanted to add this works v. nicely on an rPi running fpga rigs too...

Nice work Wink


[edit]
Just tested this it works for bfgminer too Wink

Tip jars - BTC=1FTSk4t5hSbno4QpuaGknPyCNgLjCT9tQC | YAC=Y9mAhx1iycn5YL63u6yPGF1yLeDWse9qDr | LTC=LWvfnvm6bx7anM38QoWyvg4eFAqCRixsbg
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
June 12, 2013, 03:19:54 PM
 #13

Just wanted to add this works v. nicely on an rPi running fpga rigs too...

Nice work Wink


[edit]
Just tested this it works for bfgminer too Wink

Good to know. Thanks for the update!

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
evilscoop
Full Member
***
Offline Offline

Activity: 196



View Profile WWW
June 12, 2013, 04:05:36 PM
 #14

Actually just spotted a tiny prob with bfgminer...

Quote
perl /var/www/cacti/scripts/query_cgminer_stats.pl 127.0.0.1 devs get MHS_5s PGA1, output: 400.77840077.8

I figure this is related to :-
 print shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);

Might be an idea to add a check for second . and drop anything after it...
Think that way it should work for both miners

Ive done a temp hack (im no coder, just a sys admin) and added :-
Quote
elsif (($ARGV[3] eq "Utility") || ($ARGV[3] eq "MHS_5s") || ($ARGV[3] eq "MHS_av") || ($ARGV[3] eq "Temperature")) {
              #print shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);
               my $thingy = shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);
               print substr $thingy, 0, 4;
            }

This has fixed the graphing for now, but its dirty.....

Tip jars - BTC=1FTSk4t5hSbno4QpuaGknPyCNgLjCT9tQC | YAC=Y9mAhx1iycn5YL63u6yPGF1yLeDWse9qDr | LTC=LWvfnvm6bx7anM38QoWyvg4eFAqCRixsbg
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
June 12, 2013, 06:00:00 PM
 #15

Actually just spotted a tiny prob with bfgminer...

Quote
perl /var/www/cacti/scripts/query_cgminer_stats.pl 127.0.0.1 devs get MHS_5s PGA1, output: 400.77840077.8

I figure this is related to :-
 print shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);

Might be an idea to add a check for second . and drop anything after it...
Think that way it should work for both miners

Ive done a temp hack (im no coder, just a sys admin) and added :-
Quote
elsif (($ARGV[3] eq "Utility") || ($ARGV[3] eq "MHS_5s") || ($ARGV[3] eq "MHS_av") || ($ARGV[3] eq "Temperature")) {
              #print shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);
               my $thingy = shiftdec($json_text->{uc($command)}->[$pga{$ARGV[4]}]->{add_spaces($ARGV[3])}, 2);
               print substr $thingy, 0, 4;
            }

This has fixed the graphing for now, but its dirty.....

Hmm, that's not good. Can you send me an excerpt of the original JSON from the cgminer/bfgminer API for MHS_5s on PGA1? I need to see if it has something to do with how the number is being parsed by my script or is something inherent in cgminer/bfgminer. Also, it would be good to know if the issue only manifests in bfgminer and not cgminer.


Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
shawtux
Jr. Member
*
Offline Offline

Activity: 57


View Profile
June 12, 2013, 11:39:06 PM
 #16

how can i help?
also doing it with bfgminer. Av. Hash Rate is double to the real one. minning with FPGA. Should be aprox 800 MH/s but reads 1400 MH/s

contributions -> 1KHWkHWKKd2yrZQVvGh4Z3X4D9VoDeYMyM
JinTu
Full Member
***
Offline Offline

Activity: 132


Hopping down the bunny trail


View Profile
June 12, 2013, 11:42:27 PM
 #17

how can i help?
also doing it with bfgminer. Av. Hash Rate is double to the real one. minning with FPGA. Should be aprox 800 MH/s but reads 1400 MH/s

As with the previous issue, I need the JSON output to see if it is in fact a parsing issue with the script, or something in bfgminer.

Please donate if this was helpful: 14CLqCNphUJ54ro2PtqQWJDmW3Eic1WmUd
Cacti templates for pool, GPU and CGMINER monitoring.
GPU monitoring with SNMP
shawtux
Jr. Member
*
Offline Offline

Activity: 57


View Profile
June 13, 2013, 01:19:45 AM
 #18

how do i do this? bfgminer-rpc call? or in cacti?


edit:

remove the .. on the Code label.
Code:
~/bfgminer $ bfgminer-rpc
Reply was 'STATUS=S,When=1371086607,Code=11,Msg=Summary,Description=bfgminer 3.0.99|SUMMARY,Elapsed=73273,MHS av=1433.28,Found Blocks=0,Getworks=1598,Accepted=13654,Rejected=40,Hardware Errors=39,Utility=11.18,Discarded=3184,Stale=27,Get Failures=1,Local Work=80381,Remote Failures=0,Network Blocks=182,Total MH=105021094.3176,Work Utility=11.27,Difficulty Accepted=13654.20834668,Difficulty Rejected=40.00061036,Difficulty Stale=27.00041199,Best Share=8641|'
[STATUS] =>
(
   [STATUS] => S
   [When] => 1371086607
   [..Code] => 11
   [Msg] => Summary
   [Description] => bfgminer 3.0.99
)
[SUMMARY] =>
(
   [0] => SUMMARY
   [Elapsed] => 73273
   [MHS av] => 1433.28
   [Found Blocks] => 0
   [Getworks] => 1598
   [Accepted] => 13654
   [Rejected] => 40
   [Hardware Errors] => 39
   [Utility] => 11.18
   [Discarded] => 3184
   [Stale] => 27
   [Get Failures] => 1
   [Local Work] => 80381
   [Remote Failures] => 0
   [Network Blocks] => 182
   [Total MH] => 105021094.3176
   [Work Utility] => 11.27
   [Difficulty Accepted] => 13654.20834668
   [Difficulty Rejected] => 40.00061036
   [Difficulty Stale] => 27.00041199
   [Best Share] => 8641
)

contributions -> 1KHWkHWKKd2yrZQVvGh4Z3X4D9VoDeYMyM
evilscoop
Full Member
***
Offline Offline

Activity: 196



View Profile WWW
June 13, 2013, 07:30:23 AM
 #19

Quote
root@raspberrypi:~/cm1/cgminer# php api-example.php devs pga0
devs returned 'STATUS=S,When=1371108071,Code=9,Msg=0 GPU(s) - 2 PGA(s),Description=bfgminer 3.0.99|PGA=0,Name=ICA,ID=0,ProcID=0,Enabled=Y,Status=Alive,MHS av=397.310,MHS 5s=473.026,Accepted=8,Rejected=0,Hardware Errors=0,Utility=2.081,Last Share Pool=0,Last Share Time=1371108049,Total MH=91629.2762,Diff1 Work=8,Difficulty Accepted=8.00012207,Difficulty Rejected=0.00000000,Last Share Difficulty=1.00001526,Last Valid Work=1371108049|PGA=1,Name=ICA,ID=1,ProcID=0,Enabled=Y,Status=Alive,MHS av=398.541,MHS 5s=472.715,Accepted=8,Rejected=0,Hardware Errors=0,Utility=2.081,Last Share Pool=0,Last Share Time=1371108055,Total MH=91913.1709,Diff1 Work=8,Difficulty Accepted=8.00012207,Difficulty Rejected=0.00000000,Last Share Difficulty=1.00001526,Last Valid Work=1371108055|'


cgminer api php against bfgminer running

raw json is beyond my understanding....if you can give me a quick script ill run it.

I do feel this is a minor issue, and should be fixable without having to make another template, as bfgminer and cgminer are v.v.v. similar...tbh, truncating the replay to 3 decimals should fix this, we dont need that much precision on fpga Cheesy

no ive not seen this on cgminer....yet


Quote
Av. Hash Rate is double to the real one. minning with FPGA. Should be aprox 800 MH/s but reads 1400 MH/s

Now thats interesting, what fpga are you using....

I can spike to 1.5G/s due to bfgminer doing its auto overclocking spread and going to 220mhz.....cgminer does not have this ability...
Probably why fpga users tend to prefer bfgminer Wink
I know ztex can regularly push this on over clock....im only using cm1's

Tip jars - BTC=1FTSk4t5hSbno4QpuaGknPyCNgLjCT9tQC | YAC=Y9mAhx1iycn5YL63u6yPGF1yLeDWse9qDr | LTC=LWvfnvm6bx7anM38QoWyvg4eFAqCRixsbg
shawtux
Jr. Member
*
Offline Offline

Activity: 57


View Profile
June 13, 2013, 12:00:50 PM
 #20

Im also using 1 cm1

contributions -> 1KHWkHWKKd2yrZQVvGh4Z3X4D9VoDeYMyM
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!