]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/recipes/server.rb
Allow multiple modules to be monitored for a single SNMP target
[chef.git] / cookbooks / prometheus / recipes / server.rb
index 1e9b1409de24e2866d8e5657f60a802c28b5481f..36444527c3eaa60262c78c2f28fc264968da8611 100644 (file)
@@ -32,6 +32,11 @@ prometheus_exporter "fastly" do
   environment "FASTLY_API_TOKEN" => tokens["fastly"]
 end
 
+prometheus_exporter "statuscake" do
+  port 9595
+  environment "STATUSCAKE_APIKEY" => tokens["statuscake"]
+end
+
 cache_dir = Chef::Config[:file_cache_path]
 
 prometheus_version = "2.31.1"
@@ -212,7 +217,7 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client
     snmp_targets << {
       :instance => instance,
       :target => details[:address],
-      :module => details[:module],
+      :modules => details[:modules],
       :address => client[:prometheus][:addresses]["snmp"],
       :labels => Array(details[:labels])
     }
@@ -249,6 +254,7 @@ systemd_service "prometheus-executable" do
   service "prometheus"
   dropin "executable"
   exec_start "/opt/prometheus-server/prometheus/prometheus --config.file=/etc/prometheus/prometheus.yml --web.external-url=https://prometheus.openstreetmap.org/prometheus --storage.tsdb.path=/var/lib/prometheus/metrics2 --storage.tsdb.retention.time=30d"
+  timeout_stop_sec 300
   notifies :restart, "service[prometheus]"
 end