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: SNMP_Params.pm,v 1.1 2010-12-27 00:03:57 ivan Exp $
18 # Stanislav Sinyagin <ssinyagin@yahoo.com>
20 package Torrus::Collector::SNMP_Params;
22 ### Initialize the configuration validator with module-specific parameters
23 ### Moved to a separate module to speed up the compiler initialization
25 my %validatorLeafParams =
27 'snmp-ipversion' => {'4' => undef, '6' => undef},
28 'snmp-transport' => {'udp' => undef, 'tcp' => undef},
31 '+snmp-localaddr' => undef,
32 '+snmp-localport' => undef,
33 '+domain-name' => undef,
34 'snmp-object' => undef,
35 'snmp-version' => { '1' => { 'snmp-community' => undef },
36 '2c' => { 'snmp-community' => undef },
38 'snmp-username' => undef,
39 '+snmp-authkey' => undef,
40 '+snmp-authpassword' => undef,
41 '+snmp-authprotocol' => {
44 '+snmp-privkey' => undef,
45 '+snmp-privpassword' => undef,
46 '+snmp-privprotocol' => {
49 '3desede' => undef } } },
50 'snmp-timeout' => undef,
51 'snmp-retries' => undef,
52 'snmp-oids-per-pdu' => undef,
53 '+snmp-object-type' => { 'OTHER' => undef,
54 'COUNTER64' => undef },
55 '+snmp-check-sysuptime' => { 'yes' => undef,
57 '+snmp-max-msg-size' => undef,
58 '+snmp-ignore-mib-errors' => undef,
61 sub initValidatorLeafParams
64 $hashref->{'ds-type'}{'collector'}{'collector-type'}{'snmp'} =
65 \%validatorLeafParams;
69 my %admInfoLeafParams =
71 'snmp-ipversion' => undef,
72 'snmp-transport' => undef,
75 'snmp-localaddr' => undef,
76 'snmp-localport' => undef,
77 'domain-name' => undef,
78 'snmp-community' => undef,
79 'snmp-username' => undef,
80 'snmp-authkey' => undef,
81 'snmp-authpassword' => undef,
82 'snmp-authprotocol' => undef,
83 'snmp-privkey' => undef,
84 'snmp-privpassword' => undef,
85 'snmp-privprotocol' => undef,
86 'snmp-object' => undef,
87 'snmp-version' => undef,
88 'snmp-timeout' => undef,
89 'snmp-retries' => undef,
90 'snmp-oids-per-pdu' => undef,
91 'snmp-object-type' => undef,
92 'snmp-check-sysuptime' => undef,
93 'snmp-max-msg-size' => undef,
94 'snmp-ignore-mib-errors' => undef,
98 my %admInfoParamCategories =
100 'snmp-ipversion' => 'SNMP',
101 'snmp-transport' => 'SNMP',
102 'snmp-host' => 'SNMP',
103 'snmp-port' => 'SNMP',
104 'snmp-localaddr' => 'SNMP',
105 'snmp-localport' => 'SNMP',
106 'domain-name' => 'SNMP',
107 'snmp-community' => 'SNMP',
108 'snmp-username' => 'SNMP',
109 'snmp-authkey' => 'SNMP',
110 'snmp-authpassword' => 'SNMP',
111 'snmp-authprotocol' => 'SNMP',
112 'snmp-privkey' => 'SNMP',
113 'snmp-privpassword' => 'SNMP',
114 'snmp-privprotocol' => 'SNMP',
115 'snmp-object' => 'SNMP',
116 'snmp-version' => 'SNMP',
117 'snmp-timeout' => 'SNMP',
118 'snmp-retries' => 'SNMP',
119 'snmp-oids-per-pdu' => 'SNMP',
120 'snmp-object-type' => 'SNMP',
121 'snmp-check-sysuptime' => 'SNMP',
122 'snmp-max-msg-size' => 'SNMP',
123 'snmp-ignore-mib-errors' => 'SNMP'
130 my $categories = shift;
132 $map->{'ds-type'}{'collector'}{'collector-type'}{'snmp'} =
135 while( ($pname, $category) = each %admInfoParamCategories )
137 $categories->{$pname} = $category;
147 # indent-tabs-mode: nil
148 # perl-indent-level: 4