servicemonitor 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/servicemonitor +1 -0
- data/lib/MonitorType/FluidDb.rb +30 -0
- metadata +2 -1
data/bin/servicemonitor
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "FluidDb"
|
2
|
+
require "MonitorType/Threshold"
|
3
|
+
|
4
|
+
class MonitorType_FluidDb<MonitorType_Threshold
|
5
|
+
|
6
|
+
def sanitise
|
7
|
+
@fluidDb = FluidDb.Db( @uri )
|
8
|
+
end
|
9
|
+
|
10
|
+
def initialize( name, uri, sql, params )
|
11
|
+
super( name, params )
|
12
|
+
@uri = URI.parse( uri )
|
13
|
+
@sql = sql
|
14
|
+
self.sanitise
|
15
|
+
rescue MonitorTypeExceptionHandled => e
|
16
|
+
puts e.message
|
17
|
+
abort()
|
18
|
+
end
|
19
|
+
|
20
|
+
def process
|
21
|
+
value = @fluidDb.queryForValue( @sql, [] )
|
22
|
+
|
23
|
+
self.check( value.to_i, "Checking result of sql query, @{sql}" )
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def fluiddb( name, uri, sql, params )
|
28
|
+
$a.add( MonitorType_FluidDb.new( name, uri, sql, params ) )
|
29
|
+
end
|
30
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: servicemonitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- lib/Alert.rb
|
23
23
|
- lib/MonitorManager.rb
|
24
24
|
- lib/MonitorType/Dir.rb
|
25
|
+
- lib/MonitorType/FluidDb.rb
|
25
26
|
- lib/MonitorType/Threshold.rb
|
26
27
|
- lib/MonitorType.rb
|
27
28
|
- bin/servicemonitor
|