Skip to content

Instantly share code, notes, and snippets.

@zentrification
Created May 8, 2019 15:15
Show Gist options
  • Save zentrification/f07b7fb6c72eee3c52368173072ca2d2 to your computer and use it in GitHub Desktop.
Save zentrification/f07b7fb6c72eee3c52368173072ca2d2 to your computer and use it in GitHub Desktop.
Munin speedtest plugin modified to track ping
#!/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 Download"
echo "down.type GAUGE"
echo "down.draw LINE1"
echo "up.label Upload"
echo "up.type GAUGE"
echo "up.draw LINE1"
echo "ping.label Ping"
echo "ping.type GAUGE"
echo "ping.draw LINE1"
echo "graph_info Graph of Internet Connection Speed"
exit 0;;
esac
OUTPUT=/var/log/speedtest.log
DOWNLOAD=`grep Download "$OUTPUT" | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
UPLOAD=`grep Upload "$OUTPUT" | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
PING=`grep Ping "$OUTPUT" | sed 's/[a-zA-Z:]* \([0-9]*\.[0-9]*\) [a-zA-Z/]*/\1/'`
echo "down.value $DOWNLOAD"
echo "up.value $UPLOAD"
echo "ping.value $PING"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment