chef/cookbooks/monasca/templates/default/monasca-reconfigure-server.erb
#!/bin/sh
set -e
# This script is a monasca-setup wrapper that configures monasca-agent on the
# monasca-server node. On the monasca-server node chef will _not_ touch the
# agent configuration directly. Instead, it will run this script.
run_setup()
{
/usr/bin/monasca-setup \
-u '<%= @agent_keystone["service_user"] %>' \
-p '<%= @agent_keystone["service_password"] %>' \
--project_name '<%= @agent_keystone["service_tenant"] %>' \
<% if defined?(@service) -%> --service '<%= @service %>' <% end -%> \
--keystone_url '<%= @keystone_settings["admin_auth_url"] %>/v3' \
--monasca_url '<%= @monasca_api_url %>' \
--user_domain_name Default \
--project_domain_name Default \
--user '<%= @agent_settings["user"] %>' \
--dimensions '<%= @agent_dimensions.map{|k,v| "#{k}:#{v}"}.join(',') %>' \
--insecure '<%= @agent_settings["insecure"] %>' \
<% if @agent_settings["ca_file"].length > 0 -%> --ca_file '<%= @agent_settings["ca_file"] %>' <% end -%> \
--log_dir '<%= @agent_settings["log_dir"] %>' \
--log_level '<%= @agent_settings["log_level"] %>' \
--monasca_statsd_port '<%= @agent_settings["statsd_port"].to_i %>' \
--check_frequency '<%= @agent_settings["check_frequency"].to_i %>' \
--num_collector_threads '<%= @agent_settings["num_collector_threads"].to_i %>' \
--pool_full_max_retries '<%= @agent_settings["pool_full_max_retries"].to_i %>' \
--plugin_collect_time_warn '<%= @agent_settings["plugin_collect_time_warn"].to_i %>' \
--max_measurement_buffer_size '<%= @agent_settings["max_measurement_buffer_size"].to_i %>' \
--backlog_send_rate '<%= @agent_settings["backlog_send_rate"].to_i %>' \
--amplifier '<%= @agent_settings["amplifier"] %>' \
--skip_enable \
--agent_service_name '<%= @agent_settings["agent_service_name"].gsub(/\.target$/, '') %>' \
--skip_detection_plugins ovs \
"$@"
}
# Run full detection
run_setup