nagios_check 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/nagios_check.rb +12 -3
- data/lib/nagios_check/version.rb +1 -1
- metadata +17 -7
data/README.md
CHANGED
@@ -29,7 +29,7 @@ Features
|
|
29
29
|
Usage and documentation
|
30
30
|
-----------------------
|
31
31
|
|
32
|
-
NagiosCheck is a module. To use it simply include it in a class and declare
|
32
|
+
NagiosCheck is a module. To use it, simply include it in a class and declare
|
33
33
|
how the check should behave:
|
34
34
|
|
35
35
|
``` ruby
|
data/lib/nagios_check.rb
CHANGED
@@ -17,9 +17,9 @@ module NagiosCheck
|
|
17
17
|
|
18
18
|
def run
|
19
19
|
prepare
|
20
|
-
parse_options
|
21
20
|
return_val, status = 3, "UNKNOWN"
|
22
21
|
begin
|
22
|
+
parse_options
|
23
23
|
if @timeout
|
24
24
|
check_with_timeout
|
25
25
|
else
|
@@ -28,6 +28,8 @@ module NagiosCheck
|
|
28
28
|
return_val, status = finish
|
29
29
|
rescue Timeout::Error
|
30
30
|
store_message "TIMEOUT after #{@timeout}s"
|
31
|
+
rescue OptionParser::InvalidArgument, NagiosCheck::MissingOption => e
|
32
|
+
store_message "CLI ERROR: #{e}"
|
31
33
|
rescue => e
|
32
34
|
store_message "INTERNAL ERROR: #{e}"
|
33
35
|
end
|
@@ -160,6 +162,13 @@ module NagiosCheck
|
|
160
162
|
Timeout.timeout(@timeout) { check }
|
161
163
|
end
|
162
164
|
|
163
|
-
class MissingOption < StandardError;
|
164
|
-
|
165
|
+
class MissingOption < StandardError;
|
166
|
+
def initialize(name)
|
167
|
+
@name = name
|
168
|
+
end
|
169
|
+
|
170
|
+
def to_s
|
171
|
+
"missing option: '#{@name}'"
|
172
|
+
end
|
173
|
+
end
|
165
174
|
end
|
data/lib/nagios_check/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nagios_check
|
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:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-03-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 2.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.0
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rake
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,7 +37,12 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
description: An easy to use DSL for building custom probes for the Nagios monitoring
|
37
47
|
system
|
38
48
|
email:
|
@@ -74,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
84
|
version: '0'
|
75
85
|
requirements: []
|
76
86
|
rubyforge_project: nagios_check
|
77
|
-
rubygems_version: 1.8.
|
87
|
+
rubygems_version: 1.8.19
|
78
88
|
signing_key:
|
79
89
|
specification_version: 3
|
80
90
|
summary: Ruby Nagios Check Integration
|