]> git.openstreetmap.org Git - chef.git/commitdiff
Enable NTP collector for prometheus node exporter
authorTom Hughes <tom@compton.nu>
Thu, 17 Sep 2020 18:23:17 +0000 (18:23 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 17 Sep 2020 18:23:17 +0000 (18:23 +0000)
cookbooks/ntp/templates/default/chrony.conf.erb
cookbooks/prometheus/recipes/default.rb
cookbooks/prometheus/resources/exporter.rb
cookbooks/prometheus/templates/default/defaults.erb

index 9fc9393bc9953eabcecf45cf3d58eea957f52d41..03728fddb8c60d3b754555c81240ea87c38b5768 100644 (file)
@@ -9,6 +9,10 @@ pool <%= server %> iburst
 pool time.cloudflare.com iburst
 pool time.google.com iburst
 
+# Allow local queries for monitoring
+allow 127.0.0.1/32
+allow ::1/128
+
 # Run an initial NTP sync on daemon startup
 initstepslew 30 time.cloudflare.com time.google.com <%= node[:ntp][:servers].join(" ") %>
 
index ad0a95a0aa76ec9f2901ac19aceaf72d68242194..f657b99903f3d30b871f7e9ca61ef7d6549e693b 100644 (file)
@@ -41,4 +41,5 @@ end
 prometheus_exporter "node" do
   port 9100
   package_options "--no-install-recommends"
+  exporter_options "--collector.ntp"
 end
index e740ac79ec2ecf281bedc36e733d31bfeefab475..8dd9288464751f94ddc54e24cb7f970bcc4d0ae3 100644 (file)
@@ -22,6 +22,7 @@ default_action :create
 property :exporter, :kind_of => String, :name_property => true
 property :port, :kind_of => Integer, :required => [:create]
 property :listen_switch, :kind_of => String, :default => "web.listen-address"
+property :exporter_options, :kind_of => [String, Array]
 property :package, :kind_of => String
 property :package_options, :kind_of => String
 property :defaults, :kind_of => String
index 3760c99f753181f2fecc8e8323a2ba96f38faf58..c73c52e9a4020a2dd6e2e2db2a7d7f87f5654ab0 100644 (file)
@@ -1,3 +1,3 @@
 # DO NOT EDIT - This file is being maintained by Chef
 
-ARGS="--<%= @listen_switch %>=<%= @listen_address %>"
+ARGS="--<%= @listen_switch %>=<%= @listen_address %> <%= Array(@exporter_options).join(" ") %>"