root / plugins / snmp / snmp__netapp_net @ 81db94e2
Historique | Voir | Annoter | Télécharger (3,07 ko)
| 1 |
#!/usr/bin/perl |
|---|---|
| 2 |
# -*- perl -*- |
| 3 |
# vim: ft=perl |
| 4 |
|
| 5 |
=head1 NAME |
| 6 |
|
| 7 |
snmp__netapp_cifs - Munin plugin to retrieve general cifs information from NetApp storage appliances. |
| 8 |
|
| 9 |
=head1 APPLICABLE SYSTEMS |
| 10 |
|
| 11 |
cifs should be reported by any NetApp storage appliance |
| 12 |
with SNMP agent daemon activated. See na_snmp(8) for details. |
| 13 |
|
| 14 |
=head1 CONFIGURATION |
| 15 |
|
| 16 |
Unfortunately, SNMPv3 is not fully supported on all NetApp equipments. |
| 17 |
For this reason, this plugin will use SNMPv2 by default, which is |
| 18 |
insecure because it doesn't encrypt the community string. |
| 19 |
|
| 20 |
The following parameters will help you get this plugin working : |
| 21 |
|
| 22 |
[snmp_*] |
| 23 |
env.community MyCommunity |
| 24 |
|
| 25 |
If your community name is 'public', you should really worry about |
| 26 |
security and immediately reconfigure your appliance. |
| 27 |
|
| 28 |
Please see 'perldoc Munin::Plugin::SNMP' for further configuration. |
| 29 |
|
| 30 |
=head1 INTERPRETATION |
| 31 |
|
| 32 |
The plugin reports various cifs connections, users and open files. |
| 33 |
|
| 34 |
=head1 MIB INFORMATION |
| 35 |
|
| 36 |
This plugin requires support for the NETWORK-APPLIANCE-MIB issued by |
| 37 |
Network Appliance. It reports the content of the cifs OID. |
| 38 |
|
| 39 |
=head1 MAGIC MARKERS |
| 40 |
|
| 41 |
#%# family=snmpauto |
| 42 |
#%# capabilities=snmpconf |
| 43 |
|
| 44 |
=head1 BUGS |
| 45 |
|
| 46 |
This plugin wasn't tested on many hardware and only on Ontap 7.3.x. |
| 47 |
|
| 48 |
=head1 AUTHOR |
| 49 |
|
| 50 |
2013, Claudius Herder |
| 51 |
NetApp is a registered trademark and Network Appliance is a trademark |
| 52 |
of Network Appliance, Inc. in the U.S. and other countries. |
| 53 |
|
| 54 |
=head1 LICENSE |
| 55 |
|
| 56 |
GPLv2. |
| 57 |
|
| 58 |
=cut |
| 59 |
|
| 60 |
use strict; |
| 61 |
use warnings; |
| 62 |
use Munin::Plugin::SNMP; |
| 63 |
|
| 64 |
my %oids = |
| 65 |
( |
| 66 |
misc64NetRcvdBytes => 'NET_NETRCVDBYTES', |
| 67 |
misc64NetSentBytes => 'NET_NETSENTBYTES', |
| 68 |
); |
| 69 |
|
| 70 |
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') |
| 71 |
{
|
| 72 |
print "require 1.3.6.1.4.1.789.1.2.2.1.0 [0-9]\n"; |
| 73 |
exit 0; |
| 74 |
} |
| 75 |
|
| 76 |
my $session = Munin::Plugin::SNMP->session(); |
| 77 |
|
| 78 |
if (defined $ARGV[0] and $ARGV[0] eq "config") |
| 79 |
{
|
| 80 |
my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session(); |
| 81 |
print "host_name $host\n" unless $host eq 'localhost'; |
| 82 |
print "graph_title $host Network interface traffic\n"; |
| 83 |
print "graph_args --base 1000\n"; |
| 84 |
print "graph_vlabel Bytes in (-) / out (+) per \${graph_period}\n";
|
| 85 |
# graph_category netapp # To show plugin in Gallery also in this category |
| 86 |
print "graph_category network\n"; |
| 87 |
print "graph_info This graph shows net stats for the $host NetApp equipment.\n"; |
| 88 |
print "graph_order misc64NetRcvdBytes misc64NetSentBytes\n"; |
| 89 |
print "misc64NetRcvdBytes.type COUNTER\n"; |
| 90 |
print "misc64NetRcvdBytes.min 0\n"; |
| 91 |
print "misc64NetRcvdBytes.graph no\n"; |
| 92 |
print "misc64NetRcvdBytes.label bps\n"; |
| 93 |
print "misc64NetSentBytes.type COUNTER\n"; |
| 94 |
print "misc64NetSentBytes.label bps\n"; |
| 95 |
print "misc64NetSentBytes.min 0\n"; |
| 96 |
print "misc64NetSentBytes.negative misc64NetRcvdBytes\n"; |
| 97 |
print "misc64NetSentBytes.info misc64NetRcvdBytes/misc64NetSentBytes\n"; |
| 98 |
exit 0; |
| 99 |
} |
| 100 |
|
| 101 |
my $values = $session->get_hash |
| 102 |
( |
| 103 |
-baseoid => '1.3.6.1.4.1.789.1.2.2', |
| 104 |
-cols => |
| 105 |
{
|
| 106 |
30 => 'misc64NetRcvdBytes', |
| 107 |
31 => 'misc64NetSentBytes', |
| 108 |
}, |
| 109 |
); |
| 110 |
|
| 111 |
foreach my $k (keys %oids) |
| 112 |
{
|
| 113 |
my $v = 'U'; |
| 114 |
$v = $values->{0}->{$k} if (defined $values);
|
| 115 |
print "$k.value $v\n"; |
| 116 |
} |
| 117 |
|
| 118 |
exit 0; |
| 119 |
|
| 120 |
__END__ |
