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

added systemctl test and dependency on new plugin

parent b4c41bbf
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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)
])
......
......@@ -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
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