X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/2cf386791e81bc3a0ea80967961711369223c102..49448b664ef6185d2b39c1e5c447bd9772f93506:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 8a2a35e20..e8f903f64 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -380,6 +380,13 @@ disks = disks.map do |disk| elsif smart =~ %r{^.*,(\d+)/(\d+)$} munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}" end + elsif disk[:device] + device = disk[:device].sub("/dev/", "") + smart = disk[:smart_device] + + if smart =~ /^.*,(\d+),(\d+),(\d+)$/ + munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}:#{Regexp.last_match(3)}" + end end elsif disk[:device] =~ %r{^/dev/(nvme\d+)n\d+$} device = Regexp.last_match(1)