Merge "Fix proxy node in newton/mitaka models"
diff --git a/classes/cluster/virtual-mcp11-contrail/stacklight/init.yml b/classes/cluster/virtual-mcp11-contrail/stacklight/init.yml
index f74b8c1..18c364e 100755
--- a/classes/cluster/virtual-mcp11-contrail/stacklight/init.yml
+++ b/classes/cluster/virtual-mcp11-contrail/stacklight/init.yml
@@ -8,6 +8,7 @@
     stacklight_telemetry_address: ${_param:stacklight_monitor_address}
     stacklight_telemetry_node01_address: ${_param:stacklight_monitor_node01_address}
     prometheus_control_address: ${_param:stacklight_monitor_address}
+    heka_elasticsearch_host: ${_param:stacklight_monitor_address}
     elasticsearch_port: 9200
     stacklight_environment: ${_param:cluster_domain}
     stacklight_notification_topic: stacklight_notifications
diff --git a/classes/cluster/virtual-mcp11-contrail/stacklight/server.yml b/classes/cluster/virtual-mcp11-contrail/stacklight/server.yml
index f7fb72d..818e360 100755
--- a/classes/cluster/virtual-mcp11-contrail/stacklight/server.yml
+++ b/classes/cluster/virtual-mcp11-contrail/stacklight/server.yml
@@ -5,6 +5,10 @@
 - system.linux.system.repo.mcp.apt_mirantis.elastic
 - system.linux.system.repo.mcp.apt_mirantis.kibana
 - system.linux.system.repo.docker
+- system.heka.remote_collector.container
+- system.heka.remote_collector.input.amqp
+- system.heka.remote_collector.output.elasticsearch
+- system.heka.remote_collector.output.telegraf
 - system.elasticsearch.server.cluster
 - system.elasticsearch.server.curator
 - system.kibana.server.single
@@ -22,10 +26,12 @@
 - system.prometheus.server.alertmanager.dns
 - system.prometheus.server.target.dns
 - system.docker.swarm.stack.monitoring
+- system.docker.swarm.stack.monitoring.remote_collector
 - system.docker.swarm.stack.dashboard
 - cluster.virtual-mcp11-contrail
 parameters:
   _param:
+    heka_amqp_host: ${_param:openstack_control_address}
     kibana_elasticsearch_host: ${_param:stacklight_monitor_address}
     keepalived_prometheus_vip_address: ${_param:stacklight_monitor_address}
     keepalived_prometheus_vip_password: 'password'
@@ -45,6 +51,7 @@
     docker_image_prometheus: docker-prod-virtual.docker.mirantis.net/openstack-docker/prometheus:latest
     docker_image_remote_agent: docker-prod-virtual.docker.mirantis.net/openstack-docker/telegraf:latest
     docker_image_remote_storage_adapter: docker-prod-virtual.docker.mirantis.net/openstack-docker/remote_storage_adapter:latest
+    docker_image_remote_collector: docker-prod-virtual.docker.mirantis.net/openstack-docker/heka:latest
     docker_image_prometheus_relay: docker-prod-virtual.docker.mirantis.net/openstack-docker/prometheus_relay:latest
     docker_image_grafana: grafana/grafana:4.5.2
     influxdb_port: 8086
@@ -54,6 +61,7 @@
     prometheus_influxdb_db: prometheus
     prometheus_influxdb_username: lma
     prometheus_influxdb_password: ${_param:influxdb_stacklight_password}
+    remote_collector_telegraf_host: monitoring_remote_agent
   linux:
     network:
       interface:
diff --git a/classes/cluster/virtual-mcp11-dvr/stacklight/init.yml b/classes/cluster/virtual-mcp11-dvr/stacklight/init.yml
index 19addd9..5a6373e 100644
--- a/classes/cluster/virtual-mcp11-dvr/stacklight/init.yml
+++ b/classes/cluster/virtual-mcp11-dvr/stacklight/init.yml
@@ -12,6 +12,7 @@
     stacklight_telemetry_address: ${_param:stacklight_monitor_address}
     stacklight_telemetry_node01_address: ${_param:stacklight_monitor_node01_address}
     prometheus_control_address: ${_param:stacklight_monitor_address}
