Repository
Munin (contrib)
Last change
2020-10-24
Graph Categories
Family
snmpauto
Capabilities
Keywords
Language
Perl
License
GPL-2.0-only
Authors

snmp__netapp_ops

Name

snmp__netapp_cifs - Munin plugin to retrieve general cifs information from NetApp storage appliances.

Applicable Systems

cifs should be reported by any NetApp storage appliance with SNMP agent daemon activated. See na_snmp(8) for details.

Configuration

Unfortunately, SNMPv3 is not fully supported on all NetApp equipment. 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.

Interpretation

The plugin reports various cifs connections, users and open files.

Mib Information

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

Magic Markers

#%# family=snmpauto
#%# capabilities=snmpconf

Bugs

This plugin wasn’t tested on many hardware and only on Ontap 7.3.x.

Author

2013, Claudius Herder

NetApp is a registered trademark and Network Appliance is a trademark of Network Appliance, Inc. in the U.S. and other countries.

License

GPLv2.

#!/usr/bin/perl
# -*- perl -*-
# vim: ft=perl

=head1 NAME

snmp__netapp_cifs -  Munin plugin to retrieve general cifs information from NetApp storage appliances.

=head1 APPLICABLE SYSTEMS

cifs 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 equipment.
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 cifs connections, users and open files.

=head1 MIB INFORMATION

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

=head1 MAGIC MARKERS

 #%# family=snmpauto
 #%# capabilities=snmpconf

=head1 BUGS

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

=head1 AUTHOR

2013, Claudius Herder

NetApp is a registered trademark and Network Appliance is a trademark
of Network Appliance, Inc. in the U.S. and other countries.

=head1 LICENSE

GPLv2.

=cut

use strict;
use warnings;
use Munin::Plugin::SNMP;

my %config =
(
    misc64CifsOps => 'CifsOps',
    misc64NfsOps  => 'NfsOps',
    iscsi64Ops    => 'IscsiOps',
    fcp64Ops      => 'FcpOps',
    misc64HttpOps => 'HttpOps',
);

if (defined $ARGV[0] and $ARGV[0] eq 'snmpconf')
{
    print "require 1.3.6.1.4.1.789.1.2.2.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 OPS \n";
    print "graph_args --base 1000 --lower-limit 0 --rigid\n";
    print "graph_vlabel OPS \n";
    print "graph_category fs\n";
    print "graph_info This graph shows OPS for the $host NetApp equipment.\n";
    print "graph_order misc64CifsOps misc64NfsOps iscsi64Ops fcp64Ops misc64HttpOps\n";
    foreach my $k (sort keys %config)
    {
        print "$k.info The number of OPS for $config{$k}.\n";
        print "$k.type COUNTER\n";
        print "$k.label $config{$k}\n";
        print "$k.min 0\n";
        print "$k.draw AREASTACK\n";
    }
    exit 0;
}

my $system = $session->get_hash
(
    -baseoid => '1.3.6.1.4.1.789.1.2.2',
    -cols =>
    {
        27 => 'misc64NfsOps',
        28 => 'misc64CifsOps',
        29 => 'misc64HttpOps',
    },
);

my $block = $session->get_hash
(
    -baseoid => '1.3.6.1.4.1.789.1.17',
    -cols =>
    {
        24 => 'iscsi64Ops',
        25 => 'fcp64Ops',
    },
);

my $tmp->{0} = { %{$system->{0}}, %{$block->{0}}} ;

foreach my $k (keys %config)
{
    my $v = 'U';
    $v = $tmp->{0}->{$k} if (defined $tmp);
    print "$k.value $v\n";
}

exit 0;

__END__