:instance => instance,
:target => details[:address],
:module => details[:module],
- :address => client[:prometheus][:addresses]["snmp"]
+ :address => client[:prometheus][:addresses]["snmp"],
+ :labels => Array(details[:labels])
}
end
end
- "<%= target[:target] %>/<%= target[:module] %>/<%= target[:address] %>"
labels:
instance: <%= target[:instance] %>
+<% target[:labels].sort.each do |name, value| -%>
+ <%= name %>: <%= value %>
+<% end -%>
<% end -%>
relabel_configs:
- source_labels: [__address__]
},
:prometheus => {
:snmp => {
- "pdu1" => { :address => "10.0.48.100", :module => "apcups" },
- "pdu2" => { :address => "10.0.48.101", :module => "apcups" },
- "switch1" => { :address => "130.117.76.2", :module => "if_mib" }
+ "pdu1" => { :address => "10.0.48.100", :module => "apcups", :labels => { "site" => "amsterdam" } },
+ "pdu2" => { :address => "10.0.48.101", :module => "apcups", :labels => { "site" => "amsterdam" } },
+ "switch1" => { :address => "130.117.76.2", :module => "if_mib", :labels => { "site" => "amsterdam" } }
}
},
:rsyncd => {