X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/1bfdfac0a500ec5752e0f96624ad3b0e4e2ff6d3..0bd6c1db76d2c21e8695ab37f3f5ea35a1a7ef65:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 905053663..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 @@ -403,7 +405,7 @@ if disks.count.positive? package "smartmontools" template "/etc/cron.daily/update-smart-drivedb" do - source "expire.cron.erb" + source "update-smart-drivedb.erb" owner "root" group "root" mode "755" @@ -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]