X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/043f2445f19ec3797d3b2c9822c031813c0629e3..03b7d5e985a34d01dccfd03dc11488015e97f7df:/cookbooks/hardware/recipes/default.rb diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index ebda56f43..154a793a5 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -200,11 +200,22 @@ service "lldpd" do supports :status => true, :restart => true, :reload => true end -# mcelog Daemon to log / alert on machine check events -package "mcelog" -service "mcelog" do - action [:start, :enable] - supports :status => true, :restart => true, :reload => false +if node[:hardware][:mcelog][:enabled] + package "mcelog" + + %w[bus cache dimm iomca page socket-memory unknown].each do |trigger| + template "/etc/mcelog/#{trigger}-error-trigger.local" do + source "mcelog-trigger.erb" + owner "root" + group "root" + mode 0o755 + end + end + + service "mcelog" do + action [:start, :enable] + supports :status => true, :restart => true, :reload => false + end end tools_packages = [] @@ -415,7 +426,7 @@ if disks.count.positive? # an Areca controller as they only allow one thing to # talk to the controller at a time and smartd will # throw errors if it clashes with munin - disks = disks.reject { |disk| disk[:smart] && disk[:smart].start_with?("areca,") } + disks = disks.reject { |disk| disk[:smart]&.start_with?("areca,") } disks.each do |disk| munin_plugin "smart_#{disk[:munin]}" do