diff --git a/scripts/clmc-agent/install.sh b/scripts/clmc-agent/install.sh index d82b94450ed6227446432ac230142169416866dc..cf5e4eb84aa78d9a7998f3689f46e97b07348e08 100755 --- a/scripts/clmc-agent/install.sh +++ b/scripts/clmc-agent/install.sh @@ -32,7 +32,7 @@ apt-get install wget -y echo "Installing Telegraf agent" -TELEGRAF_VERSION=1.7.0~5618bb0-0 +TELEGRAF_VERSION=1.8.0~2736fa0-0 TELEGRAF_CHECKSUM=dc24932fa1aef9392582880c077dd2493b9f2c66babd7733a0654540bbb5003b # Install telegraf @@ -48,10 +48,11 @@ source ${REPO_ROOT}/reporc 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 -#sha256sum telegraf_${TELEGRAF_VERSION}_amd64.deb | grep $TELEGRAF_CHECKSUM > /dev/null -#if [ $? == 1 ]; then -# echo "Telegraf download failed checksum" -# exit 1 -#fi dpkg -i telegraf-${TELEGRAF_VERSION}.deb +# add telegraf to run as root for systemctl input plugin +# this should not be required as the "systemctl status" command is available to no priviledged users +# issued raised +sed -i s/User=telegraf/User=root/g /lib/systemd/system/telegraf.service +systemctl daemon-reload +systemctl restart telegraf.service \ No newline at end of file diff --git a/src/test/clmctest/inputs/test_telegraf_agents.py b/src/test/clmctest/inputs/test_telegraf_agents.py index 2358d93d6968f83ad7c0712e7dcce25575df638b..88238eaf62b6292561125fb92a4f67228da360f6 100644 --- a/src/test/clmctest/inputs/test_telegraf_agents.py +++ b/src/test/clmctest/inputs/test_telegraf_agents.py @@ -63,8 +63,9 @@ def test_ping(telegraf_agent_config): ('net', 'SELECT mean("bytes_sent") AS "mean" FROM "CLMCMetrics"."autogen"."net"', 0), ('disk', 'SELECT mean("free") AS "mean" FROM "CLMCMetrics"."autogen"."disk"', 0), ('mem', 'SELECT mean("free") AS "mean" FROM "CLMCMetrics"."autogen"."mem"', 0), + ('service_config_state', 'SELECT mean("loaded.active.running_count") AS "mean" FROM "CLMCMetrics"."autogen"."service_config_state" WHERE "resource"=\'nginx.service\'', 0), # Report MINIO's HTTP request response time (as a rolling difference of the sum total) - ('minio_http_requests_duration_seconds', 'SELECT difference(max("sum")) AS "mean" FROM "CLMCMetrics"."autogen"."minio_http_requests_duration_seconds" WHERE time > now() - 1h GROUP BY time(10s)',0), + ('minio_http_requests_duration_seconds', 'SELECT difference(max("sum")) AS "mean" FROM "CLMCMetrics"."autogen"."minio_http_requests_duration_seconds" WHERE time > now() - 1h GROUP BY time(10s)',0), # Report the average change in difference of MINIO's HTTP response time (the inner query determines a rolling difference between sampling periods [respTimeDiff]) ('minio_http_requests_duration_seconds', 'SELECT mean("respTimeDiff") AS "mean" FROM (SELECT difference(max("sum")) AS "respTimeDiff" FROM "CLMCMetrics"."autogen"."minio_http_requests_duration_seconds" WHERE time > now() - 1h GROUP BY time(10s))',0) ]) diff --git a/src/test/clmctest/services/nginx/telegraf_nginx.conf b/src/test/clmctest/services/nginx/telegraf_nginx.conf index 6bc3b8785bec84b0241a64801decaad6daf8fd8e..cce0734b1c3e3c9efd8588a97276f04136587cb3 100644 --- a/src/test/clmctest/services/nginx/telegraf_nginx.conf +++ b/src/test/clmctest/services/nginx/telegraf_nginx.conf @@ -30,4 +30,16 @@ # # Influx HTTP write listener [[inputs.http_listener]] ## Address and port to host HTTP listener on - service_address = ":8186" \ No newline at end of file + service_address = ":8186" + +[[inputs.systemctl]] + services = [ + "nginx.service", + ] + ## Sample rate for sampling state of service. + ## Must be greter that the collection_interval/2 + sample_rate = 2 + + ## Logging level for this plugin according to logrus log levels + ## "debug", "info", "warning", "error", "fatal", "panic" + log_level = "debug" \ No newline at end of file