Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / snmp / snmp__netapp_cifscalls @ 0ddf0181

Historique | Voir | Annoter | Télécharger (3,38 ko)

1
#!/usr/bin/perl
2
# -*- perl -*-
3
# vim: ft=perl
4

    
5
=head1 NAME
6

    
7
snmp__netapp_cifscalls -  Munin plugin to retrieve cifs calls types stats from NetApp storage appliances.
8

    
9
=head1 APPLICABLE SYSTEMS
10

    
11
cifs calls stats 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 calls by type.
33
This can help you determine what calls types are killing your appliance under heavy
34
loads.
35

    
36
=head1 MIB INFORMATION
37

    
38
This plugin requires support for the NETWORK-APPLIANCE-MIB issued by
39
Network Appliance. It reports the content of the cifs OID.
40

    
41
=head1 MAGIC MARKERS
42

    
43
    #%# family=snmpauto
44
    #%# capabilities=snmpconf
45

    
46
=head1 BUGS
47

    
48
This plugin wasn't tested on many hardware and only on Ontap 7.3.x.
49

    
50
=head1 AUTHOR
51

    
52
2013, Claudius Herder
53
NetApp is a registered trademark and Network Appliance is a trademark
54
of Network Appliance, Inc. in the U.S. and other countries.
55

    
56
=head1 LICENSE
57

    
58
GPLv2.
59

    
60
=cut
61

    
62
 use strict;
63
 use warnings;
64
 use Munin::Plugin::SNMP;
65

    
66
my %oids =
67
(
68
    cifsBadCalls => 'BadCalls',
69
    cifsGetAttrs => 'GetAttrs',
70
    cifsReads    => 'Reads',
71
    cifsWrites   => 'Writes',
72
    cifsLocks    => 'Locks',
73
    cifsOpens    => 'Opens',
74
    cifsDirOps   => 'DirOps',
75
    cifsOthers   => 'Others',
76
    cifsSetAttrs => 'SetAttr',
77
);
78

    
79
if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf')
80
{
81
    print "require 1.3.6.1.4.1.789.1.7.3.1.1. [0-9]\n";
82
    exit 0;
83
}
84

    
85
my $session = Munin::Plugin::SNMP->session();
86

    
87
if (defined $ARGV[0] and $ARGV[0] eq "config")
88
{
89
    my ($host, undef, undef, undef) = Munin::Plugin::SNMP->config_session();
90
    print "host_name $host\n" unless $host eq 'localhost';
91
    print "graph_title $host CIFS calls\n";
92
    print "graph_args --base 1000 --lower-limit 0 --rigid\n";
93
    print "graph_vlabel calls / \${graph_period}\n";
94
    print "graph_category cifs\n";
95
    print "graph_info This graph shows cifs calls for the $host NetApp equipment.\n";
96
    print "graph_order ";
97
    foreach (sort keys %oids)
98
    {
99
        print "$_ ";
100
    }
101
    print "\n";
102
    foreach my $k (sort keys %oids)
103
    {
104
        print "$k.info The number of cifs calls received for the $oids{$k} procedure, since the last time the statistics were cleared.\n";
105
        print "$k.type COUNTER\n";
106
        print "$k.label $oids{$k}\n";
107
        print "$k.min 0\n";
108
    }
109
    exit 0;
110
}
111

    
112
my $values = $session->get_hash
113
(
114
    -baseoid => '1.3.6.1.4.1.789.1.7.3.1.1',
115
    -cols =>
116
    {
117
         1 => 'cifsTotalOps',
118
         2 => 'cifsTotalCalls',
119
         3 => 'cifsBadCalls',
120
         4 => 'cifsGetAttrs',
121
         5 => 'cifsReads',
122
         6 => 'cifsWrites',
123
         7 => 'cifsLocks',
124
         8 => 'cifsOpens',
125
         9 => 'cifsDirOps',
126
        10 => 'cifsOthers',
127
        11 => 'cifsSetAttrs',
128
    },
129
);
130

    
131
foreach my $k (keys %oids)
132
{
133
    my $v = 'U';
134
    $v = $values->{0}->{$k} if (defined $values);
135
    print "$k.value $v\n";
136
}
137

    
138
exit 0;
139

    
140
__END__