root / plugins / other / conexant_adsl @ e5ce7492
Historique | Voir | Annoter | Télécharger (2,27 ko)
| 1 | 96996d28 | Derik Vercueil | #!/bin/sh |
|---|---|---|---|
| 2 | # |
||
| 3 | # |
||
| 4 | # 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 | echo 'graph_vlabel Daily Connection Statistics' |
||
| 31 | echo 'st_dw_crc.label Downstream CRC count' |
||
| 32 | echo 'st_up_crc.label Upstream CRC count' |
||
| 33 | echo 'st_dw_data_rate.label Downstream Data Rate' |
||
| 34 | echo 'st_up_data_rate.label Upstream Data Rate' |
||
| 35 | echo 'st_dw_line_attenuation.label Downstream Line Attenuation' |
||
| 36 | echo 'st_up_line_attenuation.label Upstream Line Attenuation' |
||
| 37 | echo 'st_dw_errored_seconds.label Downstream Errored Seconds' |
||
| 38 | echo 'st_up_errored_seconds.label Upstream Errored Seconds' |
||
| 39 | exit 0 |
||
| 40 | fi |
||
| 41 | |||
| 42 | wget -q --http-user=admin --http-passwd=epicrouter http://10.0.0.2/doc/adsl.htm -O /tmp/adsl.htm |
||
| 43 | echo -en "st_dw_crc.value " |
||
| 44 | echo $((`grep 'var st_dw_crc' /tmp/adsl.htm | sed 's/[var st_dw_crc=;"]//g'`)) |
||
| 45 | echo -n |
||
| 46 | echo -en "st_up_crc.value " |
||
| 47 | echo $((`grep 'var st_up_crc' /tmp/adsl.htm | sed 's/[var st_up_crc=;"]//g'`)) |
||
| 48 | echo -n |
||
| 49 | echo -en "st_dw_data_rate.value " |
||
| 50 | echo $((`grep 'var st_dw_data_rate' /tmp/adsl.htm | sed 's/[var st_dw_data_rate=;"]//g'`)) |
||
| 51 | echo -n |
||
| 52 | echo -en "st_up_data_rate.value " |
||
| 53 | echo $((`grep 'var st_up_data_rate' /tmp/adsl.htm | sed 's/[var st_up_data_rate=;"]//g'`)) |
||
| 54 | echo -n |
||
| 55 | echo -en "st_dw_line_attenuation.value " |
||
| 56 | echo $((`grep 'var st_dw_line_attenuation' /tmp/adsl.htm | sed 's/[var st_dw_line_attenuation=\.;"]//g'`)) |
||
| 57 | echo -n |
||
| 58 | echo -en "st_up_line_attenuation.value " |
||
| 59 | echo $((`grep 'var st_up_line_attenuation' /tmp/adsl.htm | sed 's/[var st_up_line_attenuation=;\."]//g'`)) |
||
| 60 | echo -n |
||
| 61 | echo -en "st_dw_errored_seconds.value " |
||
| 62 | echo $((`grep 'var st_dw_errored_seconds' /tmp/adsl.htm | sed 's/[var st_dw_errored_seconds=;"]//g'`)) |
||
| 63 | echo -n |
||
| 64 | echo -en "st_up_errored_seconds.value " |
||
| 65 | echo $((`grep 'var st_up_errored_seconds' /tmp/adsl.htm | sed 's/[var st_up_errored_seconds=;"]//g'`)) |
||
| 66 | echo -n |
||
| 67 | rm /tmp/adsl.htm |