+    heka_elasticsearch_host: ${_param:stacklight_monitor_address}
     elasticsearch_port: 9200
     stacklight_environment: ${_param:cluster_domain}
     stacklight_notification_topic: stacklight_notifications
diff --git a/classes/cluster/virtual-mcp11-dvr/stacklight/server.yml b/classes/cluster/virtual-mcp11-dvr/stacklight/server.yml
index b469f84..d151d16 100644
--- a/classes/cluster/virtual-mcp11-dvr/stacklight/server.yml
+++ b/classes/cluster/virtual-mcp11-dvr/stacklight/server.yml
@@ -5,6 +5,10 @@
 - system.linux.system.repo.mcp.apt_mirantis.elastic
 - system.linux.system.repo.mcp.apt_mirantis.kibana
 - system.linux.system.repo.docker
+- system.heka.remote_collector.container
+- system.heka.remote_collector.input.amqp
+- system.heka.remote_collector.output.elasticsearch
+- system.heka.remote_collector.output.telegraf
 - system.elasticsearch.server.cluster
 - system.elasticsearch.server.curator
 - system.kibana.server.single
@@ -22,10 +26,12 @@
 - system.prometheus.server.alertmanager.dns
 - system.prometheus.server.target.dns
 - system.docker.swarm.stack.monitoring
+- system.docker.swarm.stack.monitoring.remote_collector
 - system.docker.swarm.stack.dashboard
 - cluster.virtual-mcp11-dvr
 parameters:
   _param:
+    heka_amqp_host: ${_param:openstack_control_address}
     kibana_elasticsearch_host: ${_param:stacklight_monitor_address}
     keepalived_prometheus_vip_address: ${_param:stacklight_monitor_address}
     keepalived_prometheus_vip_password: 'password'
@@ -45,6 +51,7 @@
     docker_image_prometheus: docker-prod-virtual.docker.mirantis.net/openstack-docker/prometheus:latest
     docker_image_remote_agent: docker-prod-virtual.docker.mirantis.net/openstack-docker/telegraf:latest
     docker_image_remote_storage_adapter: docker-prod-virtual.docker.mirantis.net/openstack-docker/remote_storage_adapter:latest
+    docker_image_remote_collector: docker-prod-virtual.docker.mirantis.net/openstack-docker/heka:latest
     docker_image_prometheus_relay: docker-prod-virtual.docker.mirantis.net/openstack-docker/prometheus_relay:latest
     docker_image_grafana: grafana/grafana:4.5.2
     influxdb_port: 8086
@@ -54,6 +61,7 @@
     prometheus_influxdb_db: prometheus
     prometheus_influxdb_username: lma
     prometheus_influxdb_password: ${_param:influxdb_stacklight_password}
+    remote_collector_telegraf_host: monitoring_remote_agent
   linux:
     network:
       interface:
diff --git a/scripts/stacklightv2_infra_install.sh b/scripts/stacklightv2_infra_install.sh
index e944aaf..0caab9b 100755
--- a/scripts/stacklightv2_infra_install.sh
+++ b/scripts/stacklightv2_infra_install.sh
@@ -41,6 +41,9 @@
 # Generate the configuration for prometheus running in Docker Swarm
 salt -C 'I@docker:swarm' state.sls prometheus -b 1
 
+# Generate the configuration for remote_collector running in Docker Swarm
+salt -C 'I@docker:swarm' state.sls heka.remote_collector -b 1
+
 # Kick off the services in Docker Swarm
 salt -C 'I@docker:swarm:role:master' state.sls docker
 salt -C 'I@docker:swarm' dockerng.ps