1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

- have some dirs

This commit is contained in:
Steve Schnepp 2012-02-13 18:24:46 +01:00
parent 0b089ea777
commit 08346aac58
687 changed files with 0 additions and 0 deletions

69
plugins/nfs/nfs4_client Executable file
View file

@ -0,0 +1,69 @@
#!/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"
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"
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 NFS4 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 proc4 $NFS \
| cut -f $i -d ' ' \
| awk '{print $1}'
i=$(expr $i + 1)
done

77
plugins/nfs/nfsv4 Executable file
View file

@ -0,0 +1,77 @@
#!/bin/sh
#
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk and Richard Dumais
#
# $Log$
# Revision 1.9.2.2 2008/03/06 20:00:00 nerux
# Modify script for nfsv4
#
# Revision 1.9.2.1 2005/03/16 13:45:45 ilmari
# Fix autoconf for linux/{nfsd,nfs_client}.
#
# Revision 1.9 2004/12/10 10:47:49 jimmyo
# Change name from ${scale} to ${graph_period}, to be more consistent.
#
# Revision 1.8 2004/12/09 22:12:56 jimmyo
# Added "graph_period" option, to make "graph_sums" usable.
#
# Revision 1.7 2004/11/21 00:17:12 jimmyo
# Changed a lot of plugins so they use DERIVE instead of COUNTER.
#
# Revision 1.6 2004/10/01 12:32:09 ilmari
# complete "rpc" removal
#
# Revision 1.5 2004/10/01 08:40:50 ilmari
# Remove useless 'rpc' field, add total field
#
# Revision 1.4 2004/05/20 19:02:37 jimmyo
# Set categories on a bunch of plugins
#
# Revision 1.3 2004/05/15 21:33:29 jimmyo
# "Upped" som plugins from contrib/manual to manual or auto.
#
# Revision 1.2 2004/05/06 21:55:18 jimmyo
# Added patch to contrib-plugin linux/nfsd, to graph rpc count (Alexandre Dupouy).
#
# Revision 1.1 2004/02/18 18:41:54 jimmyo
# Plugin created by Alexandre Dupouy, with the assistance of Mike Fedyk
#
#
#%# family=auto
#%# capabilities=config
NFSD=/proc/net/rpc/nfsd
#proc="getattr setattr lookup access readlink read write create mkdir symlink mknod remove rmdir rename link readdir readdirplus fsstat fsinfo pathconf commit"
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"
if [ "$1" = "autoconf" ]; then
if [ -f "$NFSD" ]; then
echo yes
exit 0
else
echo "no (no $NFSD)"
exit 1
fi
fi
if [ "$1" = "config" ]; then
echo 'graph_title NFS Server'
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=6;
for a in $proc; do
echo -n "$a.value "
grep proc4ops $NFSD \
| cut -f $i -d ' ' \
| awk '{print $1}'
i=$(expr $i + 1)
done

View file

@ -0,0 +1,182 @@
#!/usr/bin/perl
=head1 NAME
snmp__netapp_nfs3calls - Munin plugin to retrieve NFSv3 calls types
stats from NetApp storage appliances.
=head1 APPLICABLE SYSTEMS
NFSv3 calls stats should be reported by any NetApp storage appliance
with SNMP agent daemon activated. See na_snmp(8) for details.
=head1 CONFIGURATION
Unfortunately, SNMPv3 is not fully supported on all NetApp equipments.
For this reason, this plugin will use SNMPv2 by default, which is
insecure because it doesn't encrypt the community string.
The following parameters will help you get this plugin working :
[snmp_*]
env.community MyCommunity
If your community name is 'public', you should really worry about
security and immediately reconfigure your appliance.
Please see 'perldoc Munin::Plugin::SNMP' for further configuration.
=head1 INTERPRETATION
The plugin reports various NFSv3 calls by type. This can help you
determine what calls types are killing your appliance under heavy
loads.
=head1 MIB INFORMATION
This plugin requires support for the NETWORK-APPLIANCE-MIB issued by
Network Appliance. It reports the content of the v3Calls OID.
=head1 MAGIC MARKERS
#%# family=snmpauto
#%# capabilities=snmpconf
=head1 VERSION
v1.0 - 06/19/2009 18:36:02 CEST
Initial revision
=head1 AUTHOR
This plugin is copyright (c) 2009 by Guillaume Blairon.
NetApp is a registered trademark and Network Appliance is a trademark
of Network Appliance, Inc. in the U.S. and other countries.
=head1 BUGS
This plugin wasn't tested on many hardware. If you encounter bugs,
please report any to Guillaume Blairon E<lt>L<g@yom.be>E<gt>.
=head1 LICENSE
GPLv2 or (at your option) any later version.
=cut
use strict;
use warnings;
use Munin::Plugin::SNMP;
use vars qw($DEBUG);
$DEBUG = $ENV{'MUNIN_DEBUG'};
my @palette =
#Better colours from munin 1.3.x
#Greens Blues Oranges Dk yel Dk blu Purple Lime Reds Gray
qw(00CC00 0066B3 FF8000 FFCC00 330099 990099 CCFF00 FF0000 808080
008F00 00487D B35A00 B38F00 6B006B 8FB300 B30000 BEBEBE
80FF80 80C9FF FFC080 FFE680 AA80FF EE00CC FF8080
666600 FFBFFF 00FFCC CC6699 999900);
my %oids = (
nulls => 'NFSPROC3_NULL (Do Nothing)',
getattrs => 'NFSPROC3_GETATTR (Get File Attributes)',
setattrs => 'NFSPROC3_SETATTR (Set File Attributes)',
lookups => 'NFSPROC3_LOOKUP (Lookup Filename)',
accesss => 'NFSPROC3_ACCESS (Check Access Permission)',
readlinks => 'NFSPROC3_READLINK (Read from Symbolic Link)',
reads => 'NFSPROC3_READ (Read from File)',
writes => 'NFSPROC3_WRITE (Write to File)',
creates => 'NFSPROC3_CREATE (Create a File)',
mkdirs => 'NFSPROC3_MKDIR (Create a Directory)',
symlinks => 'NFSPROC3_SYMLINK (Create a Symbolic Link)',
mknods => 'NFSPROC3_MKNOD (Create a Special Device)',
removes => 'NFSPROC3_REMOVE (Remove a File)',
rmdirs => 'NFSPROC3_RMDIR (Remove a Directory)',
renames => 'NFSPROC3_RENAME (Rename a File or Directory)',
links => 'NFSPROC3_LINK (Create Link to an Object)',
readdirs => 'NFSPROC3_READDIR (Read from Directory)',
readdirpluss => 'NFSPROC3_READDIRPLUS (Extended Read from Directory)',
fsstats => 'NFSPROC3_FSSTAT (Get Dynamic File System Information)',
fsinfos => 'NFSPROC3_FSINFO (Get Static File System Information)',
pathconfs => 'NFSPROC3_PATHCONF (Retrieve POSIX Information)',
commits => 'NFSPROC3_COMMIT (Commit Cached Data on a Server to Stable Storage)',
);
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
print "require 1.3.6.1.4.1.789.1.3.1.2.4.1.1.0 [0-9]\n";
exit 0;
}
my $session = Munin::Plugin::SNMP->session();
if (defined $ARGV[0] and $ARGV[0] eq "config") {
my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session();
print "host_name $host\n" unless $host eq 'localhost';
print "graph_title $host NFSv3 calls\n";
print "graph_args --base 1000\n";
print "graph_vlabel calls / \${graph_period}\n";
print "graph_category nfs\n";
print "graph_info This graph shows NFSv3 calls for the $host NetApp equipment.\n";
print "graph_order ";
foreach (sort keys %oids) { print "$_ "; }
print "\n";
my $c = 0;
foreach my $k (sort keys %oids) {
my $i = $oids{$k};
my $l = $k;
$l =~ s/s$//g;
print "$k.info The number of NFS Version 3 calls received for the $i procedure, since the last time the statistics were cleared.\n";
print "$k.type DERIVE\n";
print "$k.label $l\n";
print "$k.min 0\n";
print "$k.colour $palette[$c]\n";
$c++;
}
exit 0;
}
my $values = $session->get_hash(
-baseoid => '1.3.6.1.4.1.789.1.3.1.2.4.1',
-cols => {
1 => 'nulls',
2 => 'getattrs',
3 => 'setattrs',
4 => 'lookups',
5 => 'accesss',
6 => 'readlinks',
7 => 'reads',
8 => 'writes',
9 => 'creates',
10 => 'mkdirs',
11 => 'symlinks',
12 => 'mknods',
13 => 'removes',
14 => 'rmdirs',
15 => 'renames',
16 => 'links',
17 => 'readdirs',
18 => 'readdirpluss',
19 => 'fsstats',
20 => 'fsinfos',
21 => 'pathconfs',
22 => 'commits',
},
);
foreach my $k (keys %oids) {
my $v = 'U';
$v = $values->{0}->{$k} if (defined $values);
print "$k.value $v\n";
}
exit 0;
__END__