sensu-plugin 0.1.0 → 0.1.1
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/lib/sensu-plugin.rb +1 -1
- data/lib/sensu-plugin/cli.rb +2 -2
- data/test/external_check_test.rb +5 -0
- metadata +6 -6
data/lib/sensu-plugin.rb
CHANGED
data/lib/sensu-plugin/cli.rb
CHANGED
@@ -52,9 +52,9 @@ module Sensu
|
|
52
52
|
rescue SystemExit => e
|
53
53
|
exit e.status
|
54
54
|
rescue Exception => e
|
55
|
-
|
55
|
+
check.critical "Check failed to run: #{e.message}, #{e.backtrace}"
|
56
56
|
end
|
57
|
-
|
57
|
+
check.warning "Check did not exit! You should call an exit code method."
|
58
58
|
end
|
59
59
|
|
60
60
|
end
|
data/test/external_check_test.rb
CHANGED
@@ -38,6 +38,11 @@ class TestCheckExternal < MiniTest::Unit::TestCase
|
|
38
38
|
assert $?.exitstatus == 1
|
39
39
|
end
|
40
40
|
|
41
|
+
def test_exception
|
42
|
+
output = run_script '-f'
|
43
|
+
assert $?.exitstatus == 2 && output.include?('failed')
|
44
|
+
end
|
45
|
+
|
41
46
|
def test_argv
|
42
47
|
output = run_script '-o', 'foo'
|
43
48
|
assert $?.exitstatus == 0 && output.include?('argv = foo')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
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: 2012-01-
|
12
|
+
date: 2012-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &70294828191900 !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: *
|
24
|
+
version_requirements: *70294828191900
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: mixlib-cli
|
27
|
-
requirement: &
|
27
|
+
requirement: &70294828189640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.1.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70294828189640
|
36
36
|
description: Plugins and helper libraries for Sensu, a monitoring framework
|
37
37
|
email:
|
38
38
|
- decklin@red-bean.com
|