X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/6110a3a7aa3c17b3eeb17ef23324f0b5b906ead8..4b7c8414cf7bbf8eacf48cd0d0a4d9e8b01c34d3:/cookbooks/prometheus/recipes/server.rb diff --git a/cookbooks/prometheus/recipes/server.rb b/cookbooks/prometheus/recipes/server.rb index 4ca2d3909..a480a8323 100644 --- a/cookbooks/prometheus/recipes/server.rb +++ b/cookbooks/prometheus/recipes/server.rb @@ -120,6 +120,7 @@ search(:node, "roles:gateway") do |gateway| end jobs = {} +junos_targets = [] snmp_targets = [] search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client| @@ -162,6 +163,15 @@ search(:node, "recipes:prometheus\\:\\:default").sort_by(&:name).each do |client } end + Hash(client[:prometheus][:junos]).each do |instance, details| + junos_targets << { + :instance => instance, + :target => details[:address], + :address => client[:prometheus][:addresses]["junos"], + :labels => Array(details[:labels]) + } + end + Hash(client[:prometheus][:snmp]).each do |instance, details| snmp_targets << { :instance => instance, @@ -214,7 +224,7 @@ template "/etc/prometheus/prometheus.yml" do owner "root" group "root" mode "644" - variables :jobs => jobs, :snmp_targets => snmp_targets, :certificates => certificates + variables :jobs => jobs, :junos_targets => junos_targets, :snmp_targets => snmp_targets, :certificates => certificates end template "/etc/prometheus/alert_rules.yml" do