mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00:00
Plugin-Gallery: Better 2nd level headings
This commit is contained in:
parent
ae4e85ab60
commit
e10e386b02
10 changed files with 7 additions and 2 deletions
|
@ -1,57 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
case $1 in
|
||||
config)
|
||||
cat <<'EOM'
|
||||
graph_order snrdown snrup pwrdown pwrup
|
||||
graph_title dsl stats
|
||||
graph_args --base 1000
|
||||
graph_category Network
|
||||
graph_scale no
|
||||
graph_vlabel DSL SNR and Power
|
||||
attndown.label Down Attenuation
|
||||
attndown.type GAUGE
|
||||
attnup.label Up Attenuation
|
||||
attnup.type GAUGE
|
||||
snrdown.label Down SNR
|
||||
snrdown.type GAUGE
|
||||
snrup.label Up SNR
|
||||
snrup.type GAUGE
|
||||
pwrup.label Up Power
|
||||
pwrup.type GAUGE
|
||||
pwrdown.label Down Power
|
||||
pwrdown.type GAUGE
|
||||
pwrdown.cdef pwrdown,10,/
|
||||
pwrup.cdef pwrup,10,/
|
||||
graph_info Graph of DSL Connection Stats
|
||||
EOM
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
|
||||
# verify we have the IP for the modem
|
||||
if [[ "$DSLMODEMIP" == "" ]]
|
||||
then
|
||||
echo "DSLMODEMIP variable must be set!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# create temp file for storing wget output
|
||||
TMPFILE=$(mktemp)
|
||||
|
||||
|
||||
# if we have auth variables then add them to
|
||||
# wget cmdline
|
||||
if [[ "$DSLUSER" != "" && "$DSLPASS" != "" ]]
|
||||
then
|
||||
AUTH_OPT="--user=$DSLUSER --password='$DSLPASS' "
|
||||
fi
|
||||
|
||||
# get wan stats page and store it to temp file
|
||||
wget $AUTH_OPT --tries=1 --timeout=10 -q -O $TMPFILE http://$DSLMODEMIP/modemstatus_wanstatus.html
|
||||
# parse the javascript on the page to get the info we need and print it
|
||||
cat $TMPFILE | grep 'dslstatus = '| sed -e "s/['; ]//g" | head -n 1 | awk -F '[|/]' '{print "snrdown.value "$5"\nsnrup.value "$6"\nattndown.value "$7"\nattnup.value "$8"\npwrup.value "$29"\npwrdown.value "$30}'
|
||||
|
||||
#remove temp file
|
||||
rm $TMPFILE
|
Loading…
Add table
Add a link
Reference in a new issue