servicemonitor 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/servicemonitor +12 -11
- data/lib/alert/email.rb +1 -1
- data/lib/monitor_manager.rb +5 -6
- data/lib/monitor_type.rb +1 -1
- data/lib/monitor_type/fluiddb.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 338a78861e00b178aa687aff2a6e83cf1d6825c4
|
4
|
+
data.tar.gz: 87a7362a0efc9a52245f69571173b3ebbf26f531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4532c3f8b364c265adfc52d3cb6a1d7daa9b23212df762f52b214bb446684b30d3d0fccabc04cddc12ae20f92584a54e4672bdbb8fa7fc00386a9c9739f5ca1
|
7
|
+
data.tar.gz: ec530dc907339abadc8565a5f8743c22a6f3cd785e550caacc67bf1b2796f101535096b28e9ebaab8ef0af57244316a16498370d6e89c34756dbd2af8d64dc6e
|
data/bin/servicemonitor
CHANGED
@@ -4,16 +4,16 @@
|
|
4
4
|
$:.unshift './'
|
5
5
|
|
6
6
|
require 'net/smtp'
|
7
|
-
require '
|
8
|
-
require '
|
9
|
-
require '
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
15
|
-
require '
|
16
|
-
require '
|
7
|
+
require 'alert'
|
8
|
+
require 'alert/email'
|
9
|
+
require 'monitor_type'
|
10
|
+
require 'monitor_type/threshold'
|
11
|
+
require 'monitor_type/beanstalk'
|
12
|
+
require 'monitor_type/dir'
|
13
|
+
require 'monitor_type/fluidDb'
|
14
|
+
require 'monitor_type/process'
|
15
|
+
require 'monitor_type/http_get_json_list'
|
16
|
+
require 'monitor_manager'
|
17
17
|
require 'helper_functions'
|
18
18
|
|
19
19
|
# Don't buffer stdout
|
@@ -38,8 +38,9 @@ rescue ArgumentError
|
|
38
38
|
"*** <command>, [:arg=>value]\n"
|
39
39
|
rescue SystemExit
|
40
40
|
# rescue SIGTERM=>e
|
41
|
-
rescue StandardError
|
41
|
+
rescue StandardError => e
|
42
42
|
puts 'What the ...'
|
43
43
|
puts e.class.name
|
44
44
|
puts e.message
|
45
|
+
puts e.backtrace
|
45
46
|
end
|
data/lib/alert/email.rb
CHANGED
data/lib/monitor_manager.rb
CHANGED
@@ -25,11 +25,10 @@ class MonitorManager
|
|
25
25
|
string = "Exiting on request ...\n"
|
26
26
|
puts string
|
27
27
|
|
28
|
-
rescue StandardError
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
puts string
|
28
|
+
rescue StandardError => e
|
29
|
+
puts '*** This is really unexpected.'
|
30
|
+
puts e.class.name
|
31
|
+
puts "Message: #{e.message}"
|
32
|
+
puts e.backtrace
|
34
33
|
end
|
35
34
|
end
|
data/lib/monitor_type.rb
CHANGED
@@ -105,7 +105,7 @@ class MonitorType
|
|
105
105
|
body = "#{@name} tripped.\n#{string}"
|
106
106
|
puts '*** '
|
107
107
|
if !@email.nil?
|
108
|
-
AlertEmail.new(@sender_email, @email, body).
|
108
|
+
AlertEmail.new(@sender_email, @email, body).send
|
109
109
|
puts "Emailed, #{@email}"
|
110
110
|
else
|
111
111
|
puts body
|
data/lib/monitor_type/fluiddb.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'fluiddb2'
|
2
2
|
require 'monitor_type/threshold'
|
3
3
|
|
4
4
|
# A database class for checking a single number against a threshold.
|
@@ -40,7 +40,7 @@ class MonitorTypeFluidDb < MonitorTypeThreshold
|
|
40
40
|
# This ensures that all params are correct.
|
41
41
|
def setup
|
42
42
|
begin
|
43
|
-
@fluid_db =
|
43
|
+
@fluid_db = FluidDb2.db(@uri)
|
44
44
|
rescue StandardError => e
|
45
45
|
string = "*** FluidDb encountered an error while connecting to the db\n" \
|
46
46
|
"*** Error: #{e.message}\n" \
|
@@ -53,7 +53,7 @@ class MonitorTypeFluidDb < MonitorTypeThreshold
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def derived_value
|
56
|
-
@fluid_db.
|
56
|
+
@fluid_db.query_for_value(@sql, [])
|
57
57
|
rescue StandardError
|
58
58
|
string = "*** FluidDb encountered an error while running the sql\n" \
|
59
59
|
"*** sql: #{@sql}\n" \
|