bin/check-smart-status.rb in sensu-plugins-disk-checks-4.0.0 vs bin/check-smart-status.rb in sensu-plugins-disk-checks-4.0.1
- old
+ new
@@ -270,10 +270,19 @@
devices = []
# Return parameter value if it's defined
if config[:devices] != 'all'
config[:devices].split(',').each do |dev|
- devices << Disk.new(dev.to_s, '', nil)
+ jconfig = @hardware.find { |d| d[:path] == dev }
+
+ if jconfig.nil?
+ override = nil
+ ignore = nil
+ else
+ override = jconfig[:override]
+ ignore = jconfig[:ignore]
+ end
+ devices << Disk.new(dev.to_s, override, ignore)
end
return devices
end
`lsblk -nro NAME,TYPE`.each_line do |line|