2 # Copyright (C) 2009 Jon Nistor
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 # $Id: Arista.pm,v 1.1 2010-12-27 00:03:49 ivan Exp $
19 # Jon Nistor <nistor at snickers.org>
21 # Force10 Networks Real Time Operating System Software
25 package Torrus::DevDiscover::Arista;
30 $Torrus::DevDiscover::registry{'Arista'} = {
32 'checkdevtype' => \&checkdevtype,
33 'discover' => \&discover,
34 'buildConfig' => \&buildConfig
40 'sysDescr' => '1.3.6.1.2.1.1.1.0',
42 'aristaProducts' => '1.3.6.1.4.1.30065.1'
47 # Not all interfaces are normally needed to monitor.
48 # You may override the interface filtering in devdiscover-siteconfig.pl:
49 # redefine $Torrus::DevDiscover::Arista::interfaceFilter
50 # or define $Torrus::DevDiscover::Arista::interfaceFilterOverlay
53 our $interfaceFilterOverlay;
54 my %aristaInterfaceFilter;
56 if( not defined( $interfaceFilter ) )
58 $interfaceFilter = \%aristaInterfaceFilter;
62 # Key is some unique symbolic name, does not mean anything
63 # ifType is the number to match the interface type
64 # ifDescr is the regexp to match the interface description
65 %aristaInterfaceFilter =
68 'ifType' => 1, # other
71 'ifType' => 161, # ieee 802.3ad LAG groups
72 # added due to index too high
75 'ifType' => 24, # softwareLoopback
78 'ifType' => 136, # vlan
79 # added due to index too high
88 my $devdetails = shift;
90 if( not $dd->oidBaseMatch
92 $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) )
97 &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter
98 ($devdetails, $interfaceFilter);
100 if( defined( $interfaceFilterOverlay ) )
102 &Torrus::DevDiscover::RFC2863_IF_MIB::addInterfaceFilter
103 ($devdetails, $interfaceFilterOverlay);
106 $devdetails->setCap('interfaceIndexingPersistent');
115 my $devdetails = shift;
117 my $session = $dd->session();
118 my $data = $devdetails->data();
120 # PROG: Add comment for sysDescr
121 my $desc = $dd->retrieveSnmpOIDs('sysDescr');
122 $data->{'param'}{'comment'} = $desc->{'sysDescr'};
130 my $devdetails = shift;
133 my $data = $devdetails->data();
142 # indent-tabs-mode: nil
143 # perl-indent-level: 4