3
# Wildcard-script to monitor network interfaces. To monitor an
4
# interface, link vlan_<interface> to this file. E.g.
6
# ln /usr/share/munin/node/plugins-contrib/vlan_ /etc/munin/node.d/vlan_eth0_1
8
# ...will monitor eth0.1
17
#%# capabilities=autoconf suggest
19
INTERFACE=$(basename $0 | sed 's/^vlan_//g' | tr '_' '.')
21
if [ "$1" = "autoconf" ]; then
22
if [ ! -d /proc/net/vlan ] ; then
23
echo "no (no vlan support)"
26
if [ ! -d -r /proc/net/vlan ] ; then
27
echo "no (cannot not read /proc/net/vlan)"
30
if [ ! -x /proc/net/vlan ] ; then
31
echo "no (cannot cd to /proc/net/vlan)"
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 '.' '_'
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'
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'
69
awk "/bytes received/ { print \"received.value \" \$4 } /bytes transmitted/ { print \"transmitted.value \" \$4 }" < /proc/net/vlan/$INTERFACE