From e0172c8ca7ed794462e09e2924077a6449dc196e Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Thu, 13 Aug 2015 14:26:57 -0300 Subject: [PATCH] munin: display environment name in host group --- Rakefile | 1 + cookbooks/munin/templates/hosts.conf.erb | 2 +- monitoring/Rakefile | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 61aa00d..9cfa569 100644 --- a/Rakefile +++ b/Rakefile @@ -53,6 +53,7 @@ ips ||= YAML.load_file(ips_file) config ||= YAML.load_file(config_file) firewall ||= File.open(iptables_file).read $nodes.each do |node| + node.data['environment'] = $SPB_ENV node.data['config'] = config node.data['peers'] = ips node.data['firewall'] = firewall diff --git a/cookbooks/munin/templates/hosts.conf.erb b/cookbooks/munin/templates/hosts.conf.erb index 8b6c0d7..ab6dda6 100644 --- a/cookbooks/munin/templates/hosts.conf.erb +++ b/cookbooks/munin/templates/hosts.conf.erb @@ -1,4 +1,4 @@ <% node['peers'].each do |hostname,ip| %> -[<%= hostname %>] +[SPB_<%= node['environment'] %>;<%= hostname %>] address <%= ip %> <% end %> diff --git a/monitoring/Rakefile b/monitoring/Rakefile index 6cee833..a20de46 100644 --- a/monitoring/Rakefile +++ b/monitoring/Rakefile @@ -11,5 +11,6 @@ require 'chake' ips = YAML.load_file('config/prod/ips.yaml') $nodes.each do |node| + node.data['environment'] = 'prod' node.data['peers'] = ips end -- libgit2 0.21.2