Commit e0172c8ca7ed794462e09e2924077a6449dc196e

Authored by Antonio Terceiro
1 parent 302ba989

munin: display environment name in host group

Rakefile
... ... @@ -53,6 +53,7 @@ ips ||= YAML.load_file(ips_file)
53 53 config ||= YAML.load_file(config_file)
54 54 firewall ||= File.open(iptables_file).read
55 55 $nodes.each do |node|
  56 + node.data['environment'] = $SPB_ENV
56 57 node.data['config'] = config
57 58 node.data['peers'] = ips
58 59 node.data['firewall'] = firewall
... ...
cookbooks/munin/templates/hosts.conf.erb
1 1 <% node['peers'].each do |hostname,ip| %>
2   -[<%= hostname %>]
  2 +[SPB_<%= node['environment'] %>;<%= hostname %>]
3 3 address <%= ip %>
4 4 <% end %>
... ...
monitoring/Rakefile
... ... @@ -11,5 +11,6 @@ require &#39;chake&#39;
11 11  
12 12 ips = YAML.load_file('config/prod/ips.yaml')
13 13 $nodes.each do |node|
  14 + node.data['environment'] = 'prod'
14 15 node.data['peers'] = ips
15 16 end
... ...