X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/ceada9024221218877e45b37e08f2f6632db5360..2bce87624a95eeebc027ee8f3eed5fda8c47bba9:/cookbooks/munin/recipes/default.rb diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 8769352c4..e83cac6f6 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -50,7 +50,7 @@ template "/etc/munin/munin-node.conf" do group "root" mode 0644 variables :servers => servers - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end remote_directory "/usr/local/share/munin/plugins" do @@ -73,7 +73,7 @@ remote_directory "/etc/munin/plugin-conf.d" do files_group "root" files_mode 0644 purge false - notifies :restart, resources(:service => "munin-node") + notifies :restart, "service[munin-node]" end if Dir.glob("/proc/acpi/thermal_zone/*/temperature").empty? @@ -101,7 +101,9 @@ munin_plugin "diskstats" munin_plugin "entropy" munin_plugin "forks" -if File.exists?("/proc/net/ip_conntrack") or File.exists?("/proc/net/nf_conntrack") +if node[:kernel][:modules].include?("nf_conntrack") + package "conntrack" + munin_plugin "fw_conntrack" munin_plugin "fw_forwarded_local" else @@ -114,7 +116,7 @@ else end end -if %x{sysctl -n net.ipv4.ip_forward}.chomp == "1" +if File.read("/proc/sys/net/ipv4/ip_forward").chomp == "1" munin_plugin "fw_packets" else munin_plugin "fw_packets" do @@ -186,23 +188,6 @@ else end munin_plugin "irqstats" - -Dir.new("/sys/block").each do |device| - if device.match(/^sd/) - munin_plugin "linux_diskstat_iops_#{device}" do - target "linux_diskstat_" - end - - munin_plugin "linux_diskstat_latency_#{device}" do - target "linux_diskstat_" - end - - munin_plugin "linux_diskstat_throughput_#{device}" do - target "linux_diskstat_" - end - end -end - munin_plugin "load" munin_plugin "memory" munin_plugin "netstat" @@ -286,7 +271,18 @@ else end end -# smart_ +node[:block_device].each do |name,attributes| + if attributes[:vendor] == "ATA" + munin_plugin "smart_#{name}" do + target "smart_" + end + else + munin_plugin "smart_#{name}" do + action :delete + end + end +end + munin_plugin "swap" munin_plugin "threads" munin_plugin "uptime"