2 # Discovery module for Symmetricom
4 # Copyright (C) 2007 Jon Nistor
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20 # $Id: Symmetricom.pm,v 1.1 2010-12-27 00:03:46 ivan Exp $
21 # Jon Nistor <nistor at snickers dot org>
26 package Torrus::DevDiscover::Symmetricom;
32 $Torrus::DevDiscover::registry{'Symmetricom'} = {
34 'checkdevtype' => \&checkdevtype,
35 'discover' => \&discover,
36 'buildConfig' => \&buildConfig
41 'syncServer' => '1.3.6.1.4.1.9070.1.2.3.1.5',
42 'sysDescr' => '1.3.6.1.2.1.1.1.0',
43 'ntpSysSystem' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.1.14.0',
44 'etcSerialNbr' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.6.2.0',
45 'etcModel' => '1.3.6.1.4.1.9070.1.2.3.1.5.1.6.3.0',
51 my $devdetails = shift;
53 if( not $dd->oidBaseMatch
55 $devdetails->snmpVar( $dd->oiddef('sysObjectID') ) ) )
60 $devdetails->setCap('interfaceIndexingPersistent');
61 $devdetails->setDevType('UcdSnmp'); # Force load Ucd
69 my $devdetails = shift;
71 my $session = $dd->session();
72 my $data = $devdetails->data();
74 # SNMP: Get the system info and display it in the comment
75 my $ntpComment = $dd->retrieveSnmpOIDs
76 ( 'sysDescr', 'ntpSysSystem', 'etcSerialNbr', 'etcModel' );
78 $data->{'ntp'} = $ntpComment;
80 $data->{'param'}{'comment'} =
81 $ntpComment->{'ntpSysSystem'} . " " . $ntpComment->{'etcModel'} .
82 ", Hw Serial#: " . $ntpComment->{'etcSerialNbr'};
90 my $devdetails = shift;
93 my $data = $devdetails->data();
95 $cb->addTemplateApplication($devNode, 'Symmetricom::ntp-stats');
102 # indent-tabs-mode: nil
103 # perl-indent-level: 4