Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / network / nfsv4 @ c3660c2a

Historique | Voir | Annoter | Télécharger (2,25 ko)

1 1f8a635e Richard
#!/bin/sh
2
#
3
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk and Richard Dumais
4
#
5
# $Log$
6
# Revision 1.9.2.2 2008/03/06 20:00:00  nerux
7
# Modify script for nfsv4
8
#
9
# Revision 1.9.2.1  2005/03/16 13:45:45  ilmari
10
# Fix autoconf for linux/{nfsd,nfs_client}.
11
#
12
# Revision 1.9  2004/12/10 10:47:49  jimmyo
13
# Change name from ${scale} to ${graph_period}, to be more consistent.
14
#
15
# Revision 1.8  2004/12/09 22:12:56  jimmyo
16
# Added "graph_period" option, to make "graph_sums" usable.
17
#
18
# Revision 1.7  2004/11/21 00:17:12  jimmyo
19
# Changed a lot of plugins so they use DERIVE instead of COUNTER.
20
#
21
# Revision 1.6  2004/10/01 12:32:09  ilmari
22
# complete "rpc" removal
23
#
24
# Revision 1.5  2004/10/01 08:40:50  ilmari
25
# Remove useless 'rpc' field, add total field
26
#
27
# Revision 1.4  2004/05/20 19:02:37  jimmyo
28
# Set categories on a bunch of plugins
29
#
30
# Revision 1.3  2004/05/15 21:33:29  jimmyo
31
# "Upped" som plugins from contrib/manual to manual or auto.
32
#
33
# Revision 1.2  2004/05/06 21:55:18  jimmyo
34
# Added patch to contrib-plugin linux/nfsd, to graph rpc count (Alexandre Dupouy).
35
#
36
# Revision 1.1  2004/02/18 18:41:54  jimmyo
37
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk
38
#
39
#
40
#%# family=auto
41
#%# capabilities=config
42
43
NFSD=/proc/net/rpc/nfsd
44
45
#proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
46
proc="access close commit create delegpurge delegreturn getattr getfh link lock lockt locku lookup lookup_root nverify open openattr open_conf open_dgrd putfh putpubfh putrootfh read readdir readlink remove rename renew restorefh savefh secinfo setattr setcltid setcltidconf verify write rellockowner"
47
48
if [ "$1" = "autoconf" ]; then
49
	if [ -f "$NFSD" ]; then
50
		echo yes
51
		exit 0
52
	else
53
		echo "no (no $NFSD)"
54
		exit 1
55
	fi
56
fi
57
58
if [ "$1" = "config" ]; then
59
60
	echo 'graph_title NFS Server'
61
	echo 'graph_args --base 1000 -l 0'
62
	echo 'graph_vlabel requests / ${graph_period}'
63
	echo 'graph_total total'
64
	echo 'graph_category NFS'
65
	for a in $proc ; do echo "$a.label $a" ; echo "$a.type DERIVE"; echo "$a.min 0"; done
66
	exit 0
67
fi
68
69
i=6;
70
71
for a in $proc; do
72
	echo -n "$a.value "
73
	grep proc4ops $NFSD \
74
		| cut -f $i -d ' ' \
75
		| awk '{print $1}'
76
	i=$(expr $i + 1)
77
done