Add collectd files

This commit is contained in:
Bram Veenboer
2024-12-23 10:47:41 +01:00
parent c825994225
commit d5de88fcf2
13 changed files with 704 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/bash
SPEEDTEST=/usr/bin/speedtest-cli
COLLECTION=server
INTERVAL=900
while :; do
SECONDS=0
RESULT=($($SPEEDTEST | grep Mbit | cut -d' ' -f 2))
TIMESTAMP=$(date +%s)
#echo "PUTVAL $COLLECTION/exec-speedtest/gauge-download interval=$INTERVAL N:${RESULT[0]}"
#echo "PUTVAL $COLLECTION/exec-speedtest/gauge-upload interval=$INTERVAL N:${RESULT[1]}"
echo "PUTVAL $COLLECTION/exec-speedtest/gauge-download ${TIMESTAMP}:${RESULT[0]}"
echo "PUTVAL $COLLECTION/exec-speedtest/gauge-upload ${TIMESTAMP}:${RESULT[1]}"
sleep $((INTERVAL-$SECONDS))
done