god 0.7.15 → 0.7.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,12 @@
1
+ == 0.7.16 / 2009-08-24
2
+ * Minor Enhancements
3
+ * Better logging for disk_usage condition [github.com/lettherebecode]
4
+ * Bug Fixes
5
+ * Only sleep if driver delay is > 0 [github.com/ps2]
6
+ * Rescue Timeout::Error exception due to smtp server timing out [github.com/ps2]
7
+ * Disk usage condition should use `df -P` to prevent line splitting [github.com/mseppae]
8
+ * Always require YAML so binary works on dumb systems
9
+
1
10
  == 0.7.15 / 2009-08-19
2
11
  * Minor Enhancements
3
12
  * Support SSL Campfire connections [github.com/eric]
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 7
4
- :patch: 15
4
+ :patch: 16
data/bin/god CHANGED
@@ -7,6 +7,7 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
7
7
  require 'rubygems'
8
8
  require 'optparse'
9
9
  require 'drb'
10
+ require 'yaml'
10
11
 
11
12
  begin
12
13
  options = {:daemonize => true, :port => 17165, :syslog => true, :events => true}
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{god}
5
- s.version = "0.7.15"
5
+ s.version = "0.7.16"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Tom Preston-Werner"]
9
- s.date = %q{2009-08-19}
9
+ s.date = %q{2009-08-24}
10
10
  s.default_executable = %q{god}
11
11
  s.description = %q{God is an easy to configure, easy to extend monitoring framework written in Ruby.}
12
12
  s.email = %q{tom@mojombo.com}
@@ -18,10 +18,15 @@ module God
18
18
  end
19
19
 
20
20
  def test
21
- usage = `df | grep -i " #{self.mount_point}$" | awk '{print $5}' | sed 's/%//'`
22
- usage.to_i > self.above
21
+ usage = `df -P | grep -i " #{self.mount_point}$" | awk '{print $5}' | sed 's/%//'`
22
+ if usage.to_i > self.above
23
+ self.info = "disk space out of bounds"
24
+ return true
25
+ else
26
+ self.info = "disk space ok"
27
+ return false
28
+ end
23
29
  end
24
30
  end
25
-
26
31
  end
27
- end
32
+ end
@@ -90,7 +90,8 @@ module God
90
90
  Thread.stop
91
91
  else
92
92
  Thread.critical = false
93
- sleep @events.first.at - Time.now
93
+ delay = @events.first.at - Time.now
94
+ sleep delay if delay > 0
94
95
  Thread.critical = true
95
96
  end
96
97
  end
@@ -479,13 +479,17 @@ module God
479
479
  # notify each contact
480
480
  resolved_contacts.each do |c|
481
481
  host = `hostname`.chomp rescue 'none'
482
- c.notify(message, Time.now, spec[:priority], spec[:category], host)
483
-
484
- msg = "#{condition.watch.name} #{c.info ? c.info : "notification sent for contact: #{c.name}"} (#{c.base_name})"
485
-
486
- applog(condition.watch, :info, msg % [])
482
+ begin
483
+ c.notify(message, Time.now, spec[:priority], spec[:category], host)
484
+ msg = "#{condition.watch.name} #{c.info ? c.info : "notification sent for contact: #{c.name}"} (#{c.base_name})"
485
+ applog(condition.watch, :info, msg % [])
486
+ rescue Exception => e
487
+ applog(condition.watch, :error, "#{e.message} #{e.backtrace}")
488
+ msg = "#{condition.watch.name} Failed to deliver notification for contact: #{c.name} (#{c.base_name})"
489
+ applog(condition.watch, :error, msg % [])
490
+ end
487
491
  end
488
492
  end
489
493
  end
490
494
 
491
- end
495
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: god
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.15
4
+ version: 0.7.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-19 00:00:00 -07:00
12
+ date: 2009-08-24 00:00:00 -07:00
13
13
  default_executable: god
14
14
  dependencies: []
15
15