mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
remove plugins existing in the main munin distribution
This commit is contained in:
parent
b084f05b70
commit
62d43835d4
19 changed files with 0 additions and 3254 deletions
|
@ -1,175 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp__netapp_diskusage_ - Munin plugin to retrieve file systems usage on
|
||||
NetApp storage appliances.
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
File systems usage 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 file systems usage. This can help you monitoring file
|
||||
systems usage in a given period of time.
|
||||
|
||||
=head1 MIB INFORMATION
|
||||
|
||||
This plugin requires support for the NETWORK-APPLIANCE-MIB issued by
|
||||
Network Appliance. It reports the content of the DfEntry OID.
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
v1.0 - 06/22/2009 14:05:03 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 them 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 = (
|
||||
|
||||
# - dfHigh.* : 32 most significant bits counters
|
||||
# - dfLow.* : 32 least significant bits counters
|
||||
|
||||
dfHighTotalKBytes => '1.3.6.1.4.1.789.1.5.4.1.14.',
|
||||
dfLowTotalKBytes => '1.3.6.1.4.1.789.1.5.4.1.15.',
|
||||
dfHighUsedKBytes => '1.3.6.1.4.1.789.1.5.4.1.16.',
|
||||
dfLowUsedKBytes => '1.3.6.1.4.1.789.1.5.4.1.17.',
|
||||
dfHighAvailKBytes => '1.3.6.1.4.1.789.1.5.4.1.18.',
|
||||
dfLowAvailKBytes => '1.3.6.1.4.1.789.1.5.4.1.19.',
|
||||
|
||||
);
|
||||
|
||||
sub to_32bit_int {
|
||||
my ($l, $h) = @_;
|
||||
return "U" if ((!defined $l) || (!defined $h));
|
||||
my $bin = unpack( 'B32', pack('N', $l) . pack('N', $h) );
|
||||
return unpack( 'N', pack('B32', $bin) );
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
|
||||
print "number 1.3.6.1.4.1.789.1.5.6.0\n";
|
||||
print "index 1.3.6.1.4.1.789.1.5.4.1.1.\n";
|
||||
foreach (keys %oids) {
|
||||
print "require $oids{$_} [0-9]\n";
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $session = Munin::Plugin::SNMP->session();
|
||||
my ($host, undef, undef, $tail) = Munin::Plugin::SNMP->config_session();
|
||||
my ($df_id, $name_oid);
|
||||
|
||||
if ($tail =~ /^netapp_diskusage_(\d+)$/) {
|
||||
$df_id = $1;
|
||||
$name_oid = '1.3.6.1.4.1.789.1.5.4.1.2.' . $df_id;
|
||||
} else {
|
||||
die "Couldn't understand what I'm supposed to monitor";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
my $df_name = $session->get_single($name_oid);
|
||||
|
||||
print "host_name $host\n" unless $host eq 'localhost';
|
||||
print "graph_title $host disk usage on $df_name\n";
|
||||
print "graph_args --base 1024 --lower-limit 0\n";
|
||||
print "graph_vlabel bytes\n";
|
||||
print "graph_category disk\n";
|
||||
print "graph_info This graph shows the disk usage for $df_name on NetApp host $host\n";
|
||||
print "graph_order used avail total\n";
|
||||
print "used.info The total disk space in KBytes that is in use on the $df_name file system.\n";
|
||||
print "used.type GAUGE\n";
|
||||
print "used.draw AREA\n";
|
||||
print "used.label Used\n";
|
||||
print "used.cdef used,1024,*\n";
|
||||
print "used.min 0\n";
|
||||
print "used.colour $palette[1]\n";
|
||||
print "avail.info The total disk space in KBytes that is free for use on the $df_name file system.\n";
|
||||
print "avail.type GAUGE\n";
|
||||
print "avail.draw STACK\n";
|
||||
print "avail.label Available\n";
|
||||
print "avail.cdef avail,1024,*\n";
|
||||
print "avail.min 0\n";
|
||||
print "avail.colour $palette[3]\n";
|
||||
print "total.info The total capacity in KBytes for the $df_name file system.\n";
|
||||
print "total.type GAUGE\n";
|
||||
print "total.draw LINE2\n";
|
||||
print "total.label Total\n";
|
||||
print "total.cdef total,1024,*\n";
|
||||
print "total.min 0\n";
|
||||
print "total.colour $palette[7]\n";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $used_l = $session->get_single($oids{dfLowUsedKBytes}.$df_id);
|
||||
my $used_h = $session->get_single($oids{dfHighUsedKBytes}.$df_id);
|
||||
my $avail_l = $session->get_single($oids{dfLowAvailKBytes}.$df_id);
|
||||
my $avail_h = $session->get_single($oids{dfHighAvailKBytes}.$df_id);
|
||||
my $total_l = $session->get_single($oids{dfLowTotalKBytes}.$df_id);
|
||||
my $total_h = $session->get_single($oids{dfHighTotalKBytes}.$df_id);
|
||||
|
||||
my $used = to_32bit_int($used_l, $used_h);
|
||||
my $avail = to_32bit_int($avail_l, $avail_h);
|
||||
my $total = to_32bit_int($total_l, $total_h);
|
||||
|
||||
print "used.value $used\n";
|
||||
print "avail.value $avail\n";
|
||||
print "total.value $total\n";
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
|
@ -1,144 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
=head1 NAME
|
||||
|
||||
snmp__netapp_inodeusage_ - Munin plugin to retrieve inodes usage on
|
||||
NetApp storage appliances.
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Inodes usage 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 MIB INFORMATION
|
||||
|
||||
This plugin requires support for the NETWORK-APPLIANCE-MIB issued by
|
||||
Network Appliance. It reports the content of the DfEntry OID.
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
v1.0 - 06/22/2009 14:05:03 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 them 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 = (
|
||||
dfInodesUsed => '1.3.6.1.4.1.789.1.5.4.1.7.',
|
||||
dfInodesFree => '1.3.6.1.4.1.789.1.5.4.1.8.',
|
||||
);
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') {
|
||||
print "number 1.3.6.1.4.1.789.1.5.6.0\n";
|
||||
print "index 1.3.6.1.4.1.789.1.5.4.1.1.\n";
|
||||
foreach (keys %oids) {
|
||||
print "require $oids{$_} [0-9]\n";
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $session = Munin::Plugin::SNMP->session();
|
||||
my ($host, undef, undef, $tail) = Munin::Plugin::SNMP->config_session();
|
||||
my ($df_id, $name_oid);
|
||||
|
||||
if ($tail =~ /^netapp_inodeusage_(\d+)$/) {
|
||||
$df_id = $1;
|
||||
$name_oid = '1.3.6.1.4.1.789.1.5.4.1.2.' . $df_id;
|
||||
} else {
|
||||
die "Couldn't understand what I'm supposed to monitor";
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config") {
|
||||
my $df_name = $session->get_single($name_oid);
|
||||
|
||||
print "host_name $host\n" unless $host eq 'localhost';
|
||||
print "graph_title $host inodes usage on $df_name\n";
|
||||
print "graph_args --base 1000 --lower-limit 0\n";
|
||||
print "graph_vlabel bytes\n";
|
||||
print "graph_category disk\n";
|
||||
print "graph_info This graph shows the inodes usage for $df_name on NetApp host $host\n";
|
||||
print "graph_order used avail total\n";
|
||||
print "used.info The total inodes number of inodes in use on the $df_name file system.\n";
|
||||
print "used.type GAUGE\n";
|
||||
print "used.draw AREA\n";
|
||||
print "used.label Used\n";
|
||||
print "used.min 0\n";
|
||||
print "used.colour $palette[1]\n";
|
||||
print "avail.info The total number of inodes that are free for use on the $df_name file system.\n";
|
||||
print "avail.type GAUGE\n";
|
||||
print "avail.draw STACK\n";
|
||||
print "avail.label Available\n";
|
||||
print "avail.min 0\n";
|
||||
print "avail.colour $palette[3]\n";
|
||||
print "total.info The total capacity for the $df_name file system.\n";
|
||||
print "total.type GAUGE\n";
|
||||
print "total.draw LINE2\n";
|
||||
print "total.label Total\n";
|
||||
print "total.min 0\n";
|
||||
print "total.colour $palette[7]\n";
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $used = $session->get_single($oids{dfInodesUsed}.$df_id);
|
||||
my $avail = $session->get_single($oids{dfInodesFree}.$df_id);
|
||||
my $total = $used + $avail;
|
||||
|
||||
print "used.value $used\n";
|
||||
print "avail.value $avail\n";
|
||||
print "total.value $total\n";
|
||||
|
||||
exit 0;
|
||||
|
||||
__END__
|
|
@ -1,172 +0,0 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Copyright (C) 2006 Lars Strand
|
||||
#
|
||||
# Munin plugin to monitor swap usage by use of SNMP.
|
||||
# Based on the snmp__df plugin
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; version 2 dated June,
|
||||
# 1991.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# $Log$
|
||||
#
|
||||
#%# family=snmpauto
|
||||
#%# capabilities=snmpconf
|
||||
|
||||
use strict;
|
||||
use Net::SNMP;
|
||||
|
||||
my $DEBUG = 0;
|
||||
my $MAXLABEL = 20;
|
||||
|
||||
my $host = $ENV{host} || undef;
|
||||
my $port = $ENV{port} || 161;
|
||||
my $community = $ENV{community} || "public";
|
||||
my $iface = $ENV{interface} || undef;
|
||||
|
||||
my $response;
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "snmpconf")
|
||||
{
|
||||
# HOST-RESOURCES-MIB::hrStorage
|
||||
# HOST-RESOURCES-TYPES::hrStorageVirtualMemory
|
||||
print "require 1.3.6.1.2.1.25.2. 1.3.6.1.2.1.25.2.1.3\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ($0 =~ /^(?:|.*\/)snmp_([^_]+)_swap$/)
|
||||
{
|
||||
$host = $1;
|
||||
if ($host =~ /^([^:]+):(\d+)$/)
|
||||
{
|
||||
$host = $1;
|
||||
$port = $2;
|
||||
}
|
||||
}
|
||||
elsif (!defined($host))
|
||||
{
|
||||
print "# Debug: $0 -- $1\n" if $DEBUG;
|
||||
die "# Error: couldn't understand what I'm supposed to monitor.";
|
||||
}
|
||||
|
||||
my ($session, $error) = Net::SNMP->session(
|
||||
-hostname => $host,
|
||||
-community => $community,
|
||||
-port => $port
|
||||
);
|
||||
|
||||
if (!defined ($session))
|
||||
{
|
||||
die "Croaking: $error";
|
||||
}
|
||||
|
||||
my $hrStorage = "1.3.6.1.2.1.25.2.";
|
||||
my $hrStorageVirtualMemory = "1.3.6.1.2.1.25.2.1.3";
|
||||
my $hrStorageSize = "1.3.6.1.2.1.25.2.3.1.5.";
|
||||
my $hrStorageUsed = "1.3.6.1.2.1.25.2.3.1.6.";
|
||||
|
||||
my $swap_d = get_by_regex($session, $hrStorage, $hrStorageVirtualMemory);
|
||||
|
||||
my $swapsize = 0; my $swapused = 0;
|
||||
|
||||
foreach my $swap (keys %$swap_d)
|
||||
{
|
||||
$swapsize += get_single($session, $hrStorageSize . $swap);
|
||||
$swapused += get_single($session, $hrStorageUsed . $swap);
|
||||
}
|
||||
|
||||
if (defined $ARGV[0] and $ARGV[0] eq "config")
|
||||
{
|
||||
print "host_name $host\n";
|
||||
print "graph_title Virtual memory usage\n";
|
||||
if ($swapsize > 0)
|
||||
{
|
||||
print "graph_args -l 0 --base 1000 --upper-limit $swapsize\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "graph_args -l 0 --base 1000\n";
|
||||
}
|
||||
print "graph_vlabel Bytes\n";
|
||||
print "graph_category disk\n";
|
||||
print "graph_info This graph shows swap usage in bytes.\n";
|
||||
print "swap.label swap\n";
|
||||
print "swap.type DERIVE\n";
|
||||
print "swap.min 0\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
print "swap.value $swapused\n";
|
||||
|
||||
sub get_single
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
|
||||
print "# Getting single $oid..." if $DEBUG;
|
||||
|
||||
$response = $handle->get_request ($oid);
|
||||
|
||||
if (!defined $response->{$oid})
|
||||
{
|
||||
print "undef\n" if $DEBUG;
|
||||
return undef;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\"$response->{$oid}\"\n" if $DEBUG;
|
||||
return $response->{$oid};
|
||||
}
|
||||
}
|
||||
|
||||
sub get_by_regex
|
||||
{
|
||||
my $handle = shift;
|
||||
my $oid = shift;
|
||||
my $regex = shift;
|
||||
my $result = {};
|
||||
my $num = 0;
|
||||
my $ret = $oid . "0";
|
||||
my $response;
|
||||
|
||||
print "# Starting browse of $oid...\n" if $DEBUG;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if ($num == 0)
|
||||
{
|
||||
print "# Checking for $ret...\n" if $DEBUG;
|
||||
$response = $handle->get_request ($ret);
|
||||
}
|
||||
if ($num or !defined $response)
|
||||
{
|
||||
print "# Checking for sibling of $ret...\n" if $DEBUG;
|
||||
$response = $handle->get_next_request ($ret);
|
||||
}
|
||||
if (!$response)
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
my @keys = keys %$response;
|
||||
$ret = $keys[0];
|
||||
print "# Analyzing $ret (compared to $oid)...\n" if $DEBUG;
|
||||
last unless ($ret =~ /^$oid/);
|
||||
$num++;
|
||||
next unless ($response->{$ret} =~ /$regex/);
|
||||
@keys = split (/\./, $ret);
|
||||
$result->{$keys[-1]} = $response->{$ret};;
|
||||
print "# Index $num: ", $keys[-1], " (", $response->{$ret}, ")\n" if $DEBUG;
|
||||
};
|
||||
return $result;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue