From 8a31fa45773787d17ce3fc615308b9a0fdf48bf3 Mon Sep 17 00:00:00 2001 From: Ville Granroth Date: Mon, 21 Feb 2022 14:09:23 +0200 Subject: [PATCH] b/w and ping tests --- speedtest_bw | 25 +++++++++++++++++++++++++ speedtest_ping | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 speedtest_bw create mode 100755 speedtest_ping diff --git a/speedtest_bw b/speedtest_bw new file mode 100755 index 0000000..5ff3bf7 --- /dev/null +++ b/speedtest_bw @@ -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 $3 }'` +UPLOAD=`echo "$OUTPUT" | grep Upload | awk '{ print $3 }'` + +echo "down.value $DOWNLOAD" +echo "up.value $UPLOAD" diff --git a/speedtest_ping b/speedtest_ping new file mode 100755 index 0000000..299d79c --- /dev/null +++ b/speedtest_ping @@ -0,0 +1,25 @@ +#!/bin/bash + +case $1 in + config) + echo "graph_category network" + echo "graph_title Speedtest latency" + echo "graph_args --base 1000 -l 0" + echo "graph_vlabel Ping / jitter" + echo "graph_scale no" + echo "ping.label Latency" + echo "ping.type GAUGE" + echo "ping.draw LINE1" + echo "jitter.label Jitter" + echo "jitter.type GAUGE" + echo "jitter.draw LINE1" + echo "graph_info Graph of Internet Connection latency" + exit 0;; + esac + +OUTPUT=`cat /var/log/munin/speedtest-results.txt` +PING=`echo "$OUTPUT" | grep Latency | awk '{ print $2 }'` +JITTER=`echo "$OUTPUT" | grep Latency | awk '{ print $4 }' | cut -c2-` + +echo "ping.value $PING" +echo "jitter.value $JITTER"