From 87abe0edb968b2d8e5e7c08ca94a0c36ce46de5b Mon Sep 17 00:00:00 2001
From: Rowan Powell <rp17@it-innovation.soton.ac.uk>
Date: Sat, 3 Feb 2018 15:05:44 +0000
Subject: [PATCH] Fixed cp error for nginx config. Fixed install-clmc-agent
 syntax error

---
 scripts/clmc-agent/install-clmc-agent.sh      |  2 +-
 test/services/nginx/install-nginx.sh          |  4 +++-
 .../nginx/telegraf_nginx_template.conf        | 19 ++-----------------
 3 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/scripts/clmc-agent/install-clmc-agent.sh b/scripts/clmc-agent/install-clmc-agent.sh
index ab3d0bd..9626d91 100644
--- a/scripts/clmc-agent/install-clmc-agent.sh
+++ b/scripts/clmc-agent/install-clmc-agent.sh
@@ -41,7 +41,7 @@ IP_ENDPOINT_ID=$7
 INFLUXDB_URL=$8
 DATABASE_NAME=$9
 
-if [ ! -f $TELEGRAF_CONF_FILE]; then
+if [ ! -f $TELEGRAF_CONF_FILE ]; then
     echo "Error: Telegraf conf template file not found: "$TELEGRAF_CONF_FILE
     exit
 fi
diff --git a/test/services/nginx/install-nginx.sh b/test/services/nginx/install-nginx.sh
index 8cecfdf..318996f 100644
--- a/test/services/nginx/install-nginx.sh
+++ b/test/services/nginx/install-nginx.sh
@@ -30,7 +30,8 @@ yes Y | sudo apt-get install nginx
 
 # Need to set up basic stats as this not configured by default
 # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html
-
+echo "Coping new config file into nginx"
+cd /vagrant
 sudo rm ../etc/nginx/nginx.conf
 sudo cp test/services/nginx/nginx.conf ../etc/nginx/nginx.conf
 #cat test/services/nginx/nginx.conf > ../etc/nginx/nginx.conf
@@ -44,6 +45,7 @@ sudo systemctl start nginx
 #nginx -V 2>&1 | grep -o with-http_stub_status_module
 #/vagrant/../etc/nginx/nginx.config
 
+# systemctl status telegraf -l
 
 
 
diff --git a/test/services/nginx/telegraf_nginx_template.conf b/test/services/nginx/telegraf_nginx_template.conf
index 31c97d1..8331ab2 100644
--- a/test/services/nginx/telegraf_nginx_template.conf
+++ b/test/services/nginx/telegraf_nginx_template.conf
@@ -58,7 +58,7 @@
   ## Run telegraf in quiet mode
   quiet = false
   ## Specify the log file name. The empty string means to log to stdout.
-  logfile = "G:/Telegraf/telegraf.log"
+  logfile = "/etc/telegraf/telegraf.log"
 
   ## Override default hostname, if empty use os.Hostname()
   hostname = ""
@@ -91,7 +91,6 @@
   # Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
   # udp_payload = 512
 
-
 ###############################################################################
 #                                  INPUTS                                     #
 ###############################################################################
@@ -104,24 +103,10 @@
   read_timeout = "10s"
   write_timeout = "10s"
 
-  ## HTTPS
-  #tls_cert= "/etc/telegraf/cert.pem"
-  #tls_key = "/etc/telegraf/key.pem"
-
-  ## MTLS
-  #tls_allowed_cacerts = ["/etc/telegraf/clientca.pem"]
-
 # Read Nginx's basic status information (ngx_http_stub_status_module)
 [[inputs.nginx]]
   ## An array of Nginx stub_status URI to gather stats.
-  urls = ["http://localhost/server_status"]
-
-  ## 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
+  urls = ["http://localhost:8083/nginx_status"]
 
   ## HTTP response timeout (default: 5s)
   response_timeout = "5s"
\ No newline at end of file
-- 
GitLab