1 # Copyright (C) 2012 Freeside Internet Services, Inc.
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 # Ractivity Power Distribution Unit
19 package Torrus::DevDiscover::Ractivity;
24 $Torrus::DevDiscover::registry{'Ractivity'} = {
26 'checkdevtype' => \&checkdevtype,
27 'discover' => \&discover,
28 'buildConfig' => \&buildConfig
33 #'racktivity' => '1.3.6.1.4.1.34097',
34 'product' => '1.3.6.1.4.1.34097.1',
35 'name' => '1.3.6.1.4.1.34097.1.1',
36 'version' => '1.3.6.1.4.1.34097.1.2',
37 'date' => '1.3.6.1.4.1.34097.1.3',
38 'general' => '1.3.6.1.4.1.34097.2',
39 'Voltage' => '1.3.6.1.4.1.34097.2.1',
40 'MaxTotCurentTime' => '1.3.6.1.4.1.34097.2.10',
41 'TotKwh' => '1.3.6.1.4.1.34097.2.11',
42 'Intrusion' => '1.3.6.1.4.1.34097.2.12',
43 'Airflow' => '1.3.6.1.4.1.34097.2.13',
44 'Beep' => '1.3.6.1.4.1.34097.2.14',
45 'ControllerName' => '1.3.6.1.4.1.34097.2.15',
46 'RackPosition' => '1.3.6.1.4.1.34097.2.16',
47 'Frequency' => '1.3.6.1.4.1.34097.2.2',
48 'TotCurrent' => '1.3.6.1.4.1.34097.2.3',
49 'TotPower' => '1.3.6.1.4.1.34097.2.4',
50 'TemperatureInside' => '1.3.6.1.4.1.34097.2.5',
51 'HumidityInside' => '1.3.6.1.4.1.34097.2.6',
52 'MaxTotCurrentWarning' => '1.3.6.1.4.1.34097.2.7',
53 'MaxTotCurentOff' => '1.3.6.1.4.1.34097.2.8',
54 'MaxTotCurrent' => '1.3.6.1.4.1.34097.2.9',
55 'port' => '1.3.6.1.4.1.34097.3',
56 'portTable' => '1.3.6.1.4.1.34097.3.1',
57 'portEntry' => '1.3.6.1.4.1.34097.3.1.1',
58 'PortNr' => '1.3.6.1.4.1.34097.3.1.1.1',
59 'MaxCurrent' => '1.3.6.1.4.1.34097.3.1.1.10',
60 'MaxCurrentTime' => '1.3.6.1.4.1.34097.3.1.1.11',
61 'MaxCurrentWarning' => '1.3.6.1.4.1.34097.3.1.1.12',
62 'MaxCurrentOff' => '1.3.6.1.4.1.34097.3.1.1.13',
63 'Priority' => '1.3.6.1.4.1.34097.3.1.1.14',
64 'DelayOn' => '1.3.6.1.4.1.34097.3.1.1.15',
65 'PortName' => '1.3.6.1.4.1.34097.3.1.1.2',
66 'Current' => '1.3.6.1.4.1.34097.3.1.1.3',
67 'RealPower' => '1.3.6.1.4.1.34097.3.1.1.4',
68 'ApparentPower' => '1.3.6.1.4.1.34097.3.1.1.5',
69 'PowerFactor' => '1.3.6.1.4.1.34097.3.1.1.6',
70 'State' => '1.3.6.1.4.1.34097.3.1.1.7',
71 'kWh' => '1.3.6.1.4.1.34097.3.1.1.8', #the important one
72 'kWhTime' => '1.3.6.1.4.1.34097.3.1.1.9',
73 'temp' => '1.3.6.1.4.1.34097.4',
74 'tempTable' => '1.3.6.1.4.1.34097.4.1',
75 'tempEntry' => '1.3.6.1.4.1.34097.4.1.1',
76 'TempNr' => '1.3.6.1.4.1.34097.4.1.1.1',
77 'Temperature' => '1.3.6.1.4.1.34097.4.1.1.2',
78 'MaxTemp' => '1.3.6.1.4.1.34097.4.1.1.3',
79 'MaxTempTime' => '1.3.6.1.4.1.34097.4.1.1.4',
80 'TempWarning' => '1.3.6.1.4.1.34097.4.1.1.5',
85 shift->checkSnmpOID('product');
91 my $devdetails = shift;
93 my $data = $devdetails->data();
95 my $info = $dd->retrieveSnmpOIDs( 'product',
102 $data->{'param'}{'comment'} = join(' ', map $info->{$_},
103 qw( product name version )
106 $data->{'param'}{'legend'} = "Product: ". $info->{'product'}. ";\n".
107 "Name: ". $info->{'name'}. ";\n".
108 "Version: ". $info->{'version'}. ";\n".
109 "Date: ". $info->{'date'}. ";";
116 my $devdetails = shift;
120 $cb->addTemplateApplication( $devNode, 'Ractivity::PDU');