smith-datadog 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/smith-datadog +13 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb6d899872605eb78cb00b4db90f407b011265d9
|
4
|
+
data.tar.gz: f22cd20dc359acbfd49ff989342cff4a8a62eef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc24b238da10d01ba58adf25b8fcca0db74e5bcfb7e416992d3982cfa26293e3565549ca6d2e966221e8fe9d060f5efa638d0c62dd31f973859f519241f36f2
|
7
|
+
data.tar.gz: 2da88fdaca3b06d2e334133ec8d5af1435179f2059a0966c129873d1d96c1ef5b35a4aa952754d77293179c5c54bd4cd4caecd441a2b3064dfdc338880a4d58c
|
data/bin/smith-datadog
CHANGED
@@ -33,7 +33,13 @@ class Smith::Datadog
|
|
33
33
|
Smith.stop
|
34
34
|
end
|
35
35
|
|
36
|
-
|
36
|
+
if options[:interval] > 0
|
37
|
+
EM.add_periodic_timer(options[:interval]) { run_check(queue) }
|
38
|
+
else
|
39
|
+
run_check(queue)
|
40
|
+
Smith.stop
|
41
|
+
exit(0)
|
42
|
+
end
|
37
43
|
end
|
38
44
|
end
|
39
45
|
|
@@ -76,6 +82,10 @@ class Smith::Datadog
|
|
76
82
|
alert(agent_name, :running, "Agent running")
|
77
83
|
else
|
78
84
|
alert(agent_name, :critical, "Agent not running")
|
85
|
+
if options[:exit_on_fail]
|
86
|
+
Smith.stop
|
87
|
+
exit(1)
|
88
|
+
end
|
79
89
|
end
|
80
90
|
end
|
81
91
|
rescue RuntimeError => e
|
@@ -120,7 +130,7 @@ class Smith::Datadog
|
|
120
130
|
@options ||= begin
|
121
131
|
OptionParser.accept(Pathname) {|p,| Pathname.new(p) if p}
|
122
132
|
|
123
|
-
defaults = {:interval => 30, :timeout => 11, :agents => [], :group => [], :tags => [], :host => 'localhost', :port => 5555, :agency_timeout => 60}
|
133
|
+
defaults = {:interval => 30, :timeout => 11, :agents => [], :group => [], :tags => [], :host => 'localhost', :port => 5555, :agency_timeout => 60, :exit_on_fail => false}
|
124
134
|
defaults.tap do |options|
|
125
135
|
parser = OptionParser.new do |opts|
|
126
136
|
opts.separator "\n"
|
@@ -134,6 +144,7 @@ class Smith::Datadog
|
|
134
144
|
opts.on("--host <s>", String, "Riemann host (default #{options[:host]})") { |v| options[:host] = v }
|
135
145
|
opts.on("--port <i>", Integer, "Riemann port (default #{options[:port]})") { |v| options[:port] = v }
|
136
146
|
opts.on("--tags <tag1,tag1,...>", Array, "Tags to add to the alert") { |t| options[:tags] = t }
|
147
|
+
opts.on("--[no-]exit-on-fail", "Exit on fail") { |t| options[:exit_on_fail] = t }
|
137
148
|
|
138
149
|
opts.on("--agents <agent1,agent2,...>", Array, "Agents to monitor") { |v| options[:agents] + v }
|
139
150
|
opts.on("--agent-group <group name>>", Array, "The name of an 'agent group' to monitor") { |g| options[:group] += g }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smith-datadog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Heycock
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: smith
|
@@ -151,7 +151,7 @@ extensions: []
|
|
151
151
|
extra_rdoc_files: []
|
152
152
|
files:
|
153
153
|
- bin/smith-datadog
|
154
|
-
homepage: https://github.com/
|
154
|
+
homepage: https://github.com/digivizer/smith-datadog
|
155
155
|
licenses:
|
156
156
|
- GPL-3.0
|
157
157
|
metadata: {}
|
@@ -179,4 +179,3 @@ signing_key:
|
|
179
179
|
specification_version: 4
|
180
180
|
summary: Monitor smith agents, reporting to Datadog
|
181
181
|
test_files: []
|
182
|
-
has_rdoc:
|