Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / router / conexant_adsl @ 1671e356

Historique | Voir | Annoter | Télécharger (2,3 ko)

1 73e23cb7 Stig Sandbeck Mathisen
#!/bin/bash
2 17f78427 Lars Kruse
#
3
#
4 96996d28 Derik Vercueil
# Script to show adsl router stats for routers with Conexant based chips and the standard Conexant web admin gui like the eTec EpicRouter...
5
#
6
# Parameters understood:
7
#
8
# 	config   (required)
9
# 	autoconf (optional - used by munin-config)
10
#
11
#
12
# Magic markers (optional - used by munin-config and installation
13
# scripts):
14
#
15
#%# family=auto
16
#%# capabilities=autoconf
17
USERNAME=admin
18
PASSWORD=epicrouter
19
MAXLABEL=20
20
21
if [ "$1" = "autoconf" ]; then
22
	echo yes
23
	exit 0
24
fi
25
26
if [ "$1" = "config" ]; then
27
28
	echo 'graph_title ADSL Connection Statistics'
29
	echo 'graph_args --base 1000 -l 0'
30 e10e386b dipohl
	echo 'graph_category network'
31 96996d28 Derik Vercueil
	echo 'graph_vlabel Daily Connection Statistics'
32
	echo 'st_dw_crc.label Downstream CRC count'
33
	echo 'st_up_crc.label Upstream CRC count'
34
	echo 'st_dw_data_rate.label Downstream Data Rate'
35
	echo 'st_up_data_rate.label Upstream Data Rate'
36
	echo 'st_dw_line_attenuation.label Downstream Line Attenuation'
37
	echo 'st_up_line_attenuation.label Upstream Line Attenuation'
38
	echo 'st_dw_errored_seconds.label Downstream Errored Seconds'
39
	echo 'st_up_errored_seconds.label Upstream Errored Seconds'
40
	exit 0
41
fi
42
43
wget -q --http-user=admin --http-passwd=epicrouter http://10.0.0.2/doc/adsl.htm -O /tmp/adsl.htm
44
echo -en "st_dw_crc.value "
45
echo $((`grep 'var st_dw_crc' /tmp/adsl.htm | sed 's/[var st_dw_crc=;"]//g'`))
46
echo -n
47
echo -en "st_up_crc.value "
48
echo $((`grep 'var st_up_crc' /tmp/adsl.htm | sed 's/[var st_up_crc=;"]//g'`))
49
echo -n
50
echo -en "st_dw_data_rate.value "
51
echo $((`grep 'var st_dw_data_rate' /tmp/adsl.htm | sed 's/[var st_dw_data_rate=;"]//g'`))
52
echo -n
53
echo -en "st_up_data_rate.value "
54
echo $((`grep 'var st_up_data_rate' /tmp/adsl.htm | sed 's/[var st_up_data_rate=;"]//g'`))
55
echo -n
56
echo -en "st_dw_line_attenuation.value "
57
echo $((`grep 'var st_dw_line_attenuation' /tmp/adsl.htm | sed 's/[var st_dw_line_attenuation=\.;"]//g'`))
58
echo -n
59
echo -en "st_up_line_attenuation.value "
60
echo $((`grep 'var st_up_line_attenuation' /tmp/adsl.htm | sed 's/[var st_up_line_attenuation=;\."]//g'`))
61
echo -n
62
echo -en "st_dw_errored_seconds.value "
63
echo $((`grep 'var st_dw_errored_seconds' /tmp/adsl.htm | sed 's/[var st_dw_errored_seconds=;"]//g'`))
64
echo -n
65
echo -en "st_up_errored_seconds.value "
66
echo $((`grep 'var st_up_errored_seconds' /tmp/adsl.htm | sed 's/[var st_up_errored_seconds=;"]//g'`))
67
echo -n
68
rm /tmp/adsl.htm