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

« back to all changes in this revision

Viewing changes to plugins/node.d.sunos/if_err_.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
# -*- sh -*-
 
3
 
 
4
: << =cut
 
5
 
 
6
=head1 NAME
 
7
 
 
8
if_err_ - Wildcard plugin to monitor errors on network interfaces
 
9
 
 
10
=head1 CONFIGURATION
 
11
 
 
12
=head2 ENVIRONMENT VARIABLES
 
13
 
 
14
This plugin does not use environment variables
 
15
 
 
16
=head2 WILDCARD PLUGIN
 
17
 
 
18
This is a wildcard plugin. To monitor an interface, link
 
19
if_<interface> to this file. E.g.
 
20
 
 
21
  ln -s /usr/share/munin/plugins-auto/if_err_ \
 
22
        /etc/munin/node.d/if_err_eth0
 
23
 
 
24
...will monitor eth0.
 
25
 
 
26
Any device found in /usr/bin/kstat can be monitored.
 
27
 
 
28
=head1 AUTHOR
 
29
 
 
30
Unknown author
 
31
 
 
32
=head1 LICENSE
 
33
 
 
34
Unknown license
 
35
 
 
36
=head1 MAGIC MARKERS
 
37
 
 
38
 #%# family=auto
 
39
 #%# capabilities=autoconf suggest
 
40
 
 
41
=cut
 
42
 
 
43
. $MUNIN_LIBDIR/plugins/plugin.sh
 
44
 
 
45
INTERFACE=${0##*/if_err_}
 
46
 
 
47
if [ "$1" = "autoconf" ]; then
 
48
        if [ -x /usr/bin/kstat ]; then
 
49
                echo yes
 
50
                exit 0
 
51
        else
 
52
                echo "no (/usr/bin/kstat not found)"
 
53
                exit 0
 
54
        fi
 
55
fi
 
56
 
 
57
if [ "$1" = "suggest" ]; then
 
58
        if [ -x /usr/bin/kstat ]; then
 
59
                kstat -m link -p -s '/^ierrors$/' | awk -F: '{ print $3 }'
 
60
                exit 0
 
61
        else
 
62
                exit 1
 
63
        fi
 
64
fi
 
65
 
 
66
if [ "$1" = "config" ]; then
 
67
 
 
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'
 
76
        print_warning ierrors
 
77
        print_critical ierrors
 
78
        echo 'oerrors.label Output Errors'
 
79
        echo 'oerrors.type COUNTER'
 
80
        echo 'oerrors.max 2000000000'
 
81
        print_warning oerrors
 
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
 
88
        exit 0
 
89
fi;
 
90
 
 
91
kstat -p -n $INTERFACE -m link -s '/^([io]errors|collisions)$/' | awk -F: '
 
92
{
 
93
        split($4, four, "\t")
 
94
        print four[1] ".value", four[2]
 
95
}'