2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/network/speedport_300

57 lines
1.4 KiB
Plaintext
Raw Normal View History

2008-09-21 15:12:17 +02:00
#!/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 ############