]> git.openstreetmap.org Git - chef.git/commitdiff
Enable prometheus SMART monitoring for Areca controllers
authorTom Hughes <tom@compton.nu>
Thu, 12 Nov 2020 00:14:48 +0000 (00:14 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 12 Nov 2020 00:14:48 +0000 (00:14 +0000)
cookbooks/hardware/recipes/default.rb

index a9de7a2f48de63236df22af696aa6b801e67a753..42d2e911709fd9d3b37e29b00b5044506943f759 100644 (file)
@@ -453,6 +453,18 @@ if disks.count.positive?
     subscribes :restart, "template[/etc/default/smartmontools]"
   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
+
   # Don't try and do munin monitoring of disks behind
   # an Areca controller as they only allow one thing to
   # talk to the controller at a time and smartd will
@@ -466,18 +478,6 @@ 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]