ring-sqa 0.0.21 → 0.0.22

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: 6768fa2c6c13c430f0f704ded317746fccce1aa9
4
- data.tar.gz: f136b1e93986fc855081a347fd5ef8647b75ff6c
3
+ metadata.gz: 607e1ee6bfecfef783993cd833b5939e23274d04
4
+ data.tar.gz: 44e5b32a2e81e1159b7bd36d76a6e90b91d64f0a
5
5
  SHA512:
6
- metadata.gz: 41b8e6ad533c6be0771fb467ddae3cc23c431e5a91c3fd03a2cd3cb0ecd7205a1e09b3f0488103468593623dffc05c0aee2ada8f5047bd162b584b68f8f31987
7
- data.tar.gz: aacca386783c1df76ca9226a243e701ef6bc7af86d5f6730d6dd925296ac98ee41f1806bc0e3200f3fa9865a13c41d14e031ca78b30e1e30a6e33173393e0ef8
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 4 threads
5
+ Currently 5 threads
6
6
 
7
7
  1. main thread, launches everything and finally gives control to Analyze class
8
- 2. querier thread, sends queries and waits for responses, populates database
9
- 3. responder thread, waits for queries and echoes them back
10
- 4. inotify monitor thread
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
- 1. Querier loop should sleep dynamically between nodes to spread CPU/network demand
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?
@@ -9,7 +9,7 @@ class SQA
9
9
  Config.default.irc.host = '213.136.8.179'
10
10
  Config.default.irc.port = 5502
11
11
  Config.default.irc.password = 'shough2oChoo'
12
- Config.default.irc.channel = '#ring'
12
+ Config.default.irc.target = '#ring'
13
13
 
14
14
  begin
15
15
  Config.load
@@ -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 #{nodes_list.size} nodes previously were reachable, but became unreachable
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, channel=CFG.irc.channel
6
+ def send message, targets=CFG.irc.target
7
7
  url = Paste.add message[:long]
8
- msg = [@password, channel, message[:short], url].join ' '
9
- msg += "\0" while msg.size % 16 > 0
10
- UDPSocket.new.send msg, 0, @host, @port.to_i
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
@@ -65,7 +65,7 @@ class SQA
65
65
  time -= 1
66
66
  end
67
67
 
68
- msg[:long] = message nodes_list, mtr_list, buffer_list
68
+ msg[:long] = message nodes_list, mtr_list, buffer_list, exceeding_nodes.size
69
69
  msg
70
70
  end
71
71
 
data/lib/ring/sqa/log.rb CHANGED
@@ -7,7 +7,7 @@ class SQA
7
7
  else
8
8
  begin
9
9
  require 'syslog/logger'
10
- Log = Syslog::Logger.new 'ring-sqad'
10
+ Log = Syslog::Logger.new 'ring-sqad%i' % ( CFG.afi == "ipv6" ? 6 : 4 )
11
11
  rescue LoadError
12
12
  require 'logger'
13
13
  Log = Logger.new STDERR
data/ring-sqa.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ring-sqa'
3
- s.version = '0.0.21'
3
+ s.version = '0.0.22'
4
4
  s.licenses = %w( Apache-2.0 )
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = [ 'Saku Ytti', 'Job Snijders' ]
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.21
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-27 00:00:00.000000000 Z
12
+ date: 2014-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: slop