]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/hardware/recipes/default.rb
Run rasdaemon everywhere, with a prometheus exporter for events
[chef.git] / cookbooks / hardware / recipes / default.rb
index 611ebb74d27a5e9b23af89d89a4b43a8cb68443d..a77908cf4c7e4fc439b59ada912a11945749a2fb 100644 (file)
@@ -59,6 +59,19 @@ case manufacturer
 when "HP"
   package "hponcfg"
 
+  execute "update-ilo" do
+    action :nothing
+    command "/usr/sbin/hponcfg -f /etc/ilo-defaults.xml"
+  end
+
+  template "/etc/ilo-defaults.xml" do
+    source "ilo-defaults.xml.erb"
+    owner "root"
+    group "root"
+    mode "644"
+    notifies :run, "execute[update-ilo]"
+  end
+
   package "hp-health" do
     action :install
     notifies :restart, "service[hp-health]"
@@ -212,6 +225,19 @@ ohai_plugin "lldp" do
   template "lldp.rb.erb"
 end
 
+package %w[
+  rasdaemon
+  ruby-sqlite3
+]
+
+service "rasdaemon" do
+  action [:enable, :start]
+end
+
+prometheus_exporter "rasdaemon" do
+  port 9797
+end
+
 tools_packages = []
 status_packages = {}
 
@@ -233,10 +259,7 @@ if node[:virtualization][:role] != "guest" ||
       status_packages["mpt-status"] ||= []
     when "mpt2sas", "mpt3sas"
       tools_packages << "sas2ircu"
-      status_packages["sas2ircu-status"] ||= [] if node[:lsb][:release].to_f < 22.04
-    when "megaraid_mm"
-      tools_packages << "megactl"
-      status_packages["megaraid-status"] ||= []
+      status_packages["sas2ircu-status"] ||= []
     when "megaraid_sas"
       tools_packages << "megacli"
       status_packages["megaclisas-status"] ||= []
@@ -301,6 +324,7 @@ if status_packages.include?("cciss-vol-status")
   systemd_service "cciss-vol-statusd" do
     description "Check cciss_vol_status values in the background"
     exec_start "/usr/local/bin/cciss-vol-statusd"
+    nice 10
     private_tmp true
     protect_system "full"
     protect_home true
@@ -317,7 +341,7 @@ else
   end
 end
 
-%w[cciss-vol-status mpt-status sas2ircu-status megaraid-status megaclisas-status aacraid-status].each do |status_package|
+%w[cciss-vol-status mpt-status sas2ircu-status megaclisas-status aacraid-status].each do |status_package|
   if status_packages.include?(status_package)
     package status_package
 
@@ -642,3 +666,7 @@ if node[:hardware][:shm_size]
     notifies :run, "execute[remount-dev-shm]"
   end
 end
+
+prometheus_collector "ohai" do
+  interval "15m"
+end