3
# Wildcard-plugin to monitor network interfaces. To monitor an
4
# interface, link if_<interface> to this file. E.g.
6
# ln -s /usr/share/munin/plugins-auto/if_errcoll_ /etc/munin/node.d/if_errcoll_eth0
8
# ...will monitor eth0.
10
# Any device found in /usr/bin/kstat can be monitored.
12
# $Log: if_errcoll_.in,v $
13
# Revision 1.2 2004/04/30 16:43:00 jimmyo
14
# Cleaned up Solaris plugins.
16
# Revision 1.1 2004/01/02 18:50:01 jimmyo
17
# Renamed occurrances of lrrd -> munin
19
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
20
# Import of LRRD CVS tree after renaming to Munin
22
# Revision 1.2 2003/11/07 17:43:16 jimmyo
23
# Cleanups and log entries
27
# Magic markers (optional - used by munin-config and some installation
31
#%# capabilities=autoconf suggest
34
INTERFACE=`basename $0 | sed 's/^if_errcoll_//g'`
36
if [ "$1" = "autoconf" ]; then
37
if [ -x /usr/bin/kstat ]; then
41
echo "no (/usr/bin/kstat not found)"
46
if [ "$1" = "suggest" ]; then
47
if [ -x /usr/bin/kstat ]; then
48
kstat -p -s '/^ierrors$/' | awk -F: '{ print $3 }'
55
if [ "$1" = "config" ]; then
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'
76
kstat -p -n $INTERFACE -s '/^([io]errors|collisions)$/' | awk -F: '
79
print four[1] ".value", four[2]