sensu-plugins-megaraid 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da95be9ebd4d60461d2920c17293d421d34138a8
4
- data.tar.gz: 6dfbb81c407406254b49f8d5c70b66f1cf1ac7dd
3
+ metadata.gz: 0b92d4ef1207c1052cd3887740f6d009315b6ea6
4
+ data.tar.gz: 2bea76fec98e2762a5a04a7ba4a0380004b78486
5
5
  SHA512:
6
- metadata.gz: f6ab644e952df8b87c65fb6ccf7562e2c976ef19c13d1977fd15111ffce7200e6442adb6f76202e03b93299e4997a82a8ed92ebf3f2eabdd563a07e2ea82e492
7
- data.tar.gz: 2beefc08db2ff6e51b27c9980287152d418f095b3368471e8eb9fc5bf3242108f8b71f2b9bd8310fbb082063af4bc504ea76394b50821576f5e0d1d9f70d64b2
6
+ metadata.gz: 2b54c954dfd1b5b784d4f5c74207cb5954991236eb7b1997a35c1aceae96c17e184c0ffc013a128ec44c71e0a419d12ebf26171f7152fbcc092b03fcd13a7581
7
+ data.tar.gz: f19519284c34f9060efc8917e5643b0fb38c40c35ab9c3dbf4bafefc9b5aab3208c17a2fdf0f9ef0abf96147590901e1b676abf6acfbadedd672e337ed7ec46b
@@ -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['Controllers'][0]['Response Data']['System Overview'].map { |i| i['Ctl'] }
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
- ok "All controllers (#{@controllers.keys.join(', ')}) are healthy"
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
@@ -2,7 +2,7 @@ module SensuPluginsMegaRAID
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 6
5
+ PATCH = 7
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  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.6
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-01-14 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin