~ubuntu-branches/ubuntu/gutsy/munin/gutsy

« back to all changes in this revision

Viewing changes to node/node.d.sunos/if_errcoll_.in

  • Committer: Bazaar Package Importer
  • Author(s): Tore Anderson
  • Date: 2004-05-21 20:51:19 UTC
  • Revision ID: james.westby@ubuntu.com-20040521205119-oz8bllbjp9hs80ig
Tags: upstream-0+1.0.0pre5
ImportĀ upstreamĀ versionĀ 0+1.0.0pre5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Wildcard-plugin to monitor network interfaces. To monitor an
 
4
# interface, link if_<interface> to this file. E.g.
 
5
#
 
6
#    ln -s /usr/share/munin/plugins-auto/if_errcoll_ /etc/munin/node.d/if_errcoll_eth0
 
7
#
 
8
# ...will monitor eth0.
 
9
#
 
10
# Any device found in /usr/bin/kstat can be monitored.
 
11
#
 
12
# $Log: if_errcoll_.in,v $
 
13
# Revision 1.2  2004/04/30 16:43:00  jimmyo
 
14
# Cleaned up Solaris plugins.
 
15
#
 
16
# Revision 1.1  2004/01/02 18:50:01  jimmyo
 
17
# Renamed occurrances of lrrd -> munin
 
18
#
 
19
# Revision 1.1.1.1  2004/01/02 15:18:07  jimmyo
 
20
# Import of LRRD CVS tree after renaming to Munin
 
21
#
 
22
# Revision 1.2  2003/11/07 17:43:16  jimmyo
 
23
# Cleanups and log entries
 
24
#
 
25
#
 
26
#
 
27
# Magic markers (optional - used by munin-config and some installation
 
28
# scripts):
 
29
#
 
30
#%# family=auto
 
31
#%# capabilities=autoconf suggest
 
32
 
 
33
 
 
34
INTERFACE=`basename $0 | sed 's/^if_errcoll_//g'`
 
35
 
 
36
if [ "$1" = "autoconf" ]; then
 
37
        if [ -x /usr/bin/kstat ]; then
 
38
                echo yes
 
39
                exit 0
 
40
        else
 
41
                echo "no (/usr/bin/kstat not found)"
 
42
                exit 1
 
43
        fi
 
44
fi
 
45
 
 
46
if [ "$1" = "suggest" ]; then
 
47
        if [ -x /usr/bin/kstat ]; then
 
48
                kstat -p -s '/^ierrors$/' | awk -F: '{ print $3 }'
 
49
                exit 0
 
50
        else
 
51
                exit 1
 
52
        fi
 
53
fi
 
54
 
 
55
if [ "$1" = "config" ]; then
 
56
 
 
57
        echo "graph_order ierrors oerrors collisions"
 
58
        echo "graph_title $INTERFACE Errors & Collisions"
 
59
        echo 'graph_args --base 1000'
 
60
        echo 'graph_vlabel events / s'
 
61
        echo 'ierrors.label Input Errors / min'
 
62
        echo 'ierrors.type COUNTER'
 
63
        echo 'ierrors.cdef ierrors,60,*'
 
64
        echo 'ierrors.max 2000000000'
 
65
        echo 'oerrors.label Output Errors / min'
 
66
        echo 'oerrors.type COUNTER'
 
67
        echo 'oerrors.cdef oerrors,60,*'
 
68
        echo 'oerrors.max 2000000000'
 
69
        echo 'collisions.label Collisions / min'
 
70
        echo 'collisions.type COUNTER'
 
71
        echo 'collisions.cdef collisions,60,*'
 
72
        echo 'collisions.max 2000000000'
 
73
        exit 0
 
74
fi;
 
75
 
 
76
kstat -p -n $INTERFACE -s '/^([io]errors|collisions)$/' | awk -F: '
 
77
{
 
78
        split($4, four, "\t")
 
79
        print four[1] ".value", four[2]
 
80
}'