File: nfs_client.in

package info (click to toggle)
munin 1.2.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,940 kB
  • ctags: 98
  • sloc: sh: 4,215; makefile: 452; perl: 135
file content (67 lines) | stat: -rw-r--r-- 1,622 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
#
# Plugin to monitor NFS client traffic
#
# $Log$
# Revision 1.8.2.1  2005/03/16 13:45:45  ilmari
# Fix autoconf for linux/{nfsd,nfs_client}.
#
# Revision 1.8  2004/12/10 10:47:49  jimmyo
# Change name from ${scale} to ${graph_period}, to be more consistent.
#
# Revision 1.7  2004/12/09 22:12:56  jimmyo
# Added "graph_period" option, to make "graph_sums" usable.
#
# Revision 1.6  2004/11/21 00:17:12  jimmyo
# Changed a lot of plugins so they use DERIVE instead of COUNTER.
#
# Revision 1.5  2004/10/01 12:32:09  ilmari
# complete "rpc" removal
#
# Revision 1.4  2004/10/01 08:40:50  ilmari
# Remove useless 'rpc' field, add total field
#
# Revision 1.3  2004/05/20 19:02:37  jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.2  2004/05/15 21:33:29  jimmyo
# "Upped" som plugins from contrib/manual to manual or auto.
#
#
#%# family=auto
#%# capabilities=autoconf

NFS=/proc/net/rpc/nfs

proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"

if [ "$1" = "autoconf" ]; then
	if [ -f "$NFS" ]; then
		echo yes
		exit 0
	else
		echo "no (no $NFS)"
		exit 1
	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 $proc ; do echo "$a.label $a" ; echo "$a.type DERIVE"; echo "$a.min 0"; done
	exit 0
fi

i=4;

for a in $proc; do
	echo -n "$a.value "
	grep proc3 $NFS \
		| cut -f $i -d ' ' \
		| awk '{print $1}'
	i=$(expr $i + 1)
done