nagiosharder 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "nagiosharder"
8
- gem.version = "0.2.3"
8
+ gem.version = "0.2.4"
9
9
  gem.summary = %Q{Nagios access at your ruby fingertips}
10
10
  gem.description = %Q{Nagios access at your ruby fingertips}
11
11
  gem.email = "josh@technicalpickles.com"
@@ -125,19 +125,18 @@ class NagiosHarder
125
125
  response.code == 200 && response.body =~ /successful/
126
126
  end
127
127
 
128
- # FIXME need to confirm this functionality exists in nagios
129
- #def cancel_downtime(downtime_id, downtime_type = :host_downtime)
130
- # downtime_types = {
131
- # :host_downtime => 78,
132
- # :service_downtime => 79
133
- # }
134
- # response = post(cmd_url, :body => {
135
- # :cmd_typ => downtime_types[downtime_type],
136
- # :cmd_mod => 2,
137
- # :down_id => downtime_id
138
- # })
139
- # response.code == 200 && response.body =~ /successful/
140
- #end
128
+ def cancel_downtime(downtime_id, downtime_type = :host_downtime)
129
+ downtime_types = {
130
+ :host_downtime => 78,
131
+ :service_downtime => 79
132
+ }
133
+ response = post(cmd_url, :body => {
134
+ :cmd_typ => downtime_types[downtime_type],
135
+ :cmd_mod => 2,
136
+ :down_id => downtime_id
137
+ })
138
+ response.code == 200 && response.body =~ /successful/
139
+ end
141
140
 
142
141
  def schedule_host_check(host)
143
142
  response = post(cmd_url, :body => {
@@ -324,7 +323,9 @@ class NagiosHarder
324
323
  end
325
324
 
326
325
  status = columns[2].inner_html if columns[2]
327
- last_check = if columns[3]
326
+ last_check = if columns[3] && columns[3].inner_html != 'N/A'
327
+ last_check_str = columns[3].inner_html
328
+
328
329
  DateTime.strptime(columns[3].inner_html, nagios_time_format).to_time
329
330
  end
330
331
  duration = columns[4].inner_html.squeeze(' ').gsub(/^ /, '') if columns[4]
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{nagiosharder}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Joshua Nichols"]
12
- s.date = %q{2011-01-31}
12
+ s.date = %q{2011-04-22}
13
13
  s.description = %q{Nagios access at your ruby fingertips}
14
14
  s.email = %q{josh@technicalpickles.com}
15
15
  s.extra_rdoc_files = [
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  ]
30
30
  s.homepage = %q{http://github.com/railsmachine/nagiosharder}
31
31
  s.require_paths = ["lib"]
32
- s.rubygems_version = %q{1.3.7}
32
+ s.rubygems_version = %q{1.4.2}
33
33
  s.summary = %q{Nagios access at your ruby fingertips}
34
34
  s.test_files = [
35
35
  "spec/nagiosharder_spec.rb",
@@ -37,7 +37,6 @@ Gem::Specification.new do |s|
37
37
  ]
38
38
 
39
39
  if s.respond_to? :specification_version then
40
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
41
40
  s.specification_version = 3
42
41
 
43
42
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagiosharder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
4
+ hash: 31
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Nichols
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-31 00:00:00 -05:00
18
+ date: 2011-04-22 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  requirements: []
162
162
 
163
163
  rubyforge_project:
164
- rubygems_version: 1.3.7
164
+ rubygems_version: 1.4.2
165
165
  signing_key:
166
166
  specification_version: 3
167
167
  summary: Nagios access at your ruby fingertips