Skip to content
Snippets Groups Projects
Commit 8df5a32e authored by Stephen C Phillips's avatar Stephen C Phillips
Browse files

Removes unused telegraf config script

parent 4db042ef
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
#/////////////////////////////////////////////////////////////////////////
#//
#// (c) University of Southampton IT Innovation Centre, 2017
#//
#// Copyright in this software belongs to University of Southampton
#// IT Innovation Centre of Gamma House, Enterprise Road,
#// Chilworth Science Park, Southampton, SO16 7NS, UK.
#//
#// This software may not be used, sold, licensed, transferred, copied
#// or reproduced in whole or in part in any manner or form or in or
#// on any media by any person other than in accordance with the terms
#// of the Licence Agreement supplied with the software, or otherwise
#// without the prior written consent of the copyright owners.
#//
#// This software is distributed WITHOUT ANY WARRANTY, without even the
#// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#// PURPOSE, except where stated in the Licence Agreement supplied with
#// the software.
#//
#// Created By : Michael Boniface
#// Created Date : 18/12/2017
#// Created for Project : FLAME
#//
#/////////////////////////////////////////////////////////////////////////
TELEGRAF_CONF_DIR="/etc/telegraf"
TELEGRAF_CONF_FILE=$TELEGRAF_CONF_DIR"/telegraf.conf"
TELEGRAF_INCLUDE_CONF_DIR=$TELEGRAF_CONF_DIR"/telegraf.d"
TELEGRAF_OUTPUT_CONF_FILE=$TELEGRAF_INCLUDE_CONF_DIR"/telegraf_output.conf"
echo "Checking Telegraf installation"
# Check the target telegraf directory exists
if [ ! -d "$TELEGRAF_CONF_DIR" ]; then
echo "Error: Telegraf conf directory does not exist on target machine. Check that telegraf is installed "$TELEGRAF_CONF_DIR
exit 1
fi
# Check the target telegraf directory exists
if [ ! -d $TELEGRAF_INCLUDE_CONF_DIR ]; then
echo "Error: Telegraf conf include directory does not exist on target machine. Check that telegraf is installed "$TELEGRAF_INCLUDE_CONF_DIR
exit 1
fi
# Copy configuration
echo "Telegraf general config file: " $TELEGRAF_CONF_FILE
(cat <<'EOF'
[global_tags]
location="$LOCATION"
sfc="$SFC_ID"
sfc_i="$SFC_ID_INSTANCE"
sf="$SF_ID"
sf_i="$SF_ID_INSTANCE"
ipendpoint="$IP_ENDPOINT_ID"
sr="$SR_ID"
[agent]
interval = "10s"
round_interval = true
metric_buffer_limit = 1000
flush_buffer_when_full = true
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
debug = false
quiet = false
logfile = "/var/log/telegraf/telegraf.log"
hostname = ""
EOF
) > $TELEGRAF_CONF_FILE
echo "Telegraf output config file: " $TELEGRAF_OUTPUT_CONF_FILE
(cat <<'EOF'
[[outputs.influxdb]]
urls = ["$INFLUXDB_URL"]
database = "$DATABASE_NAME"
precision = "s"
timeout = "5s"
EOF
) > $TELEGRAF_OUTPUT_CONF_FILE
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