~ubuntu-branches/ubuntu/maverick/munin/maverick

« back to all changes in this revision

Viewing changes to plugins/node.d.linux/vlan_.in

  • Committer: Bazaar Package Importer
  • Author(s): Holger Levsen, Stig Sandbeck Mathisen, Tom Feiner
  • Date: 2010-01-14 12:10:51 UTC
  • mfrom: (8.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20100114121051-6xovy6hqfh1wrl0u
Tags: 1.4.3-2
[ Stig Sandbeck Mathisen ]
* Add versioned dependency for librrds-perl.
  If used with librrds-perl 1.2 or older, the font path is wrong.

[ Tom Feiner ]
* Update watch file.
* Add patch from munin ticket #828, to suppress "occasional" unknown 
  states to avoid alerts. Thanks to Steve Wilson for the patch!
* Removed asterisks from NEWS.Debian and rewrite as non bulleted list, as
  advised by the developers reference.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!@@GOODSH@@
 
2
#
 
3
# Wildcard-script to monitor network interfaces. To monitor an
 
4
# interface, link vlan_<interface> to this file. E.g.
 
5
#
 
6
#    ln /usr/share/munin/node/plugins-contrib/vlan_ /etc/munin/node.d/vlan_eth0_1
 
7
#
 
8
# ...will monitor eth0.1
 
9
#
 
10
# Parameters:
 
11
#
 
12
#       config
 
13
#       autoconf
 
14
#       suggest
 
15
#
 
16
#%# family=manual
 
17
#%# capabilities=autoconf suggest
 
18
 
 
19
INTERFACE=$(basename $0 | sed 's/^vlan_//g' | tr '_' '.')
 
20
 
 
21
if [ "$1" = "autoconf" ]; then
 
22
    if [ ! -d /proc/net/vlan ] ; then 
 
23
        echo "no (no vlan support)"
 
24
        exit 0
 
25
    fi
 
26
    if [ ! -d -r /proc/net/vlan ] ; then
 
27
        echo "no (cannot not read /proc/net/vlan)"
 
28
        exit 0
 
29
    fi
 
30
    if [ ! -x /proc/net/vlan ] ; then
 
31
        echo "no (cannot cd to /proc/net/vlan)"
 
32
        exit 0
 
33
    fi
 
34
 
 
35
    echo yes
 
36
    exit 0
 
37
fi
 
38
 
 
39
if [ "$1" = "suggest" ]; then
 
40
    for file in /proc/net/vlan/*; do
 
41
        if [ ! "$file" = "/proc/net/vlan/config" ]; then
 
42
            basename $file | tr '.' '_'
 
43
        fi
 
44
    done
 
45
    exit 0
 
46
fi
 
47
 
 
48
if [ "$1" = "config" ]; then
 
49
        echo "graph_order received transmitted" 
 
50
        echo "graph_title VLAN $INTERFACE Traffic"
 
51
        echo 'graph_args --base 1024'
 
52
        echo 'graph_vlabel bits per ${graph_period} in (-) / out (+)'
 
53
        echo 'graph_category network'
 
54
        echo 'received.label bps'
 
55
        echo 'received.type DERIVE'
 
56
        echo 'received.min 0'
 
57
        echo 'received.graph no'
 
58
        echo 'received.cdef received,8,*'
 
59
        echo 'received.draw AREA'
 
60
        echo 'transmitted.label bps'
 
61
        echo 'transmitted.type DERIVE'
 
62
        echo 'transmitted.min 0'
 
63
        echo 'transmitted.negative received'
 
64
        echo 'transmitted.cdef transmitted,8,*'
 
65
        echo 'transmitted.draw AREA'
 
66
        exit 0
 
67
fi
 
68
 
 
69
awk "/bytes received/ { print \"received.value \" \$4 } /bytes transmitted/ { print \"transmitted.value \" \$4 }" < /proc/net/vlan/$INTERFACE
 
70