X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/2636d0358499bd5175872605c759ff96b6243e26..5f87e80390086757b4dbbf810e4417225751d7f9:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index c5b5ac226..711fa4571 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -20,6 +20,7 @@ include_recipe "apt" include_recipe "git" include_recipe "munin" +include_recipe "prometheus" include_recipe "sysfs" include_recipe "tools" @@ -140,6 +141,7 @@ if File.exist?("/etc/default/grub") execute "update-grub" do action :nothing command "/usr/sbin/update-grub" + not_if { ENV["TEST_KITCHEN"] } end template "/etc/default/grub" do @@ -450,6 +452,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]