#!/bin/sh # # Magic markers - optional - used by installation scripts and # munin-config: # #%# family=auto #%# capabilities=autoconf if [ "$1" = "autoconf" ]; then if [ -e /proc/net/rpc/nfsd ]; then echo yes exit 0 else echo no exit 1 fi fi if [ "$1" = "config" ]; then # The title of the graph echo 'graph_title NFS Thread usage' # Arguments to "rrdtool graph". In this case, tell it that the # lower limit of the graph is '0', and that 1k=1000 (not 1024) echo 'graph_args --base 1000 -l 0' # The Y-axis label echo 'graph_vlabel Seconds use in this decile' # Graph category echo 'graph_category NFS' # Graph information echo 'graph_info This graph shows the number of second the nfs daemon had spent with 10%,20%,30% etc. of its thread currently working' echo 'graph_order d10 d20 d30 d40 d50 d60 d70 d80 d90 d100' echo 'graph_scale no' # echo 'graph_period second' for i in 10 20 30 40 50 60 70 80 90 100 do echo "d${i}.label decile ${i}" if [ $i -eq 10 ] then echo "d${i}.draw AREA" else echo "d${i}.draw STACK" fi echo "d${i}.max 60000" echo "d${i}.min 0" echo "d${i}.type DERIVE" done exit 0 fi K="`cat /proc/net/rpc/nfsd|grep ^th|cut -f 4- -d ' '`" i=0 for j in $K do i=$(($i + 10)) echo "d${i}.value `echo $j| sed -e 's/\.//'`" done