Configure SMART attribute monitoring for direct attached SATA disks
authorTom Hughes <tom@compton.nu>
Tue, 21 Jan 2014 23:01:48 +0000 (23:01 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 21 Jan 2014 23:01:48 +0000 (23:01 +0000)
cookbooks/munin/recipes/default.rb

index 3a5be0d..ce771e8 100644 (file)
@@ -288,7 +288,18 @@ else
   end
 end
 
-# smart_
+node[:block_device].each do |name,attributes|
+  if attributes[:vendor] == "ATA"
+    munin_plugin "smart_#{name}" do
+      target "smart_"
+    end
+  else
+    munin_plugin "smart_#{name}" do
+      action :delete
+    end
+  end
+end
+
 munin_plugin "swap"
 munin_plugin "threads"
 munin_plugin "uptime"