arvicco-avalon 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -1
- data/lib/avalon/eloipool.rb +2 -2
- data/lib/avalon/miner.rb +2 -2
- data/lib/avalon/utils.rb +6 -7
- data/lib/avalon/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -39,9 +39,14 @@ Monitor script is periodically polling the mining units and other types of objec
|
|
39
39
|
------- ~/.avalon/monitor.yml --------
|
40
40
|
# Prod configuration (default)
|
41
41
|
prod:
|
42
|
-
:alert_sound: :aiff # :none for silent alerts
|
43
42
|
:alert_after: 2 # missed pings or status reports from a miner
|
44
43
|
:alert_temp: 52 # degrees C and above
|
44
|
+
:alert_sounds:
|
45
|
+
:failure: Glass.aiff # [] for no sound
|
46
|
+
:restart: Frog.aiff # [] for no sound
|
47
|
+
:temp_high: Ping.aiff # [] for no sound
|
48
|
+
:block_found: [Dog.aiff, Purr.aiff, Dog.aiff] # [] for no sound
|
49
|
+
:block_updated: [Purr.aiff, Purr.aiff, Purr.aiff] # [] for no alert sound
|
45
50
|
:bitcoind:
|
46
51
|
:ip: 192.168.1.13
|
47
52
|
:rpcuser: jbond
|
data/lib/avalon/eloipool.rb
CHANGED
@@ -27,10 +27,10 @@ module Avalon
|
|
27
27
|
alarm "Eloipool at #{@ip} not responding to ping"
|
28
28
|
elsif self[:found] > @blocks.size
|
29
29
|
add_new_blocks `ssh #{@ip} "cat solo/logs/pool.log | grep BLKHASH"`
|
30
|
-
alarm "Eloipool found #{@found} blocks",
|
30
|
+
alarm "Eloipool found #{@found} blocks", :block_found
|
31
31
|
elsif @blocks[@blocks.keys.last].pending?
|
32
32
|
update_block @blocks[@blocks.keys.last] do
|
33
|
-
alarm "Eloipool last block updated",
|
33
|
+
alarm "Eloipool last block updated", :block_updated
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
data/lib/avalon/miner.rb
CHANGED
@@ -96,9 +96,9 @@ module Avalon
|
|
96
96
|
if self[:mhs] < @min_speed and upminutes > 5
|
97
97
|
alarm "Miner #{num} performance is #{self[:mhs]}, should be #{@min_speed}"
|
98
98
|
elsif self[:temp] >= @alert_temp
|
99
|
-
alarm "Miner #{num} too hot at #{self[:temp]}C, needs cooling",
|
99
|
+
alarm "Miner #{num} too hot at #{self[:temp]}C, needs cooling", :temp_high
|
100
100
|
elsif upminutes < 2
|
101
|
-
alarm "Miner #{num} restarted",
|
101
|
+
alarm "Miner #{num} restarted", :restart
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
data/lib/avalon/utils.rb
CHANGED
@@ -10,8 +10,10 @@ module Avalon
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# Helper method: play a sound file
|
13
|
-
def play
|
14
|
-
|
13
|
+
def play what
|
14
|
+
tunes = [Avalon::Config[:alert_sounds][what] || what].compact.flatten
|
15
|
+
|
16
|
+
tunes.each do |tune|
|
15
17
|
file = find_file( tune, "../../../sound/#{tune}",
|
16
18
|
"~/.avalon/sound/#{tune}", "/System/Library/Sounds/#{tune}")
|
17
19
|
case system
|
@@ -25,12 +27,9 @@ module Avalon
|
|
25
27
|
end
|
26
28
|
|
27
29
|
# Helper method: sound alarm with message
|
28
|
-
def alarm message,
|
30
|
+
def alarm message, sound=:failure
|
29
31
|
puts message
|
30
|
-
|
31
|
-
tunes.push('Glass.aiff') if tunes.empty?
|
32
|
-
|
33
|
-
tunes.each {|tune| play tune }
|
32
|
+
play sound
|
34
33
|
end
|
35
34
|
|
36
35
|
# Helper method: ping the Node, return ping time in ms
|
data/lib/avalon/version.rb
CHANGED