root / plugins / netapp / snmp__netapp_diskutil @ 09b88141
Historique | Voir | Annoter | Télécharger (3,1 ko)
| 1 | de8aa961 | Claudius | #!/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 | 8713eb37 | Lars Kruse | Unfortunately, SNMPv3 is not fully supported on all NetApp equipment. |
| 17 | de8aa961 | Claudius | 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 | 09b88141 | Lars Kruse | [snmp_*] |
| 23 | env.community MyCommunity |
||
| 24 | de8aa961 | Claudius | |
| 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 | 09b88141 | Lars Kruse | #%# family=snmpauto |
| 42 | #%# capabilities=snmpconf |
||
| 43 | de8aa961 | Claudius | |
| 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 | 09b88141 | Lars Kruse | |
| 52 | de8aa961 | Claudius | NetApp is a registered trademark and Network Appliance is a trademark |
| 53 | of Network Appliance, Inc. in the U.S. and other countries. |
||
| 54 | |||
| 55 | =head1 LICENSE |
||
| 56 | |||
| 57 | GPLv2. |
||
| 58 | |||
| 59 | =cut |
||
| 60 | |||
| 61 | use strict; |
||
| 62 | use warnings; |
||
| 63 | use Munin::Plugin::SNMP; |
||
| 64 | |||
| 65 | my %oids = |
||
| 66 | ( |
||
| 67 | misc64DiskReadBytes => 'DISKUTIL_DISKREADBYTES', |
||
| 68 | misc64DiskWriteBytes => 'DISKUTIL_DISKWRITEBYTES', |
||
| 69 | ); |
||
| 70 | |||
| 71 | if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf') |
||
| 72 | {
|
||
| 73 | print "require 1.3.6.1.4.1.789.1.2.2.1.0 [0-9]\n"; |
||
| 74 | exit 0; |
||
| 75 | } |
||
| 76 | |||
| 77 | my $session = Munin::Plugin::SNMP->session(); |
||
| 78 | |||
| 79 | if (defined $ARGV[0] and $ARGV[0] eq "config") |
||
| 80 | {
|
||
| 81 | my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session(); |
||
| 82 | print "host_name $host\n" unless $host eq 'localhost'; |
||
| 83 | print "graph_title $host Disk throughput\n"; |
||
| 84 | print "graph_args --base 1024\n"; |
||
| 85 | print "graph_vlabel Bytes/\${graph_period} write (-) / read (+)\n";
|
||
| 86 | f523f095 | dipohl | # graph_category san # To show plugin in Gallery also in this category |
| 87 | de8aa961 | Claudius | print "graph_category disk\n"; |
| 88 | print "graph_info This graph shows DiskUtil calls for the $host NetApp equipment.\n"; |
||
| 89 | print "graph_order misc64DiskWriteBytes misc64DiskReadBytes\n"; |
||
| 90 | print "misc64DiskWriteBytes.type COUNTER\n"; |
||
| 91 | print "misc64DiskWriteBytes.label bps\n"; |
||
| 92 | print "misc64DiskWriteBytes.min 0\n"; |
||
| 93 | print "misc64DiskWriteBytes.graph no\n"; |
||
| 94 | print "misc64DiskReadBytes.type COUNTER\n"; |
||
| 95 | print "misc64DiskReadBytes.min 0\n"; |
||
| 96 | print "misc64DiskReadBytes.label bps\n"; |
||
| 97 | print "misc64DiskReadBytes.negative misc64DiskWriteBytes\n"; |
||
| 98 | print "misc64DiskReadBytes.info misc64DiskWriteBytes/misc64DiskReadBytes\n"; |
||
| 99 | exit 0; |
||
| 100 | } |
||
| 101 | |||
| 102 | my $values = $session->get_hash |
||
| 103 | ( |
||
| 104 | -baseoid => '1.3.6.1.4.1.789.1.2.2', |
||
| 105 | -cols => |
||
| 106 | {
|
||
| 107 | 32 => 'misc64DiskReadBytes', |
||
| 108 | 33 => 'misc64DiskWriteBytes', |
||
| 109 | }, |
||
| 110 | ); |
||
| 111 | |||
| 112 | foreach my $k (keys %oids) |
||
| 113 | {
|
||
| 114 | my $v = 'U'; |
||
| 115 | $v = $values->{0}->{$k} if (defined $values);
|
||
| 116 | print "$k.value $v\n"; |
||
| 117 | } |
||
| 118 | |||
| 119 | exit 0; |
||
| 120 | |||
| 121 | __END__ |
