sensu-plugins-megaraid 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/bin/check-megaraid.rb +12 -2
- data/lib/sensu-plugins-megaraid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0b92d4ef1207c1052cd3887740f6d009315b6ea6
|
|
4
|
+
data.tar.gz: 2bea76fec98e2762a5a04a7ba4a0380004b78486
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b54c954dfd1b5b784d4f5c74207cb5954991236eb7b1997a35c1aceae96c17e184c0ffc013a128ec44c71e0a419d12ebf26171f7152fbcc092b03fcd13a7581
|
|
7
|
+
data.tar.gz: f19519284c34f9060efc8917e5643b0fb38c40c35ab9c3dbf4bafefc9b5aab3208c17a2fdf0f9ef0abf96147590901e1b676abf6acfbadedd672e337ed7ec46b
|
data/bin/check-megaraid.rb
CHANGED
|
@@ -45,6 +45,8 @@ class CheckMegaRAID < Sensu::Plugin::Check::CLI
|
|
|
45
45
|
def initialize()
|
|
46
46
|
super
|
|
47
47
|
|
|
48
|
+
raise "Unable to find storcli command" unless File.executable?(config[:storcli_cmd])
|
|
49
|
+
|
|
48
50
|
if config[:controller_id].length > 0
|
|
49
51
|
controller_id = config[:controller_id]
|
|
50
52
|
else
|
|
@@ -71,7 +73,11 @@ class CheckMegaRAID < Sensu::Plugin::Check::CLI
|
|
|
71
73
|
|
|
72
74
|
def get_controllers()
|
|
73
75
|
data = JSON.parse(%x[#{config[:storcli_cmd]} show J].chomp)
|
|
74
|
-
data
|
|
76
|
+
if data.has_key?('Controllers')
|
|
77
|
+
data['Controllers'][0]['Response Data']['System Overview'].map { |i| i['Ctl'] }
|
|
78
|
+
else
|
|
79
|
+
[]
|
|
80
|
+
end
|
|
75
81
|
end
|
|
76
82
|
|
|
77
83
|
def send_client_socket(data)
|
|
@@ -188,7 +194,11 @@ class CheckMegaRAID < Sensu::Plugin::Check::CLI
|
|
|
188
194
|
warning if config[:warn]
|
|
189
195
|
critical
|
|
190
196
|
else
|
|
191
|
-
|
|
197
|
+
if @controllers
|
|
198
|
+
ok "All controllers (#{@controllers.keys.join(', ')}) are healthy"
|
|
199
|
+
else
|
|
200
|
+
ok "No MegaRAID devices detected"
|
|
201
|
+
end
|
|
192
202
|
end
|
|
193
203
|
end
|
|
194
204
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sensu-plugins-megaraid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matteo Cerutti
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sensu-plugin
|