File: nfs_client.in

package info (click to toggle)
munin 2.0.76-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,068 kB
  • sloc: perl: 11,684; java: 1,924; sh: 1,632; makefile: 636; javascript: 365; python: 267
file content (109 lines) | stat: -rw-r--r-- 1,805 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!@@GOODSH@@

: << =cut

=head1 NAME

nfs_client - Plugin to monitor NFS client traffic

=head1 NOTES

Revision 1.1.1.1  2006/06/04 20:53:57  he

Import the client version of the Munin system monitoring/graphing tool
-- project homepage is at http://munin.sourceforge.net/

This package has added support for NetBSD, via a number of new plugin
scripts where specific steps needs to be taken to collect information.

I also modified the ntp_ plugin script to make it possible to not plot
the NTP poll delay, leaving just jitter and offset, which IMO produces
a more telling graph.

=head1 AUTHOR

Unknown author

CVS revision indicates checkin by "he".  See "NOTES" for more
information.

=head1 LICENSE

GPLv2

=head1 MAGIC MARKERS

 #%# family=auto
 #%# capabilities=autoconf

=cut

#
#
#
#
#
#
#


getnames () {
    /usr/bin/nfsstat -c | awk '
/RPC Counts/ { coll = 1; next; }
/RPC Info/ { exit 0; }
/[a-z]/ && coll {
    for (n = 1; n <= NF; n++) {
	print $n
    }
}
'
}

if [ "$1" = "autoconf" ]; then
    if [ -x /usr/bin/nfsstat ]; then
	echo yes
	exit 0
    else
	echo no
	exit 0
    fi
fi

if [ "$1" = "config" ]; then

    echo 'graph_title NFS Client'
    echo 'graph_args --base 1000 -l 0'
    echo 'graph_vlabel requests / ${graph_period}'
    echo 'graph_total total'
    echo 'graph_category NFS'
    for a in `getnames` ; do
	echo "$a.label $a"
	echo "$a.type DERIVE"
	echo "$a.min 0"
    done
    exit 0
fi

/usr/bin/nfsstat -c | awk '
/RPC Counts/ { coll=1; next; }
/RPC Info/ { exit 0; }
/[a-z]/ && coll {
    for (n in names) {
	names[n] = ""
    }
    for (n = 1; n <= NF; n++) {
	names[n] = $n
    }
}
/[0-9]/ && coll {
    for (n = 1; n <= NF/2; n++) {
	name = names[n]
	values[name] = $((n - 1) * 2 + 1)
    }
}
END {
    for (v in values) {
	print v ".value " values[v];
    }
}
'