]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Configure SMART collector for prometheus
[chef.git] / cookbooks / hardware / recipes / default.rb
index c5b5ac226ef6d42c51a9c717d5e347ea0660da7f..27046a1f78c3e5fa067ad2fd644f2d6520f94d4c 100644 (file)
@@ -20,6 +20,7 @@
 include_recipe "apt"
 include_recipe "git"
 include_recipe "munin"
+include_recipe "prometheus"
 include_recipe "sysfs"
 include_recipe "tools"
 
@@ -450,6 +451,18 @@ if disks.count.positive?
       conf_variables :disk => disk
     end
   end
+
+  template "/etc/prometheus/collectors/smart.devices" do
+    source "smart.devices.erb"
+    owner "root"
+    group "root"
+    mode "644"
+    variables :disks => disks
+  end
+
+  prometheus_collector "smart" do
+    interval "15m"
+  end
 else
   service "smartd" do
     action [:stop, :disable]