From 65c9e8faf5ce93135f34acfd6ec4f8ecd5f06f4f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 3 Apr 2019 18:34:43 +0100 Subject: [PATCH] Fix SMART monitoring of nvme devices --- cookbooks/hardware/recipes/default.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index c281c7fc8..bd525babf 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -353,6 +353,9 @@ disks = disks.map do |disk| munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}" end end + elsif disk[:device] =~ %r{^/dev/(nvme\d+)n\d+$} + device = Regexp.last_match(1) + munin = device elsif disk[:device] device = disk[:device].sub("/dev/", "") munin = device @@ -368,7 +371,7 @@ disks = disks.map do |disk| ] end -disks = disks.compact +disks = disks.compact.uniq if disks.count.positive? package "smartmontools" -- 2.43.2