1 # Copyright (C) 2002 Stanislav Sinyagin
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: Paradyne.pm,v 1.1 2010-12-27 00:03:48 ivan Exp $
18 # Stanislav Sinyagin <ssinyagin@yahoo.com>
20 # Paradyne devices discovery
21 # A typical Paradyne device has several slots, and all slots are managed
22 # through the same IP address, with different community strings.
23 # That's why you have to configure "Paradyne::slot-name" parameter
24 # in your discovery file, uniquely for each slot. A slot name should
25 # not contain special characters.
30 # - Paradyne GranDSLAM 2.0 DSLAM - Hotwire DSL;
31 # Model: 8000-B2-211; S/W Release : M04.02.27
33 # - Paradyne Hotwire ATM ADSL Line Card;
34 # Model: 8365-B1-000; S/W Release: 02.03.54
36 # - Paradyne Hotwire ATM G.SHDSL Line Card;
37 # Model: 8385-B1-000; S/W Release: 02.03.45
39 # - Hotwire IP ReachDSL Line Card;
40 # Model: 8314-B3-000; S/W Release: 04.03.10
43 package Torrus::DevDiscover::Paradyne;
49 $Torrus::DevDiscover::registry{'Paradyne'} = {
51 'checkdevtype' => \&checkdevtype,
52 'discover' => \&discover,
53 'buildConfig' => \&buildConfig
60 'paradyne-products' => '1.3.6.1.4.1.1795.1.14',
61 'xdslDevIfStatsElapsedTimeLinkUp' =>
62 '1.3.6.1.4.1.1795.2.24.2.6.8.1.1.1.1.4'
66 if( not defined $statsInterval )
68 $statsInterval = 6; # current15Minutes (GORD)
75 my $devdetails = shift;
77 if( not $dd->oidBaseMatch
78 ( 'paradyne-products',
79 $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) )
84 if( length( $devdetails->param('Paradyne::slot-name') ) == 0 )
86 Error('Mandatory discovery parameter "Paradyne::slot-number" ' .
87 'is not defined for a Paradyne device: ' .
88 $devdetails->param('snmp-host') . ':' .
89 $devdetails->param('snmp-port') . ':' .
90 $devdetails->param('snmp-community'));
94 $devdetails->setCap('interfaceIndexingManaged');
103 my $devdetails = shift;
105 my $data = $devdetails->data();
106 my $session = $dd->session();
108 $data->{'nameref'}{'ifReferenceName'} = 'ifName';
109 $data->{'nameref'}{'ifSubtreeName'} = 'ifNameT';
110 $data->{'param'}{'ifindex-table'} = '$ifName';
111 $data->{'nameref'}{'ifNick'} = 'ParadyneIfNick';
113 $data->{'nameref'}{'ifComment'} = 'ifDescr';
115 if( not defined( $data->{'param'}{'snmp-oids-per-pdu'} ) )
117 $data->{'param'}{'snmp-oids-per-pdu'} = '10';
120 my $slot = $devdetails->param('Paradyne::slot-name');
121 foreach my $ifIndex ( keys %{$data->{'interfaces'}} )
123 my $interface = $data->{'interfaces'}{$ifIndex};
124 $interface->{'ParadyneIfNick'} =
125 $slot . '_' . $interface->{'ifNameT'};
128 my $xdslOID = $dd->oiddef('xdslDevIfStatsElapsedTimeLinkUp');
130 my $xdslTable = $session->get_table( -baseoid => $xdslOID );
131 if( defined $xdslTable )
133 $devdetails->storeSnmpVars( $xdslTable );
134 $devdetails->setCap('paradyneXDSL');
136 foreach my $ifIndex ( keys %{$data->{'interfaces'}} )
138 if( $devdetails->hasOID( $xdslOID .'.'. $ifIndex .'.'.
141 push( @{$data->{'paradyneXDSLInterfaces'}}, $ifIndex );
150 # Nothing really to do yet
153 my $devdetails = shift;
157 if( $devdetails->hasCap('paradyneXDSL') )
159 my $subtreeName = 'XDSL_Line_Stats';
162 'precedence' => '-600',
163 'comment' => 'Paradyne XDSL line statistics',
164 'xdsl-stats-interval' => $statsInterval
166 my $subtreeNode = $cb->addSubtree( $devNode, $subtreeName, $param );
168 my $data = $devdetails->data();
171 ( sort {$a<=>$b} @{$data->{'paradyneXDSLInterfaces'}} )
173 my $interface = $data->{'interfaces'}{$ifIndex};
176 $interface->{$data->{'nameref'}{'ifSubtreeName'}};
178 my $templates = ['Paradyne::paradyne-xdsl-interface'];
181 'interface-name' => $interface->{'param'}{'interface-name'},
182 'interface-nick' => $interface->{'param'}{'interface-nick'},
183 'comment' => $interface->{'param'}{'comment'}
186 $cb->addSubtree( $subtreeNode, $ifSubtreeName,
187 $param, $templates );
198 # indent-tabs-mode: nil
199 # perl-indent-level: 4