snmp_targets << {
:instance => instance,
:target => details[:address],
- :module => details[:module],
+ :modules => details[:modules],
:address => client[:prometheus][:addresses]["snmp"],
:labels => Array(details[:labels])
}
scrape_timeout: 2m
metrics_path: /snmp
static_configs:
- - targets:
<% @snmp_targets.sort_by { |t| t[:instance] }.each do |target| -%>
- targets:
- - "<%= target[:target] %>/<%= target[:module] %>/<%= target[:address] %>"
+<% target[:modules].each do |module_name| -%>
+ - "<%= target[:target] %>/<%= module_name %>/<%= target[:address] %>"
+<% end -%>
labels:
instance: <%= target[:instance] %>
<% target[:labels].sort.each do |name, value| -%>
},
:prometheus => {
:snmp => {
- "pdu1" => { :address => "10.0.64.100", :module => "apcups", :labels => { "site" => "dublin" } },
- "pdu2" => { :address => "10.0.64.101", :module => "apcups", :labels => { "site" => "dublin" } },
- "switch1" => { :address => "184.104.226.97", :module => "if_mib", :labels => { "site" => "dublin" } }
+ "pdu1" => { :address => "10.0.64.100", :modules => ["apcups"], :labels => { "site" => "dublin" } },
+ "pdu2" => { :address => "10.0.64.101", :modules => ["apcups"], :labels => { "site" => "dublin" } },
+ "switch1" => { :address => "184.104.226.97", :modules => ["if_mib"], :labels => { "site" => "dublin" } }
},
:metrics => {
:uplink_interface => {
},
:prometheus => {
:snmp => {
- "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" } }
+ "pdu1" => { :address => "10.0.48.100", :modules => ["apcups"], :labels => { "site" => "amsterdam" } },
+ "pdu2" => { :address => "10.0.48.101", :modules => ["apcups"], :labels => { "site" => "amsterdam" } },
+ "switch1" => { :address => "130.117.76.2", :modules => ["if_mib"], :labels => { "site" => "amsterdam" } }
},
:metrics => {
:uplink_interface => {