Skip to content
Snippets Groups Projects
Commit df5a8c3b authored by MJB's avatar MJB
Browse files

Added sr tag to the telegraf agent #69

parent 9c1e20cb
No related branches found
No related tags found
No related merge requests found
...@@ -114,7 +114,7 @@ Vagrant.configure("2") do |config| ...@@ -114,7 +114,7 @@ Vagrant.configure("2") do |config|
# CLMC agent general and output configuration # CLMC agent general and output configuration
#instance_config.vm.provision :shell, :path => "scripts/clmc-agent/configure_template.sh" #instance_config.vm.provision :shell, :path => "scripts/clmc-agent/configure_template.sh"
instance_config.vm.provision :shell, :path => "scripts/clmc-agent/configure.sh", :args => "#{host["location"]} #{host["sfc_id"]} #{host["sfc_id_instance"]} #{host["sf_id"]} #{host["sf_id_instance"]} #{host["ipendpoint_id"]} #{host["influxdb_url"]} #{host["database_name"]}" instance_config.vm.provision :shell, :path => "scripts/clmc-agent/configure.sh", :args => "#{host["location"]} #{host["sfc_id"]} #{host["sfc_id_instance"]} #{host["sf_id"]} #{host["sf_id_instance"]} #{host["ipendpoint_id"]} #{host["sr_id"]} #{host["influxdb_url"]} #{host["database_name"]}"
# CLMC start agent # CLMC start agent
instance_config.vm.provision :shell, inline: "service telegraf restart" instance_config.vm.provision :shell, inline: "service telegraf restart"
......
...@@ -47,6 +47,7 @@ hosts: ...@@ -47,6 +47,7 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_apache1" ipendpoint_id: "adaptive_streaming_I1_apache1"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: nginx - name: nginx
...@@ -64,6 +65,7 @@ hosts: ...@@ -64,6 +65,7 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_nginx_I1" sf_id_instance: "adaptive_streaming_nginx_I1"
ipendpoint_id: "adaptive_streaming_nginx_I1_apache1" ipendpoint_id: "adaptive_streaming_nginx_I1_apache1"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: mongo - name: mongo
...@@ -81,6 +83,7 @@ hosts: ...@@ -81,6 +83,7 @@ hosts:
sf_id: "metadata_database" sf_id: "metadata_database"
sf_id_instance: "metadata_database_I1" sf_id_instance: "metadata_database_I1"
ipendpoint_id: "metadata_database_I1_apache1" ipendpoint_id: "metadata_database_I1_apache1"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: ffmpeg - name: ffmpeg
...@@ -98,6 +101,7 @@ hosts: ...@@ -98,6 +101,7 @@ hosts:
sf_id: "metadata_database" sf_id: "metadata_database"
sf_id_instance: "metadata_database_I1" sf_id_instance: "metadata_database_I1"
ipendpoint_id: "metadata_database_I1_apache1" ipendpoint_id: "metadata_database_I1_apache1"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: host - name: host
...@@ -115,11 +119,12 @@ hosts: ...@@ -115,11 +119,12 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_apache1" ipendpoint_id: "adaptive_streaming_I1_apache1"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: test-runner - name: test-runner
cpus: 1 cpus: 2
memory: 2048 memory: 4096
disk: "10GB" disk: "10GB"
ip_address: "172.40.231.200" ip_address: "172.40.231.200"
- name: minio - name: minio
...@@ -137,5 +142,6 @@ hosts: ...@@ -137,5 +142,6 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_minio" ipendpoint_id: "adaptive_streaming_I1_minio"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
\ No newline at end of file
...@@ -47,6 +47,7 @@ hosts: ...@@ -47,6 +47,7 @@ hosts:
sf_id: "test-sf-clmc-agent-build" sf_id: "test-sf-clmc-agent-build"
sf_id_instance: "ms-A.ict-flame.eu" sf_id_instance: "ms-A.ict-flame.eu"
ipendpoint_id: "endpoint1.ms-A.ict-flame.eu" ipendpoint_id: "endpoint1.ms-A.ict-flame.eu"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: ipendpoint2 - name: ipendpoint2
...@@ -64,6 +65,7 @@ hosts: ...@@ -64,6 +65,7 @@ hosts:
sf_id: "test-sf-clmc-agent-build" sf_id: "test-sf-clmc-agent-build"
sf_id_instance: "ms-A.ict-flame.eu" sf_id_instance: "ms-A.ict-flame.eu"
ipendpoint_id: "endpoint2.ms-A.ict-flame.eu" ipendpoint_id: "endpoint2.ms-A.ict-flame.eu"
sr_id: "service_router"
influxdb_url: "http://172.40.231.51:8086" influxdb_url: "http://172.40.231.51:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: test-runner - name: test-runner
......
...@@ -47,6 +47,7 @@ hosts: ...@@ -47,6 +47,7 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_nginx1" ipendpoint_id: "adaptive_streaming_I1_nginx1"
sr_id: "service_router"
influxdb_url: "http://192.168.50.10:8086" influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: nginx2 - name: nginx2
...@@ -64,6 +65,7 @@ hosts: ...@@ -64,6 +65,7 @@ hosts:
sf_id: "adaptive_streaming" sf_id: "adaptive_streaming"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_nginx2" ipendpoint_id: "adaptive_streaming_I1_nginx2"
sr_id: "service_router"
influxdb_url: "http://192.168.50.10:8086" influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
- name: loadtest-streaming - name: loadtest-streaming
...@@ -81,5 +83,6 @@ hosts: ...@@ -81,5 +83,6 @@ hosts:
sf_id: "adaptive_streaming_client" sf_id: "adaptive_streaming_client"
sf_id_instance: "adaptive_streaming_I1" sf_id_instance: "adaptive_streaming_I1"
ipendpoint_id: "adaptive_streaming_I1_client1" ipendpoint_id: "adaptive_streaming_I1_client1"
sr_id: "service_router"
influxdb_url: "http://192.168.50.10:8086" influxdb_url: "http://192.168.50.10:8086"
database_name: "CLMCMetrics" database_name: "CLMCMetrics"
...@@ -30,10 +30,10 @@ set -euo pipefail ...@@ -30,10 +30,10 @@ set -euo pipefail
echo "Configuring Telegraf agent general and output configuration" echo "Configuring Telegraf agent general and output configuration"
# Get command line parameters # Get command line parameters
if [ "$#" -ne 8 ]; then if [ "$#" -ne 9 ]; then
echo "Error: illegal number of arguments: "$# echo "Error: illegal number of arguments: "$#
echo "Usage: configure.sh LOCATION SFC_ID SFC_ID_INSTANCE SF_ID SF_ID_INSTANCE IP_ENDPOINT_ID INFLUXDB_URL DATABASE_NAME" echo "Usage: configure.sh LOCATION SFC_ID SFC_ID_INSTANCE SF_ID SF_ID_INSTANCE IP_ENDPOINT_ID SR_ID INFLUXDB_URL DATABASE_NAME"
exit 1 exit 1
fi fi
LOCATION=$1 LOCATION=$1
...@@ -42,14 +42,17 @@ SFC_ID_INSTANCE=$3 ...@@ -42,14 +42,17 @@ SFC_ID_INSTANCE=$3
SF_ID=$4 SF_ID=$4
SF_ID_INSTANCE=$5 SF_ID_INSTANCE=$5
IP_ENDPOINT_ID=$6 IP_ENDPOINT_ID=$6
INFLUXDB_URL=$7 SR_ID=$7
DATABASE_NAME=$8 INFLUXDB_URL=$8
DATABASE_NAME=$9
TELEGRAF_CONF_DIR="/etc/telegraf" TELEGRAF_CONF_DIR="/etc/telegraf"
TELEGRAF_CONF_FILE=$TELEGRAF_CONF_DIR"/telegraf.conf" TELEGRAF_CONF_FILE=$TELEGRAF_CONF_DIR"/telegraf.conf"
TELEGRAF_INCLUDE_CONF_DIR=$TELEGRAF_CONF_DIR"/telegraf.d" TELEGRAF_INCLUDE_CONF_DIR=$TELEGRAF_CONF_DIR"/telegraf.d"
TELEGRAF_OUTPUT_CONF_FILE=$TELEGRAF_INCLUDE_CONF_DIR"/telegraf_output.conf" TELEGRAF_OUTPUT_CONF_FILE=$TELEGRAF_INCLUDE_CONF_DIR"/telegraf_output.conf"
cat TELEGRAF_OUTPUT_CONF_FILE
# Replace template parameters on general configuration # Replace template parameters on general configuration
sed -i 's/$LOCATION/'$LOCATION'/g' $TELEGRAF_CONF_FILE sed -i 's/$LOCATION/'$LOCATION'/g' $TELEGRAF_CONF_FILE
sed -i 's/$SFC_ID/'$SFC_ID'/g' $TELEGRAF_CONF_FILE sed -i 's/$SFC_ID/'$SFC_ID'/g' $TELEGRAF_CONF_FILE
...@@ -57,6 +60,7 @@ sed -i 's/$SFC_ID_INSTANCE/'$SFC_ID_INSTANCE'/g' $TELEGRAF_CONF_FILE ...@@ -57,6 +60,7 @@ sed -i 's/$SFC_ID_INSTANCE/'$SFC_ID_INSTANCE'/g' $TELEGRAF_CONF_FILE
sed -i 's/$SF_ID/'$SF_ID'/g' /etc/telegraf/telegraf.conf sed -i 's/$SF_ID/'$SF_ID'/g' /etc/telegraf/telegraf.conf
sed -i 's/$SF_ID_INSTANCE}}/'$SF_ID_INSTANCE'/g' $TELEGRAF_CONF_FILE sed -i 's/$SF_ID_INSTANCE}}/'$SF_ID_INSTANCE'/g' $TELEGRAF_CONF_FILE
sed -i 's/$IP_ENDPOINT_ID/'$IP_ENDPOINT_ID'/g' $TELEGRAF_CONF_FILE sed -i 's/$IP_ENDPOINT_ID/'$IP_ENDPOINT_ID'/g' $TELEGRAF_CONF_FILE
sed -i 's/$SR_ID/'$SR_ID'/g' $TELEGRAF_CONF_FILE
# Replace parameters in output configuration file # Replace parameters in output configuration file
sed -i 's|$INFLUXDB_URL|'$INFLUXDB_URL'|g' $TELEGRAF_OUTPUT_CONF_FILE sed -i 's|$INFLUXDB_URL|'$INFLUXDB_URL'|g' $TELEGRAF_OUTPUT_CONF_FILE
......
...@@ -53,6 +53,7 @@ echo "Telegraf general config file: " $TELEGRAF_CONF_FILE ...@@ -53,6 +53,7 @@ echo "Telegraf general config file: " $TELEGRAF_CONF_FILE
sf="$SF_ID" sf="$SF_ID"
sf_i="$SF_ID_INSTANCE" sf_i="$SF_ID_INSTANCE"
ipendpoint="$IP_ENDPOINT_ID" ipendpoint="$IP_ENDPOINT_ID"
sr="$SR_ID"
[agent] [agent]
interval = "10s" interval = "10s"
round_interval = true round_interval = true
......
...@@ -42,10 +42,6 @@ if [ ! -f ${REPO_ROOT}/reporc ]; then ...@@ -42,10 +42,6 @@ if [ ! -f ${REPO_ROOT}/reporc ]; then
fi fi
source ${REPO_ROOT}/reporc source ${REPO_ROOT}/reporc
echo "Setting the envrionemtn variables"
echo "USER: ${REPO_USER}"
echo "PASS: ${REPO_PASS}"
wget --user ${REPO_USER} --password ${REPO_PASS} https://flame-nexus.it-innovation.soton.ac.uk/repository/flame-general/it-innovation/telegraf/${TELEGRAF_VERSION}/telegraf-${TELEGRAF_VERSION}.deb -O telegraf-${TELEGRAF_VERSION}.deb wget --user ${REPO_USER} --password ${REPO_PASS} https://flame-nexus.it-innovation.soton.ac.uk/repository/flame-general/it-innovation/telegraf/${TELEGRAF_VERSION}/telegraf-${TELEGRAF_VERSION}.deb -O telegraf-${TELEGRAF_VERSION}.deb
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
sf_i="$SF_ID_INSTANCE" sf_i="$SF_ID_INSTANCE"
# ipendpoint id aka surrogate instance # ipendpoint id aka surrogate instance
ipendpoint="$IP_ENDPOINT_ID" ipendpoint="$IP_ENDPOINT_ID"
# the service router providing access to the network
sr="$SR_ID"
# Configuration for telegraf agent # Configuration for telegraf agent
[agent] [agent]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment