Projet

Général

Profil

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

root / plugins / router / speedport_300 @ 5061ef1d

Historique | Voir | Annoter | Télécharger (1,45 ko)

1 685a58d8 Stig Sandbeck Mathisen
#!/bin/bash
2 126d7da8 Jo Hartmann
#
3
#
4 17f78427 Lars Kruse
# Munin plugin to show the up- / download stream of the actual
5
# internet connection by reading the top_status.htm from the
6 126d7da8 Jo Hartmann
# Speedport 300
7
#
8
#
9
# Don't forget zu fill in the following lines into the munin-node
10
# - ormally at /etc/muni/plugin-conf.d/ - an than restart munin
11
#
12
#   [speedport_300]
13
#   user root
14
#                                     Jo Hartmann (Version 08.0912)
15
16
# Personal config Section Begin ##
17
  router="192.168.0.111"
18
# Personal config section End ####
19
20
# Standard Config Section Begin ##
21
  if [ "$1" = "autoconf" ]; then
22
        echo yes
23
        exit 0
24
  fi
25
26
  if [ "$1" = "config" ]; then
27
28
       echo 'graph_title DSL Up- / Downstream'
29
       echo 'graph_args --base 1000 -l 0'
30
       echo 'graph_scale no'
31
       echo 'graph_vlabel Up- / Downstream in kBit/s'
32 c4b2d9a8 dipohl
       echo 'graph_category network'
33 126d7da8 Jo Hartmann
       echo 'download.label Downstream'
34
       echo 'upload.label Upstream'
35
       echo 'graph_info Information from the top_status.htm of the Speedport 300'
36
       exit 0
37
  fi
38
# Standard Config Section End ####
39
40
# Measure Section Begin ##########
41
  up_down=($(wget -q -O - $router/top_status.htm | grep "+'kBit" | awk -F"(" '{print $2}'))
42
  down=${up_down[0]%+*}
43
  up=${up_down[1]%+*}
44
45
  if [ "$down" = "" ]; then
46
     echo download.value  0
47
  else
48
     echo download.value  ${up_down[0]%+*}
49
  fi
50
51
  if [ "$up" = "" ]; then
52
     echo upload.value    0
53
  else
54
     echo upload.value    ${up_down[1]%+*}
55
  fi
56
# Measure Section End ############