~ubuntu-branches/ubuntu/gutsy/munin/gutsy

« back to all changes in this revision

Viewing changes to node/node.d.linux/nfsd.in

  • Committer: Bazaar Package Importer
  • Author(s): Tore Anderson
  • Date: 2004-05-21 20:51:19 UTC
  • Revision ID: james.westby@ubuntu.com-20040521205119-oz8bllbjp9hs80ig
Tags: upstream-0+1.0.0pre5
ImportĀ upstreamĀ versionĀ 0+1.0.0pre5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk
 
4
#
 
5
# $Log: nfsd.in,v $
 
6
# Revision 1.2  2004/05/06 21:55:18  jimmyo
 
7
# Added patch to contrib-plugin linux/nfsd, to graph rpc count (Alexandre Dupouy).
 
8
#
 
9
# Revision 1.1  2004/02/18 18:41:54  jimmyo
 
10
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk
 
11
#
 
12
#
 
13
#%# family=contrib
 
14
#%# capabilities=autoconf
 
15
 
 
16
NFSD=/proc/net/rpc/nfsd
 
17
 
 
18
proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
 
19
rpc="rpc"
 
20
 
 
21
if [ "$1" = "autoconf" ]; then
 
22
        if [ -x "$NFSD" ]; then
 
23
                echo yes
 
24
                exit 0
 
25
        else
 
26
                echo no
 
27
                exit 1
 
28
        fi
 
29
fi
 
30
 
 
31
if [ "$1" = "config" ]; then
 
32
 
 
33
        echo 'graph_title NFS Server'
 
34
        echo 'graph_args --base 1000 -l 0'
 
35
        echo 'graph_vlabel proc detail'
 
36
        for a in $rpc ; do echo "$a.label $a" ; echo "$a.type COUNTER" ; done
 
37
        for a in $proc ; do echo "$a.label $a" ; echo "$a.type COUNTER" ; done
 
38
        exit 0
 
39
fi
 
40
 
 
41
i=2;
 
42
 
 
43
for a in $rpc; do
 
44
        echo -n "$a.value "
 
45
        grep rpc /proc/net/rpc/nfsd \
 
46
                | cut -f $i -d ' ' \
 
47
                | awk '{print $1}'
 
48
                i=$(expr $i + 1)
 
49
done
 
50
 
 
51
i=4;
 
52
 
 
53
for a in $proc; do
 
54
        echo -n "$a.value "
 
55
        grep proc3 /proc/net/rpc/nfsd \
 
56
                | cut -f $i -d ' ' \
 
57
                | awk '{print $1}'
 
58
        i=$(expr $i + 1)
 
59
done