mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Added v3 to title, added nfs_client
I added a v3 to the title of the nfsd graph to reduce ambiguity. This is also the initial commit of the nfs_client plugin. It is essentially identical to server. The output of nfsstat for client is somewhat different from server in the labeling of the cache entries. As such, I've left them off here and will add a standalone plugin for nfs_client_cache where the awful, terrible, hideous string parsing will take place without sullying the triviality and simplicity of this working plugin.
This commit is contained in:
parent
d0d72f5daa
commit
e891287fd3
2 changed files with 62 additions and 2 deletions
60
plugins/nfs-freebsd/nfs_client
Normal file
60
plugins/nfs-freebsd/nfs_client
Normal file
|
@ -0,0 +1,60 @@
|
|||
#!/bin/bash
|
||||
# -*- sh -*-
|
||||
|
||||
: << =cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
nfsd - Plugin to monitor NFSv3 client activity on FreeBSD
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
No configuration
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Plugin created by Adam Michel, based on work by Alexandre Dupouy, with the assistance of Mike Fedyk
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
NFSSTAT=/usr/bin/nfsstat
|
||||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -x "$NFSSTAT" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (no $NFSSTAT)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
labels=`$NFSSTAT -c | grep -iv "[0-9]" | grep -v ":" | sed 's/X\ /x_/' | tr '\n' ' ' | awk '{print $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}' | tr '[A-Z]' '[a-z]'`
|
||||
values=`$NFSSTAT -c | grep -i "[0-9]" | tr '\n' ' ' | awk '{print $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}'`
|
||||
|
||||
larray=( $labels )
|
||||
varray=( $values )
|
||||
if [ "$1" = "config" ]; then
|
||||
|
||||
echo 'graph_title NFSv3 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 $labels; do echo "$a.label $a" ; echo "$a.type DERIVE"; echo "$a.min 0"; done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for i in {0..25}; do
|
||||
label=${larray[$i]}
|
||||
value=${varray[$i]}
|
||||
echo "$label.value $value"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue