2014-10-04 19:57:39 +02:00
|
|
|
#!/bin/bash
|
2008-09-21 15:12:17 +02:00
|
|
|
#
|
|
|
|
#
|
2018-08-02 02:03:42 +02:00
|
|
|
# Munin plugin to show the up- / download stream of the actual
|
|
|
|
# internet connection by reading the top_status.htm from the
|
2008-09-21 15:12:17 +02:00
|
|
|
# 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'
|
2017-02-22 04:48:52 +01:00
|
|
|
echo 'graph_category network'
|
2008-09-21 15:12:17 +02:00
|
|
|
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 ############
|