brigade-monitor 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07c9aa048c72a9e80ddd5405aeffe75e4345448a
4
- data.tar.gz: 731f2177559370b8b96674905d2f9c5818c14438
3
+ metadata.gz: 63bf9369fb1ac670c89f203b985ee92916caa329
4
+ data.tar.gz: 6cccc70e841da3fb75c0a9752d4a12436fc2abf3
5
5
  SHA512:
6
- metadata.gz: 4f7f25759cf86203ab1eb12b005c1312a8670ea395e4db0851911a8a670fa909d49b14b9aea3524fdb304a967407f14356140af861bdcb4ce74d399749c874a4
7
- data.tar.gz: e9b5f5a3c5c4061786de5ffd6c1ce543a9d1ee04333a3abaca12c218f262b65a2e598f2b53ebe506fe4ba5906555fb12d51ab91f2eebb6783e5b74949146b7a4
6
+ metadata.gz: 17c066862b1a38d9917203c0bf0bfc5389adc6469afbb78f1db9d53391ce99b5714a49d8a9ceb59475d23010d59f00ab258e760c237a4085c443bdb962d8518a
7
+ data.tar.gz: 6b63acd04c9b3db02e3d0ced206941f0f40687e4afb4201ac155dbd756dce417c7ac1c8d4a9e3ada916a8c91fe9aba3b6fdd89ef9119b72531577bb8cee6e0b2
data/bin/brigade-monitor CHANGED
@@ -15,7 +15,28 @@ log.level = Logger::WARN
15
15
  options = {}
16
16
  optparse = OptionParser.new do |opts|
17
17
  opts.banner = "Usage: #{me} [options]"
18
- opts.on('-c', '--config FILE', String, 'Configuration file') do |c|
18
+ opts.on('-s', '--sample [FILE]', String, 'Write a sample configuration file') do |file|
19
+ file ||= 'config.yaml'
20
+ File.open(file, 'w') do |f|
21
+ f.write <<EOF
22
+ # Set the api-key value to your API key from brigade.io
23
+ # or, specify via command line, if that's your thing.
24
+ api-key: REPLACE_WITH_API_KEY
25
+
26
+ # Add the miners you wish to monitor with this agent.
27
+ # port is optional, it defaults to the cgminer default of 4028.
28
+ miners:
29
+ 'Unnamed Miner 1':
30
+ host: miner1_hostname
31
+ 'Unnamed Miner 2':
32
+ host: miner2_hostname
33
+ port: 4029
34
+ EOF
35
+ end
36
+ puts "Sample configuration written to #{file}"
37
+ exit
38
+ end
39
+ opts.on('-c', '--config FILE', String, 'YAML configuration file') do |c|
19
40
  options[:config] = c
20
41
  end
21
42
  opts.on('-k', '--key API-KEY', String, 'Brigade API key') do |key|
@@ -44,7 +65,7 @@ fail 'Brigade API key is required' if key.nil?
44
65
 
45
66
  # build a hash-o-miner clients
46
67
  miners = config['miners'].map do |miner|
47
- client = CGMiner::API::Client.new(miner[1]['host'], miner[1]['port'])
68
+ client = CGMiner::API::Client.new(miner[1]['host'], miner[1]['port'] || 4028)
48
69
  { name: miner[0], client: client }
49
70
  end
50
71
 
@@ -1,5 +1,5 @@
1
1
  module Brigade
2
2
  module Monitor
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brigade-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Veys
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-11 00:00:00.000000000 Z
11
+ date: 2014-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -172,7 +172,6 @@ files:
172
172
  - lib/brigade/monitor/fetcher.rb
173
173
  - lib/brigade/monitor/monitor.rb
174
174
  - lib/brigade/monitor/version.rb
175
- - sample-config.yaml
176
175
  - spec/spec_helper.rb
177
176
  homepage: ''
178
177
  licenses:
data/sample-config.yaml DELETED
@@ -1,8 +0,0 @@
1
- api-key: ABCDEF0123456789
2
- miners:
3
- 'Colony #1':
4
- host: colony1
5
- port: 4028
6
- 'Colony #2':
7
- host: colony2
8
- port: 4028