]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Fix SMART monitoring of nvme devices
[chef.git] / cookbooks / hardware / recipes / default.rb
index 66babcc94d6f1c6082e56362442326460cf345b6..bd525babff6d0e67e80a1ca88ffd5866e188af4a 100644 (file)
@@ -84,7 +84,7 @@ when "TYAN Computer Corporation"
   units << "0"
 when "Supermicro"
   case product
-  when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F", "X9DRW", "SYS-1028U-TN10RT+", "SYS-2028U-TN24R4T+", "Super Server"
+  when "H8DGU", "X9SCD", "X7DBU", "X7DW3", "X9DR7/E-(J)LN4F", "X9DR3-F", "X9DRW", "SYS-1028U-TN10RT+", "SYS-2028U-TN24R4T+", "SYS-1029P-WTRT", "Super Server"
     units << "1"
   else
     units << "0"
@@ -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"