From 8f6985bb3fc9c69d02e0682c9d3b5d5145c91c0e Mon Sep 17 00:00:00 2001 From: VG Date: Sat, 18 Dec 2021 20:00:23 +0200 Subject: [PATCH] first save --- README.md | 9 +++++++++ spedetest.cron | 1 + spedetest.munin | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 README.md create mode 100644 spedetest.cron create mode 100644 spedetest.munin diff --git a/README.md b/README.md new file mode 100644 index 0000000..86de260 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# instructions + +cron goes to cron + +plugin goes to /etc/munin/plugins/speedtest as symlink from /usr/share/munin or whatever you have the plugin folder + +install the speedtest cli client from their site + +https://williamyaps.github.io/wlmjavascript/servercli.html is handy source for the stupid list of servers - diff --git a/spedetest.cron b/spedetest.cron new file mode 100644 index 0000000..bf6bb9f --- /dev/null +++ b/spedetest.cron @@ -0,0 +1 @@ +2,17,32,47 * * * * python /usr/bin/speedtest --progress=no --precision=2 --server-id=14928 > /var/log/munin/speedtest-results.txt diff --git a/spedetest.munin b/spedetest.munin new file mode 100644 index 0000000..d1125eb --- /dev/null +++ b/spedetest.munin @@ -0,0 +1,25 @@ +#!/bin/bash + +case $1 in + config) + echo "graph_category network" + echo "graph_title Speedtest" + echo "graph_args --base 1000 -l 0" + echo "graph_vlabel DL / UL" + echo "graph_scale no" + echo "down.label DL" + echo "down.type GAUGE" + echo "down.draw LINE1" + echo "up.label UL" + echo "up.type GAUGE" + echo "up.draw LINE1" + echo "graph_info Graph of Internet Connection Speed" + exit 0;; + esac + +OUTPUT=`cat /var/log/munin/speedtest-results.txt` +DOWNLOAD=`echo "$OUTPUT" | grep Download | awk '{ print $2 }'` +UPLOAD=`echo "$OUTPUT" | grep Upload | awk '{ print $2 }'` + +echo "down.value $DOWNLOAD" +echo "up.value $UPLOAD"