8
if_err_ - Wildcard plugin to monitor errors on network interfaces
12
=head2 ENVIRONMENT VARIABLES
14
This plugin does not use environment variables
16
=head2 WILDCARD PLUGIN
18
This is a wildcard plugin. To monitor an interface, link
19
if_<interface> to this file. E.g.
21
ln -s /usr/share/munin/plugins-auto/if_err_ \
22
/etc/munin/node.d/if_err_eth0
26
Any device found in /usr/bin/kstat can be monitored.
39
#%# capabilities=autoconf suggest
43
. $MUNIN_LIBDIR/plugins/plugin.sh
45
INTERFACE=${0##*/if_err_}
47
if [ "$1" = "autoconf" ]; then
48
if [ -x /usr/bin/kstat ]; then
52
echo "no (/usr/bin/kstat not found)"
57
if [ "$1" = "suggest" ]; then
58
if [ -x /usr/bin/kstat ]; then
59
kstat -m link -p -s '/^ierrors$/' | awk -F: '{ print $3 }'
66
if [ "$1" = "config" ]; then
68
echo "graph_order ierrors oerrors collisions"
69
echo "graph_title $INTERFACE Errors & Collisions"
70
echo 'graph_args --base 1000'
71
echo 'graph_vlabel events / ${graph_period}'
72
echo 'graph_category network'
73
echo 'ierrors.label Input Errors'
74
echo 'ierrors.type COUNTER'
75
echo 'ierrors.max 2000000000'
77
print_critical ierrors
78
echo 'oerrors.label Output Errors'
79
echo 'oerrors.type COUNTER'
80
echo 'oerrors.max 2000000000'
82
print_critical oerrors
83
echo 'collisions.label Collisions'
84
echo 'collisions.type COUNTER'
85
echo 'collisions.max 2000000000'
86
print_warning collisions
87
print_critical collisions
91
kstat -p -n $INTERFACE -m link -s '/^([io]errors|collisions)$/' | awk -F: '
94
print four[1] ".value", four[2]