Skip to content

Commit

Permalink
Remove munin
Browse files Browse the repository at this point in the history
Fixed: openstreetmap/operations#501
Signed-off-by: Grant Slater <[email protected]>
  • Loading branch information
Firefishy committed Mar 12, 2024
1 parent 4dca09e commit 62c6c02
Show file tree
Hide file tree
Showing 95 changed files with 75 additions and 8,009 deletions.
4 changes: 0 additions & 4 deletions cookbooks/apache/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@
maxretry 3
end

munin_plugin "apache_accesses"
munin_plugin "apache_processes"
munin_plugin "apache_volume"

template "/var/lib/prometheus/node-exporter/apache.prom" do
source "apache.prom.erb"
owner "root"
Expand Down
2 changes: 0 additions & 2 deletions cookbooks/chef/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,3 @@
group "root"
mode "755"
end

munin_plugin "chef_status"
5 changes: 0 additions & 5 deletions cookbooks/db/recipes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@
passwords = data_bag_item("db", "passwords")
wal_secrets = data_bag_item("db", "wal-secrets")

postgresql_munin "openstreetmap" do
cluster node[:db][:cluster]
database "openstreetmap"
end

directory "/srv/www.openstreetmap.org" do
group "rails"
mode "2775"
Expand Down
9 changes: 5 additions & 4 deletions cookbooks/db/recipes/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@
password passwords["backup"]
end

postgresql_user "munin" do
cluster node[:db][:cluster]
password passwords["munin"]
end
# FIXME: munin user should be removed
# postgresql_user "munin" do
# cluster node[:db][:cluster]
# password passwords["munin"]
# end

postgresql_user "replication" do
cluster node[:db][:cluster]
Expand Down
7 changes: 0 additions & 7 deletions cookbooks/dev/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,6 @@
apache_site "apis.dev.openstreetmap.org" do
template "apache.apis.erb"
end

node[:postgresql][:clusters].each_key do |name|
postgresql_munin name do
cluster name
database "ALL"
end
end
end

directory "/srv/ooc.openstreetmap.org" do
Expand Down
3 changes: 0 additions & 3 deletions cookbooks/exim/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@
mode "644"
end

munin_plugin "exim_mailqueue"
munin_plugin "exim_mailstats"

prometheus_exporter "exim" do
port 9636
user "Debian-exim"
Expand Down
2 changes: 0 additions & 2 deletions cookbooks/fail2ban/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
action [:enable, :start]
end

munin_plugin "fail2ban"

prometheus_exporter "fail2ban" do
port 9635
user "root"
Expand Down
57 changes: 2 additions & 55 deletions cookbooks/hardware/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,38 +445,21 @@
if controller && controller[:device]
device = controller[:device].sub("/dev/", "")
smart = disk[:smart_device]

if device.start_with?("cciss/") && smart =~ /^cciss,(\d+)$/
array = node[:hardware][:disk][:arrays][disk[:arrays].first]
munin = "cciss-3#{array[:wwn]}-#{Regexp.last_match(1)}"
elsif smart =~ /^.*,(\d+)$/
munin = "#{device}-#{Regexp.last_match(1)}"
elsif smart =~ %r{^.*,(\d+)/(\d+)$}
munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}"
end
elsif disk[:device]
device = disk[:device].sub("/dev/", "")
smart = disk[:smart_device]

if smart =~ /^.*,(\d+),(\d+),(\d+)$/
munin = "#{device}-#{Regexp.last_match(1)}:#{Regexp.last_match(2)}:#{Regexp.last_match(3)}"
end
end
elsif disk[:device] =~ %r{^/dev/(nvme\d+)n\d+$}
device = Regexp.last_match(1)
munin = device
elsif disk[:device]
device = disk[:device].sub("/dev/", "")
munin = device
end

next if device.nil? || munin.nil?
next if device.nil?

Hash[
:device => device,
:smart => smart,
:munin => munin,
:hddtemp => munin.tr("-:", "_")
:smart => smart
]
end

Expand Down Expand Up @@ -536,48 +519,12 @@
private_users false
protect_clock false
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
# throw errors if it clashes with munin
disks = disks.reject { |disk| disk[:smart]&.start_with?("areca,") }

disks.each do |disk|
munin_plugin "smart_#{disk[:munin]}" do
target "smart_"
conf "munin.smart.erb"
conf_variables :disk => disk
end
end
else
service "smartd" do
action [:stop, :disable]
end
end

if disks.count.positive?
munin_plugin "hddtemp_smartctl" do
conf "munin.hddtemp.erb"
conf_variables :disks => disks
end
else
munin_plugin "hddtemp_smartctl" do
action :delete
conf "munin.hddtemp.erb"
end
end

plugins = Dir.glob("/etc/munin/plugins/smart_*").map { |p| File.basename(p) } -
disks.map { |d| "smart_#{d[:munin]}" }

plugins.each do |plugin|
munin_plugin plugin do
action :delete
conf "munin.smart.erb"
end
end

if File.exist?("/etc/mdadm/mdadm.conf")
mdadm_conf = edit_file "/etc/mdadm/mdadm.conf" do |line|
line.gsub!(/^MAILADDR .*$/, "MAILADDR [email protected]")
Expand Down
10 changes: 0 additions & 10 deletions cookbooks/hardware/templates/default/munin.hddtemp.erb

This file was deleted.

9 changes: 0 additions & 9 deletions cookbooks/hardware/templates/default/munin.smart.erb

This file was deleted.

10 changes: 0 additions & 10 deletions cookbooks/memcached/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@
notifies :restart, "service[memcached]"
end

munin_plugin_conf "memcached_multi" do
template "munin.erb"
end

%w[bytes commands conns evictions items memory].each do |stat|
munin_plugin "memcached_multi_#{stat}" do
target "memcached_multi_"
end
end

prometheus_exporter "memcached" do
port 9150
options "--memcached.address=#{node[:memcached][:ip_address]}:#{node[:memcached][:tcp_port]} --memcached.pid-file=/run/memcached/memcached.pid"
Expand Down
6 changes: 0 additions & 6 deletions cookbooks/memcached/templates/default/munin.erb

This file was deleted.

2 changes: 0 additions & 2 deletions cookbooks/munin/files/default/plugin-conf.d/api

This file was deleted.

2 changes: 0 additions & 2 deletions cookbooks/munin/files/default/plugin-conf.d/chef

This file was deleted.

2 changes: 0 additions & 2 deletions cookbooks/munin/files/default/plugin-conf.d/hpasmcli2

This file was deleted.

69 changes: 0 additions & 69 deletions cookbooks/munin/files/default/plugins/api_calls_

This file was deleted.

34 changes: 0 additions & 34 deletions cookbooks/munin/files/default/plugins/api_calls_num

This file was deleted.

47 changes: 0 additions & 47 deletions cookbooks/munin/files/default/plugins/api_calls_status

This file was deleted.

Loading

0 comments on commit 62c6c02

Please sign in to comment.