X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/0278b32c8435ff5741f9146a1c69b1bc303a1892..4d58dbbf44ec07022db6abfadc8a992a6496bc1b:/cookbooks/prometheus/recipes/default.rb diff --git a/cookbooks/prometheus/recipes/default.rb b/cookbooks/prometheus/recipes/default.rb index 6e88362a4..85c5ec312 100644 --- a/cookbooks/prometheus/recipes/default.rb +++ b/cookbooks/prometheus/recipes/default.rb @@ -121,3 +121,26 @@ unless node[:prometheus][:snmp].empty? register_target false end end + +if node[:prometheus][:files].empty? + prometheus_exporter "filestat" do + action :delete + end + + file "/etc/prometheus/filestat.yml" do + action :delete + end +else + template "/etc/prometheus/filestat.yml" do + source "filestat.yml.erb" + owner "root" + group "root" + mode "644" + end + + prometheus_exporter "filestat" do + port 9943 + options "--config.file=/etc/prometheus/filestat.yml" + subscribes :restart, "template[/etc/prometheus/filestat.yml]" + end +end