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 CHANGED
@@ -9,6 +9,7 @@ require "Alert/Email"
9
9
  require "MonitorType"
10
10
  require "MonitorType/Threshold"
11
11
  require "MonitorType/Dir"
12
+ require "MonitorType/FluidDb"
12
13
  require "MonitorManager"
13
14
 
14
15
  def log( string, verbose=false )
@@ -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
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