From 126d7da86cb2707561ae9f2eaa820b1a357952ea Mon Sep 17 00:00:00 2001 From: Jo Hartmann Date: Sun, 21 Sep 2008 15:12:17 +0200 Subject: [PATCH] Initial version --- plugins/other/speedport_300 | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 plugins/other/speedport_300 diff --git a/plugins/other/speedport_300 b/plugins/other/speedport_300 new file mode 100755 index 00000000..66de83ef --- /dev/null +++ b/plugins/other/speedport_300 @@ -0,0 +1,56 @@ +#!/bin/sh +# +# +# Munin plugin to show the up- / download stream of the actual +# internet connection by reading the top_status.htm from the +# Speedport 300 +# +# +# Don't forget zu fill in the following lines into the munin-node +# - ormally at /etc/muni/plugin-conf.d/ - an than restart munin +# +# [speedport_300] +# user root +# Jo Hartmann (Version 08.0912) + +# Personal config Section Begin ## + router="192.168.0.111" +# Personal config section End #### + +# Standard Config Section Begin ## + if [ "$1" = "autoconf" ]; then + echo yes + exit 0 + fi + + if [ "$1" = "config" ]; then + + echo 'graph_title DSL Up- / Downstream' + echo 'graph_args --base 1000 -l 0' + echo 'graph_scale no' + echo 'graph_vlabel Up- / Downstream in kBit/s' + echo 'graph_category Http' + echo 'download.label Downstream' + echo 'upload.label Upstream' + echo 'graph_info Information from the top_status.htm of the Speedport 300' + exit 0 + fi +# Standard Config Section End #### + +# Measure Section Begin ########## + up_down=($(wget -q -O - $router/top_status.htm | grep "+'kBit" | awk -F"(" '{print $2}')) + down=${up_down[0]%+*} + up=${up_down[1]%+*} + + if [ "$down" = "" ]; then + echo download.value 0 + else + echo download.value ${up_down[0]%+*} + fi + + if [ "$up" = "" ]; then + echo upload.value 0 + else + echo upload.value ${up_down[1]%+*} + fi +# Measure Section End ############