servicemonitor 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,17 +29,22 @@ class MonitorType_Threshold<MonitorType
29
29
  #Provides the means to check a value against thresholds
30
30
  def check( value )
31
31
  context_sentence = ""
32
- if !@context_sentence.nil? then
32
+ unless @context_sentence.nil? then
33
33
  context_sentence = "#{@context_sentence}\n"
34
34
  end
35
35
 
36
+ url = ""
37
+ unless @url.nil? then
38
+ url = "\n\n#{@url}\n"
39
+ end
40
+
36
41
  value = value.to_i
37
42
  if !@min.nil? && value < @min then
38
- self.alert( "#{context_sentence}Minimum threshold exceeded. Minimum: #{@min}, Actual: #{value}" )
43
+ self.alert( "#{context_sentence}Minimum threshold exceeded. Minimum: #{@min}, Actual: #{value}#{url}" )
39
44
  end
40
45
  if !@max.nil? && value > @max then
41
- self.alert( "#{context_sentence}Maximum threshold exceeded. Maximum: #{@max}, Actual: #{value}" )
46
+ self.alert( "#{context_sentence}Maximum threshold exceeded. Maximum: #{@max}, Actual: #{value}#{url}" )
42
47
  end
43
-
48
+
44
49
  end
45
50
  end
data/lib/MonitorType.rb CHANGED
@@ -34,9 +34,11 @@ class MonitorType
34
34
  raise MonitorTypeMustHaveNameError.new(string)
35
35
  end
36
36
  @params = params
37
- @block = params[:block] if !params[:block].nil?
37
+ @block = params[:block] unless params[:block].nil?
38
38
  @name = params[:name]
39
39
  @email = params[:email]
40
+ @url = params[:url] unless params[:url].nil?
41
+
40
42
  if !@email.nil? then
41
43
  #Sender email address from ENV allows for a single sender across all alerts
42
44
  #Checking params before ENV allows a particular entry to be different
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.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-08 00:00:00.000000000 Z
12
+ date: 2014-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parse-cron
16
- requirement: &70226949112320 !ruby/object:Gem::Requirement
16
+ requirement: &70288021454620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70226949112320
24
+ version_requirements: *70288021454620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: beanstalk-client
27
- requirement: &70226949111700 !ruby/object:Gem::Requirement
27
+ requirement: &70288021453260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70226949111700
35
+ version_requirements: *70288021453260
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: fluiddb
38
- requirement: &70226949111160 !ruby/object:Gem::Requirement
38
+ requirement: &70288021449380 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70226949111160
46
+ version_requirements: *70288021449380
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rest-client
49
- requirement: &70226949110260 !ruby/object:Gem::Requirement
49
+ requirement: &70288021460640 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70226949110260
57
+ version_requirements: *70288021460640
58
58
  description: The fastest way to reliably monitor your system.
59
59
  email: guy@guyirvine.com
60
60
  executables: