mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
184 lines
5.4 KiB
Perl
Executable File
184 lines
5.4 KiB
Perl
Executable File
#!/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";
|
|
# graph_category netapp # To show plugin in Gallery also in this category
|
|
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__
|