ring-sqa 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/ring/sqa/alarm/cfg.rb +1 -1
- data/lib/ring/sqa/alarm/email.rb +2 -3
- data/lib/ring/sqa/alarm/message.rb +2 -2
- data/lib/ring/sqa/alarm/udp2irc.rb +8 -4
- data/lib/ring/sqa/alarm.rb +1 -1
- data/lib/ring/sqa/log.rb +1 -1
- data/ring-sqa.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 607e1ee6bfecfef783993cd833b5939e23274d04
|
4
|
+
data.tar.gz: 44e5b32a2e81e1159b7bd36d76a6e90b91d64f0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b43afbdb5daa721b17f9de29bbae979a336af2e6ee8b0c54e6571b3e8254473078eab1ebb12735c7bf45d71644ca7a903f4feaef945e68e3fe5181b8e1edd6d
|
7
|
+
data.tar.gz: be0b92fcf4880131ebaff0f6c41a694651afcc0f7ed07fb168535d2b77867731d15480527a1d1e52b69cd793f1eb6030f62727e54bf2693d277f0ebca11b95a4
|
data/README.md
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
Discovers NLNOG Ring nodes by monitoring /etc/hosts with inotify. UDP pings
|
3
3
|
each node periodically recording latency as microseconds in SQL database
|
4
4
|
|
5
|
-
Currently
|
5
|
+
Currently 5 threads
|
6
6
|
|
7
7
|
1. main thread, launches everything and finally gives control to Analyze class
|
8
|
-
2.
|
9
|
-
3.
|
10
|
-
4.
|
8
|
+
2. sender thread, sends queries and populates DB with new negative response row
|
9
|
+
3. receiver thread, receives replies and updates DB with positive response
|
10
|
+
4. responder thread, receives queries and sends replies
|
11
|
+
5. inotify monitor thread
|
11
12
|
|
12
13
|
## Use
|
13
|
-
ring-sqad --help
|
14
|
-
ring-sqad --daemonize
|
14
|
+
- ring-sqad --help
|
15
|
+
- ring-sqad --daemonize
|
15
16
|
|
16
17
|
## Todo
|
17
|
-
|
18
|
-
2. Analyzer class should actually do something (use average of numbers before median as norm, if last Y measurements are Z times above norm (or more than X standard deviations?) raise alarm?
|
18
|
+
- Get rid of Sequel+SQLite share Hash or Array instead?
|
data/lib/ring/sqa/alarm/cfg.rb
CHANGED
data/lib/ring/sqa/alarm/email.rb
CHANGED
@@ -14,13 +14,12 @@ class Alarm
|
|
14
14
|
@subject = prefix + msg[:short]
|
15
15
|
@body = msg[:long]
|
16
16
|
send_email compose_email
|
17
|
+
rescue => error
|
18
|
+
Log.error "Email raised '#{error.class}' with message '#{error.message}'"
|
17
19
|
end
|
18
20
|
|
19
21
|
private
|
20
22
|
|
21
|
-
def initialize
|
22
|
-
end
|
23
|
-
|
24
23
|
def compose_email
|
25
24
|
mail = []
|
26
25
|
mail << 'From: ' + @from
|
@@ -2,7 +2,7 @@ module Ring
|
|
2
2
|
class SQA
|
3
3
|
|
4
4
|
class Alarm
|
5
|
-
def message nodes_list, mtr_list, buffer_list
|
5
|
+
def message nodes_list, mtr_list, buffer_list, amount
|
6
6
|
"
|
7
7
|
Regarding: #{Ring::SQA::CFG.host.name} #{Ring::SQA::CFG.afi}
|
8
8
|
|
@@ -14,7 +14,7 @@ as indicating that there is a high probability your NLNOG RING node
|
|
14
14
|
cannot reach the entire internet. Possible causes could be an outage
|
15
15
|
in your upstream's or peer's network.
|
16
16
|
|
17
|
-
The following #{
|
17
|
+
The following #{amount} nodes previously were reachable, but became unreachable
|
18
18
|
over the course of the last 3 minutes:
|
19
19
|
|
20
20
|
#{nodes_list}
|
@@ -3,11 +3,15 @@ class SQA
|
|
3
3
|
class Alarm
|
4
4
|
|
5
5
|
class UDP2IRC
|
6
|
-
def send message,
|
6
|
+
def send message, targets=CFG.irc.target
|
7
7
|
url = Paste.add message[:long]
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
[targets].flatten.each do |target|
|
9
|
+
msg = [@password, target, message[:short], url].join ' '
|
10
|
+
msg += "\0" while msg.size % 16 > 0
|
11
|
+
UDPSocket.new.send msg, 0, @host, @port.to_i
|
12
|
+
end
|
13
|
+
rescue => error
|
14
|
+
Log.error "UDP2IRC raised '#{error.class}' with message '#{error.message}'"
|
11
15
|
end
|
12
16
|
|
13
17
|
private
|
data/lib/ring/sqa/alarm.rb
CHANGED
data/lib/ring/sqa/log.rb
CHANGED
data/ring-sqa.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ring-sqa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Saku Ytti
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slop
|