From 5952da135c599cd7c855c64bc1b96bfe539a1cd7 Mon Sep 17 00:00:00 2001 From: Rowan Powell <rp17@it-innovation.soton.ac.uk> Date: Tue, 30 Jan 2018 13:39:38 +0000 Subject: [PATCH] Chaching - Please don't use this commit --- Vagrantfile | 66 ++++++++++++------- .../influx/telegraf_ipendpoint_template.conf | 21 ------ 2 files changed, 42 insertions(+), 45 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 7e6c3e1..e7b2319 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,50 +25,51 @@ # Define ipendpoint configuration parameters ipendpoints = { - "ipendpoint1" => { + "apache1" => { :ip_address => "192.168.50.11", :location => "DC1", :sfc_id => "MS_Template_1", :sfc_id_instance => "MS_I1", :sf_id => "adaptive_streaming", :sf_id_instance => "adaptive_streaming_I1", - :ipendpoint_id => "adaptive_streaming_I1_ipendpoint1", + :ipendpoint_id => "adaptive_streaming_I1_apache1", :influxdb_url => "http://192.168.50.10:8086", :database_name => "CLMCMetrics" }, - "ipendpoint2" => { + "apache2" => { :ip_address => "192.168.50.12", :location => "DC2", :sfc_id => "MS_Template_1", :sfc_id_instance => "MS_I1", :sf_id => "adaptive_streaming", :sf_id_instance => "adaptive_streaming_I1", - :ipendpoint_id => "adaptive_streaming_I1_ipendpoint2", + :ipendpoint_id => "adaptive_streaming_I1_apache2", :influxdb_url => "http://192.168.50.10:8086", :database_name => "CLMCMetrics" }, - "NGINXEndpoint" => { + "nginx1" => { :ip_address => "192.168.50.13", - :location => "DC2", + :location => "DC1", :sfc_id => "MS_Template_1", :sfc_id_instance => "MS_I1", - :sf_id => "NGINX", - :sf_id_instance => "NGINX_I1", - :ipendpoint_id => "NGINX_I1_NGINXEndpoint", + :sf_id => "adaptive_streaming", + :sf_id_instance => "adaptive_streaming_nginx_I1", + :ipendpoint_id => "adaptive_streaming_nginx_I1_apache1", :influxdb_url => "http://192.168.50.10:8086", - :database_name => "CLMCMetrics" + :database_name => "CLMCMetrics" }, - "MONGOEndpoint" => { + "mongo1" => { :ip_address => "192.168.50.14", - :location => "DC2", + :location => "DC1", :sfc_id => "MS_Template_1", :sfc_id_instance => "MS_I1", - :sf_id => "MONGO", - :sf_id_instance => "MONGO_I1", - :ipendpoint_id => "MONGO_I1_MONGOEndpoint", + :sf_id => "metadata_database", + :sf_id_instance => "metadata_database_I1", + :ipendpoint_id => "metadata_database_I1_apache1", :influxdb_url => "http://192.168.50.10:8086", :database_name => "CLMCMetrics" } + } Vagrant.configure("2") do |config| @@ -99,8 +100,8 @@ Vagrant.configure("2") do |config| config.vm.provision :shell, :path => 'scripts/influx/start-clmc-service.sh' end # Apache Server 1 - config.vm.define "ipendpoint1" do |my| - config.vm.network :private_network, ip: "#{ipendpoints['ipendpoint1'][:ip_address]}", virtualbox__intnet: "clmc-net" + config.vm.define "apache1" do |my| + config.vm.network :private_network, ip: "#{ipendpoints['apache1'][:ip_address]}", virtualbox__intnet: "clmc-net" my.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", 512] @@ -114,12 +115,12 @@ Vagrant.configure("2") do |config| config.vm.provision :shell, :path => 'scripts/apache/install-apache.sh' # Install CLMC agent 1 - config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/influx/telegraf_ipendpoint_template.conf #{ipendpoints['ipendpoint1'][:location]} #{ipendpoints['ipendpoint1'][:sfc_id]} #{ipendpoints['ipendpoint1'][:sfc_id_instance]} #{ipendpoints['ipendpoint1'][:sf_id]} #{ipendpoints['ipendpoint1'][:sf_id_instance]} #{ipendpoints['ipendpoint1'][:ipendpoint_id]} #{ipendpoints['ipendpoint1'][:influxdb_url]} #{ipendpoints['ipendpoint1'][:database_name]}" + config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/apache/telegraf_apache_template.conf #{ipendpoints['apache1'][:location]} #{ipendpoints['apache1'][:sfc_id]} #{ipendpoints['apache1'][:sfc_id_instance]} #{ipendpoints['apache1'][:sf_id]} #{ipendpoints['apache1'][:sf_id_instance]} #{ipendpoints['apache1'][:ipendpoint_id]} #{ipendpoints['apache1'][:influxdb_url]} #{ipendpoints['apache1'][:database_name]}" end # Apache Server 2 - config.vm.define "ipendpoint2" do |my| + config.vm.define "apache2" do |my| - config.vm.network :private_network, ip: "#{ipendpoints['ipendpoint2'][:ip_address]}", virtualbox__intnet: "clmc-net" + config.vm.network :private_network, ip: "#{ipendpoints['apache2'][:ip_address]}", virtualbox__intnet: "clmc-net" my.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", 512] @@ -133,14 +134,14 @@ Vagrant.configure("2") do |config| config.vm.provision :shell, :path => 'scripts/apache/install-apache.sh' # Install CLMC agent - config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/influx/telegraf_ipendpoint_template.conf #{ipendpoints['ipendpoint2'][:location]} #{ipendpoints['ipendpoint2'][:sfc_id]} #{ipendpoints['ipendpoint2'][:sfc_id_instance]} #{ipendpoints['ipendpoint2'][:sf_id]} #{ipendpoints['ipendpoint2'][:sf_id_instance]} #{ipendpoints['ipendpoint2'][:ipendpoint_id]} #{ipendpoints['ipendpoint2'][:influxdb_url]} #{ipendpoints['ipendpoint2'][:database_name]}" + config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/apache/telegraf_apache_template.conf #{ipendpoints['apache2'][:location]} #{ipendpoints['apache2'][:sfc_id]} #{ipendpoints['apache2'][:sfc_id_instance]} #{ipendpoints['apache2'][:sf_id]} #{ipendpoints['apache2'][:sf_id_instance]} #{ipendpoints['apache2'][:ipendpoint_id]} #{ipendpoints['apache2'][:influxdb_url]} #{ipendpoints['apache2'][:database_name]}" end # NGINX VM config.vm.define "NGINX_Service" do |my| - config.vm.network :private_network, ip: "#{ipendpoints['NGINXEndpoint'][:ip_address]}", virtualbox__intnet: "clmc-net" + config.vm.network :private_network, ip: "#{ipendpoints['nginx1'][:ip_address]}", virtualbox__intnet: "clmc-net" my.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", 512] @@ -154,10 +155,27 @@ Vagrant.configure("2") do |config| config.vm.provision :shell, :path => 'scripts/apache/install-nginx.sh' # Install CLMC agent - config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/influx/telegraf_ipendpoint_template.conf #{ipendpoints['NGINXEndpoint'][:location]} #{ipendpoints['ipendpoint2'][:sfc_id]} #{ipendpoints['NGINXEndpoint'][:sfc_id_instance]} #{ipendpoints['NGINXEndpoint'][:sf_id]} #{ipendpoints['NGINXEndpoint'][:sf_id_instance]} #{ipendpoints['NGINXEndpoint'][:ipendpoint_id]} #{ipendpoints['NGINXEndpoint'][:influxdb_url]} #{ipendpoints['NGINXEndpoint'][:database_name]}" + config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/nginx/telegraf_nginx_template.conf #{ipendpoints['nginx1'][:location]} #{ipendpoints['nginx1'][:sfc_id]} #{ipendpoints['nginx1'][:sfc_id_instance]} #{ipendpoints['nginx1'][:sf_id]} #{ipendpoints['nginx1'][:sf_id_instance]} #{ipendpoints['nginx1'][:ipendpoint_id]} #{ipendpoints['nginx1'][:influxdb_url]} #{ipendpoints['nginx1'][:database_name]}" end # MONGODB VM - + config.vm.define "MONGO_Service" do |my| + + config.vm.network :private_network, ip: "#{ipendpoints['mongo1'][:ip_address]}", virtualbox__intnet: "clmc-net" + + my.vm.provider "virtualbox" do |v| + v.customize ["modifyvm", :id, "--memory", 512] + v.customize ["modifyvm", :id, "--cpus", 1] + end + + # open apache port + config.vm.network "forwarded_port", guest: 80, host: 8081 + + # install the apache service + config.vm.provision :shell, :path => 'scripts/apache/install-mongo.sh' + + # Install CLMC agent + config.vm.provision :shell, :path => 'scripts/influx/install-clmc-agent.sh', :args => "/vagrant/scripts/mongo/telegraf_mongo_template.conf #{ipendpoints['mongo1'][:location]} #{ipendpoints['mongo1'][:sfc_id]} #{ipendpoints['mongo1'][:sfc_id_instance]} #{ipendpoints['mongo1'][:sf_id]} #{ipendpoints['mongo1'][:sf_id_instance]} #{ipendpoints['mongo1'][:ipendpoint_id]} #{ipendpoints['mongo1'][:influxdb_url]} #{ipendpoints['mongo1'][:database_name]}" + end end diff --git a/scripts/influx/telegraf_ipendpoint_template.conf b/scripts/influx/telegraf_ipendpoint_template.conf index 99f3349..2358dcc 100644 --- a/scripts/influx/telegraf_ipendpoint_template.conf +++ b/scripts/influx/telegraf_ipendpoint_template.conf @@ -110,24 +110,3 @@ ## MTLS #tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"] - -# Read Apache status information (mod_status) -[[inputs.apache]] - ## An array of URLs to gather from, must be directed at the machine - ## readable version of the mod_status page including the auto query string. - ## Default is "http://localhost/server-status?auto". - urls = ["http://localhost/server-status?auto"] - - ## Credentials for basic HTTP authentication. - # username = "myuser" - # password = "mypassword" - - ## Maximum time to receive response. - # response_timeout = "5s" - - ## Optional SSL Config - # ssl_ca = "/etc/telegraf/ca.pem" - # ssl_cert = "/etc/telegraf/cert.pem" - # ssl_key = "/etc/telegraf/key.pem" - ## Use SSL but skip chain & host verification - # insecure_skip_verify = false \ No newline at end of file -- GitLab