]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/munin/recipes/default.rb
Remove unused support for legacy linux_diskstat_ munin plugin
[chef.git] / cookbooks / munin / recipes / default.rb
index 3a5be0d61513b92a9b7a0cdae4e1b1c488318095..e83cac6f69690cc836e878c861a412d84defa02f 100644 (file)
@@ -188,23 +188,6 @@ else
 end
 
 munin_plugin "irqstats"
-
-Dir.new("/sys/block").each do |device|
-  if device.match(/^sd/)
-    munin_plugin "linux_diskstat_iops_#{device}" do
-      target "linux_diskstat_"
-    end
-
-    munin_plugin "linux_diskstat_latency_#{device}" do
-      target "linux_diskstat_"
-    end
-
-    munin_plugin "linux_diskstat_throughput_#{device}" do
-      target "linux_diskstat_"
-    end
-  end
-end
-
 munin_plugin "load"
 munin_plugin "memory"
 munin_plugin "netstat"
@@ -288,7 +271,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"