nat-monitor 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nat-monitor/version.rb +1 -1
- data/lib/nat-monitor.rb +14 -4
- 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: 3156a9f0165d09cf8050ef54b9352baeeca72d22
|
4
|
+
data.tar.gz: 272af6f6dbe54bd2a43887739bed69f2691c2377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f360c42a8d2a5b8da3d7369e3c80fd70e0c1093454df3f3c17c8632b268dcdd87dd627d7edf1e3c37cd287a4e62dbcb9c209103e1f64ae9d79ee5afcd3cfdc5c
|
7
|
+
data.tar.gz: d5117be480a56863eb6c1ce29cdbd6df739d47c64969e7509cf2f507ccefc5ac0d938dec221ff28cc2cc4ad25d35735542bab491b369d76e4bf6049de14ccf23
|
data/lib/nat-monitor/version.rb
CHANGED
data/lib/nat-monitor.rb
CHANGED
@@ -4,6 +4,7 @@ module EtTools
|
|
4
4
|
require 'net/ping'
|
5
5
|
require 'fog'
|
6
6
|
require 'yaml'
|
7
|
+
require 'syslog'
|
7
8
|
|
8
9
|
def initialize(conf_file = nil)
|
9
10
|
@conf = defaults.merge load_conf(conf_file)
|
@@ -33,10 +34,6 @@ module EtTools
|
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
|
-
def output(message)
|
37
|
-
puts message
|
38
|
-
end
|
39
|
-
|
40
37
|
def defaults
|
41
38
|
{ 'pings' => 3,
|
42
39
|
'ping_timeout' => 1,
|
@@ -141,5 +138,18 @@ module EtTools
|
|
141
138
|
def master_node?(node_id)
|
142
139
|
current_master == node_id
|
143
140
|
end
|
141
|
+
|
142
|
+
private
|
143
|
+
|
144
|
+
def output(message)
|
145
|
+
puts message
|
146
|
+
log message
|
147
|
+
end
|
148
|
+
|
149
|
+
def log(message, level = 'info')
|
150
|
+
Syslog.open($PROGRAM_NAME, Syslog::LOG_PID | Syslog::LOG_CONS) do |s|
|
151
|
+
s.send(level, message)
|
152
|
+
end
|
153
|
+
end
|
144
154
|
end
|
145
155
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nat-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Herot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|