1 # Copyright (C) 2004 Shawn Ferry
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17 # $Id: NetApp.pm,v 1.1 2010-12-27 00:03:55 ivan Exp $
18 # Shawn Ferry <sferry at sevenspace dot com> <lalartu at obscure dot org>
20 # NetApp.com storage products
22 package Torrus::DevDiscover::NetApp;
28 $Torrus::DevDiscover::registry{'NetApp'} = {
30 'checkdevtype' => \&checkdevtype,
31 'discover' => \&discover,
32 'buildConfig' => \&buildConfig
37 'netapp' => '1.3.6.1.4.1.789',
38 'netapp1' => '1.3.6.1.4.1.789.1',
39 'netappProducts' => '1.3.6.1.4.1.789.2',
42 'netapp_product' => '1.3.6.1.4.1.789.1.1',
43 'netapp_productVersion' => '1.3.6.1.4.1.789.1.1.2.0',
44 'netapp_productId' => '1.3.6.1.4.1.789.1.1.3.0',
45 'netapp_productModel' => '1.3.6.1.4.1.789.1.1.5.0',
46 'netapp_productFirmwareVersion' => '1.3.6.1.4.1.789.1.1.6.0',
49 'netapp_sysStat' => '1.3.6.1.4.1.789.1.2',
50 'netapp_sysStat_cpuCount' => '1.3.6.1.4.1.789.1.2.1.6.0',
53 'netapp_nfs' => '1.3.6.1.4.1.789.1.3',
54 'netapp_nfsIsLicensed' => '1.3.6.1.4.1.789.1.3.3.1.0',
56 # At a glance Lookup values seem to be the most common as opposed to
57 # collecting NFS stats for v2 and v3 (and eventually v4 ) if No lookups
58 # have been performed at discovery time we assume that vX is not in use.
59 'netapp_tv2cLookups' => '1.3.6.1.4.1.789.1.3.2.2.3.1.5.0',
60 'netapp_tv3cLookups' => '1.3.6.1.4.1.789.1.3.2.2.4.1.4.0',
63 'netapp_cifs' => '1.3.6.1.4.1.789.1.7',
64 'netapp_cifsIsLicensed' => '1.3.6.1.4.1.789.1.7.21.0',
66 # 4 - 19 should also be interesting
67 # particularly cluster netcache stats
70 # netappFiler OBJECT IDENTIFIER ::= { netappProducts 1 }
71 # netappNetCache OBJECT IDENTIFIER ::= { netappProducts 2 }
72 # netappClusteredFiler OBJECT IDENTIFIER ::= { netappProducts 3 }
77 my $devdetails = shift;
79 return $dd->checkSnmpTable( 'netapp' );
86 my $devdetails = shift;
88 my $session = $dd->session();
89 my $data = $devdetails->data();
91 my $result = $dd->retrieveSnmpOIDs
92 ( 'netapp_productModel', 'netapp_productId',
93 'netapp_productVersion', 'netapp_productFirmwareVersion',
94 'netapp_nfsIsLicensed', 'netapp_cifsIsLicensed',
95 'netapp_tv2cLookups', 'netapp_tv3cLookups' );
97 $data->{'param'}->{'comment'} =
98 sprintf('%s %s: %s %s',
99 $result->{'netapp_productModel'},
100 $result->{'netapp_productId'},
101 $result->{'netapp_productVersion'},
102 $result->{'netapp_productFirmwareVersion'});
104 # At a glance Lookup values seem to be the most common as opposed to
105 # collecting NFS stats for v2 and v3 (and eventually v4 ) if No lookups
106 # have been performed at discovery time we assume that nfsvX is not in use.
108 if( $result->{'netapp_nfsIsLicensed'} == 2 )
110 if( $result->{'netapp_tv2cLookups'} > 0 )
112 $devdetails->setCap('NetApp::nfsv2');
115 if( $result->{'netapp_tv3cLookups'} > 0 )
117 $devdetails->setCap('NetApp::nfsv3');
121 if( $result->{'netapp_cifsIsLicensed'} == 2 )
123 $devdetails->setCap('NetApp::cifs');
132 my $devdetails = shift;
135 my $data = $devdetails->data();
137 $cb->addParams( $devNode, $data->{'params'} );
140 $cb->addTemplateApplication( $devNode, 'NetApp::CPU');
143 $cb->addTemplateApplication( $devNode, 'NetApp::misc');
145 if( $devdetails->hasCap('NetApp::nfsv2') )
147 $cb->addTemplateApplication( $devNode, 'NetApp::nfsv2');
150 if( $devdetails->hasCap('NetApp::nfsv3') )
152 $cb->addTemplateApplication( $devNode, 'NetApp::nfsv3');
155 if( $devdetails->hasCap('NetApp::cifs') )
157 Debug("Would add cifs here\n");
158 #$cb->addTemplateApplication( $devNode, 'NetApp::cifs');
168 # indent-tabs-mode: nil
169 # perl-indent-level: 4