-# 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