diff --git a/Vagrantfile b/Vagrantfile index add5135cf5d2ec5a88ec25086b32234666772ee9..e7b2319968c38bf4ea6b9fd42e5294a59634a76d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -25,28 +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" + }, + "nginx1" => { + :ip_address => "192.168.50.13", + :location => "DC1", + :sfc_id => "MS_Template_1", + :sfc_id_instance => "MS_I1", + :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" + }, + "mongo1" => { + :ip_address => "192.168.50.14", + :location => "DC1", + :sfc_id => "MS_Template_1", + :sfc_id_instance => "MS_I1", + :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| @@ -76,9 +99,9 @@ Vagrant.configure("2") do |config| # start the CLMC service config.vm.provision :shell, :path => 'scripts/influx/start-clmc-service.sh' end - - config.vm.define "ipendpoint1" do |my| - config.vm.network :private_network, ip: "#{ipendpoints['ipendpoint1'][:ip_address]}", virtualbox__intnet: "clmc-net" + # Apache Server 1 + 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] @@ -92,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 "apache2" do |my| - config.vm.define "ipendpoint2" 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] @@ -111,6 +134,48 @@ 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['nginx1'][: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-nginx.sh' + + # Install CLMC agent + 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 d291028123acddec2061ec10d0124dcd1195e6ee..2358dcca5bfcd48d4b45e0e1ccd316357f1e4ba7 100644 --- a/scripts/influx/telegraf_ipendpoint_template.conf +++ b/scripts/influx/telegraf_ipendpoint_template.conf @@ -90,15 +90,6 @@ # user_agent = "telegraf" # Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes) # udp_payload = 512 -[[outputs.file]] - ## Files to write to, "stdout" is a specially handled file. - files = ["stdout", "/tmp/metrics.out"] - - ## Data format to output. - ## Each data format has its own unique set of configuration options, read - ## more about them here: - ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md - data_format = "influx" ############################################################################### @@ -119,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