line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Monitoring::GLPlugin::SNMP; |
2
|
|
|
|
|
|
|
our @ISA = qw(Monitoring::GLPlugin); |
3
|
|
|
|
|
|
|
# ABSTRACT: helper functions to build a snmp-based monitoring plugin |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
2110
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
90
|
|
6
|
3
|
|
|
3
|
|
16
|
use File::Basename; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
188
|
|
7
|
3
|
|
|
3
|
|
18
|
use Digest::MD5 qw(md5_hex); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
114
|
|
8
|
3
|
|
|
3
|
|
856
|
use Module::Load; |
|
3
|
|
|
|
|
2814
|
|
|
3
|
|
|
|
|
18
|
|
9
|
3
|
|
|
3
|
|
1095
|
use AutoLoader; |
|
3
|
|
|
|
|
3800
|
|
|
3
|
|
|
|
|
18
|
|
10
|
|
|
|
|
|
|
our $AUTOLOAD; |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
160
|
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
64272
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
our $mode = undef; |
16
|
|
|
|
|
|
|
our $plugin = undef; |
17
|
|
|
|
|
|
|
our $blacklist = undef; |
18
|
|
|
|
|
|
|
our $session = undef; |
19
|
|
|
|
|
|
|
our $rawdata = {}; |
20
|
|
|
|
|
|
|
our $tablecache = {}; |
21
|
|
|
|
|
|
|
our $info = []; |
22
|
|
|
|
|
|
|
our $extendedinfo = []; |
23
|
|
|
|
|
|
|
our $summary = []; |
24
|
|
|
|
|
|
|
our $oidtrace = []; |
25
|
|
|
|
|
|
|
our $uptime = 0; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
2
|
|
|
2
|
0
|
10
|
my ($class, %params) = @_; |
30
|
|
|
|
|
|
|
require Monitoring::GLPlugin |
31
|
2
|
50
|
|
|
|
148
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::; |
32
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::SysDescPrettify |
33
|
2
|
50
|
|
|
|
649
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::SysDescPrettify::; |
34
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::MibsAndOids |
35
|
2
|
50
|
|
|
|
571
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::MibsAndOids::; |
36
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::CSF |
37
|
2
|
50
|
|
|
|
501
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::CSF::; |
38
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::Item |
39
|
2
|
50
|
|
|
|
519
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::Item::; |
40
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::TableItem |
41
|
2
|
50
|
|
|
|
516
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::TableItem::; |
42
|
2
|
|
|
|
|
15
|
my $self = Monitoring::GLPlugin->new(%params); |
43
|
2
|
|
|
|
|
7
|
bless $self, $class; |
44
|
2
|
|
|
|
|
7
|
return $self; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub v2tov3 { |
48
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
49
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->community && $self->opts->community =~ /^snmpv3(.)(.+)/) { |
50
|
0
|
|
|
|
|
0
|
my $separator = $1; |
51
|
0
|
|
|
|
|
0
|
my ($authprotocol, $authpassword, $privprotocol, $privpassword, |
52
|
|
|
|
|
|
|
$username, $contextengineid, $contextname) = split(/$separator/, $2); |
53
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('authprotocol', $authprotocol) |
54
|
|
|
|
|
|
|
if defined($authprotocol) && $authprotocol; |
55
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('authpassword', $authpassword) |
56
|
|
|
|
|
|
|
if defined($authpassword) && $authpassword; |
57
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('privprotocol', $privprotocol) |
58
|
|
|
|
|
|
|
if defined($privprotocol) && $privprotocol; |
59
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('privpassword', $privpassword) |
60
|
|
|
|
|
|
|
if defined($privpassword) && $privpassword; |
61
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('username', $username) |
62
|
|
|
|
|
|
|
if defined($username) && $username; |
63
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('contextengineid', $contextengineid) |
64
|
|
|
|
|
|
|
if defined($contextengineid) && $contextengineid; |
65
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('contextname', $contextname) |
66
|
|
|
|
|
|
|
if defined($contextname) && $contextname; |
67
|
0
|
|
|
|
|
0
|
$self->override_opt('community', undef) ; |
68
|
0
|
|
|
|
|
0
|
$self->override_opt('protocol', '3') ; |
69
|
|
|
|
|
|
|
} |
70
|
0
|
0
|
0
|
|
|
0
|
if (($self->opts->authpassword || $self->opts->authprotocol || |
|
|
|
0
|
|
|
|
|
71
|
|
|
|
|
|
|
$self->opts->privpassword || $self->opts->privprotocol) && |
72
|
|
|
|
|
|
|
$self->opts->protocol ne '3') { |
73
|
0
|
|
|
|
|
0
|
$self->override_opt('protocol', '3') ; |
74
|
|
|
|
|
|
|
} |
75
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->community2 && $self->opts->community2 =~ /^snmpv3(.)(.+)/) { |
76
|
0
|
|
|
|
|
0
|
my $separator = $1; |
77
|
0
|
|
|
|
|
0
|
$self->create_opt('authprotocol2'); |
78
|
0
|
|
|
|
|
0
|
$self->create_opt('authpassword2'); |
79
|
0
|
|
|
|
|
0
|
$self->create_opt('privprotocol2'); |
80
|
0
|
|
|
|
|
0
|
$self->create_opt('privpassword2'); |
81
|
0
|
|
|
|
|
0
|
$self->create_opt('username2'); |
82
|
0
|
|
|
|
|
0
|
$self->create_opt('contextengineid2'); |
83
|
0
|
|
|
|
|
0
|
$self->create_opt('contextname2'); |
84
|
0
|
|
|
|
|
0
|
my ($authprotocol, $authpassword, $privprotocol, $privpassword, |
85
|
|
|
|
|
|
|
$username, $contextengineid, $contextname) = split(/$separator/, $2); |
86
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('authprotocol2', $authprotocol) |
87
|
|
|
|
|
|
|
if defined($authprotocol) && $authprotocol; |
88
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('authpassword2', $authpassword) |
89
|
|
|
|
|
|
|
if defined($authpassword) && $authpassword; |
90
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('privprotocol2', $privprotocol) |
91
|
|
|
|
|
|
|
if defined($privprotocol) && $privprotocol; |
92
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('privpassword2', $privpassword) |
93
|
|
|
|
|
|
|
if defined($privpassword) && $privpassword; |
94
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('username2', $username) |
95
|
|
|
|
|
|
|
if defined($username) && $username; |
96
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('contextengineid2', $contextengineid) |
97
|
|
|
|
|
|
|
if defined($contextengineid) && $contextengineid; |
98
|
0
|
0
|
0
|
|
|
0
|
$self->override_opt('contextname2', $contextname) |
99
|
|
|
|
|
|
|
if defined($contextname) && $contextname; |
100
|
0
|
|
|
|
|
0
|
$self->override_opt('community2', undef); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub add_snmp_modes { |
105
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
106
|
0
|
|
|
|
|
0
|
$self->add_mode( |
107
|
|
|
|
|
|
|
internal => 'device::uptime', |
108
|
|
|
|
|
|
|
spec => 'uptime', |
109
|
|
|
|
|
|
|
alias => undef, |
110
|
|
|
|
|
|
|
help => 'Check the uptime of the device', |
111
|
|
|
|
|
|
|
); |
112
|
0
|
|
|
|
|
0
|
$self->add_mode( |
113
|
|
|
|
|
|
|
internal => 'device::walk', |
114
|
|
|
|
|
|
|
spec => 'walk', |
115
|
|
|
|
|
|
|
alias => undef, |
116
|
|
|
|
|
|
|
help => 'Show snmpwalk command with the oids necessary for a simulation', |
117
|
|
|
|
|
|
|
); |
118
|
0
|
|
|
|
|
0
|
$self->add_mode( |
119
|
|
|
|
|
|
|
internal => 'device::walkbulk', |
120
|
|
|
|
|
|
|
spec => 'bulkwalk', |
121
|
|
|
|
|
|
|
alias => undef, |
122
|
|
|
|
|
|
|
help => 'Show snmpbulkwalk command with the oids necessary for a simulation', |
123
|
|
|
|
|
|
|
hidden => 1, |
124
|
|
|
|
|
|
|
); |
125
|
0
|
|
|
|
|
0
|
$self->add_mode( |
126
|
|
|
|
|
|
|
internal => 'device::supportedmibs', |
127
|
|
|
|
|
|
|
spec => 'supportedmibs', |
128
|
|
|
|
|
|
|
alias => undef, |
129
|
|
|
|
|
|
|
help => 'Shows the names of the mibs which this devices has implemented (only lausser may run this command)', |
130
|
|
|
|
|
|
|
); |
131
|
0
|
|
|
|
|
0
|
$self->add_mode( |
132
|
|
|
|
|
|
|
internal => 'device::supportedoids', |
133
|
|
|
|
|
|
|
spec => 'supportedoids', |
134
|
|
|
|
|
|
|
alias => undef, |
135
|
|
|
|
|
|
|
help => 'Shows the names of the oids which this devices has implemented (only lausser may run this command)', |
136
|
|
|
|
|
|
|
); |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub add_snmp_args { |
140
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
141
|
0
|
|
|
|
|
0
|
$self->add_arg( |
142
|
|
|
|
|
|
|
spec => 'hostname|H=s', |
143
|
|
|
|
|
|
|
help => '--hostname |
144
|
|
|
|
|
|
|
Hostname or IP-address of the switch or router', |
145
|
|
|
|
|
|
|
required => 0, |
146
|
|
|
|
|
|
|
env => 'HOSTNAME', |
147
|
|
|
|
|
|
|
); |
148
|
0
|
|
|
|
|
0
|
$self->add_arg( |
149
|
|
|
|
|
|
|
spec => 'port=i', |
150
|
|
|
|
|
|
|
help => '--port |
151
|
|
|
|
|
|
|
The SNMP port to use (default: 161)', |
152
|
|
|
|
|
|
|
required => 0, |
153
|
|
|
|
|
|
|
default => 161, |
154
|
|
|
|
|
|
|
); |
155
|
0
|
|
|
|
|
0
|
$self->add_arg( |
156
|
|
|
|
|
|
|
spec => 'domain=s', |
157
|
|
|
|
|
|
|
help => '--domain |
158
|
|
|
|
|
|
|
The transport domain to use (default: udp/ipv4, other possible values: udp6, udp/ipv6, tcp, tcp4, tcp/ipv4, tcp6, tcp/ipv6)', |
159
|
|
|
|
|
|
|
required => 0, |
160
|
|
|
|
|
|
|
default => 'udp', |
161
|
|
|
|
|
|
|
); |
162
|
0
|
|
|
|
|
0
|
$self->add_arg( |
163
|
|
|
|
|
|
|
spec => 'protocol|P=s', |
164
|
|
|
|
|
|
|
help => '--protocol |
165
|
|
|
|
|
|
|
The SNMP protocol to use (default: 2c, other possibilities: 1,3)', |
166
|
|
|
|
|
|
|
required => 0, |
167
|
|
|
|
|
|
|
default => '2c', |
168
|
|
|
|
|
|
|
); |
169
|
0
|
|
|
|
|
0
|
$self->add_arg( |
170
|
|
|
|
|
|
|
spec => 'community|C=s', |
171
|
|
|
|
|
|
|
help => '--community |
172
|
|
|
|
|
|
|
SNMP community of the server (SNMP v1/2 only)', |
173
|
|
|
|
|
|
|
required => 0, |
174
|
|
|
|
|
|
|
default => 'public', |
175
|
|
|
|
|
|
|
); |
176
|
0
|
|
|
|
|
0
|
$self->add_arg( |
177
|
|
|
|
|
|
|
spec => 'username:s', |
178
|
|
|
|
|
|
|
help => '--username |
179
|
|
|
|
|
|
|
The securityName for the USM security model (SNMPv3 only)', |
180
|
|
|
|
|
|
|
required => 0, |
181
|
|
|
|
|
|
|
); |
182
|
0
|
|
|
|
|
0
|
$self->add_arg( |
183
|
|
|
|
|
|
|
spec => 'authpassword:s', |
184
|
|
|
|
|
|
|
help => '--authpassword |
185
|
|
|
|
|
|
|
The authentication password for SNMPv3', |
186
|
|
|
|
|
|
|
required => 0, |
187
|
|
|
|
|
|
|
); |
188
|
0
|
|
|
|
|
0
|
$self->add_arg( |
189
|
|
|
|
|
|
|
spec => 'authprotocol:s', |
190
|
|
|
|
|
|
|
help => '--authprotocol |
191
|
|
|
|
|
|
|
The authentication protocol for SNMPv3 (md5|sha)', |
192
|
|
|
|
|
|
|
required => 0, |
193
|
|
|
|
|
|
|
); |
194
|
0
|
|
|
|
|
0
|
$self->add_arg( |
195
|
|
|
|
|
|
|
spec => 'privpassword:s', |
196
|
|
|
|
|
|
|
help => '--privpassword |
197
|
|
|
|
|
|
|
The password for authPriv security level', |
198
|
|
|
|
|
|
|
required => 0, |
199
|
|
|
|
|
|
|
); |
200
|
0
|
|
|
|
|
0
|
$self->add_arg( |
201
|
|
|
|
|
|
|
spec => 'privprotocol=s', |
202
|
|
|
|
|
|
|
help => '--privprotocol |
203
|
|
|
|
|
|
|
The private protocol for SNMPv3 (des|aes|aes128|3des|3desde)', |
204
|
|
|
|
|
|
|
required => 0, |
205
|
|
|
|
|
|
|
); |
206
|
0
|
|
|
|
|
0
|
$self->add_arg( |
207
|
|
|
|
|
|
|
spec => 'contextengineid=s', |
208
|
|
|
|
|
|
|
help => '--contextengineid |
209
|
|
|
|
|
|
|
The context engine id for SNMPv3 (10 to 64 hex characters)', |
210
|
|
|
|
|
|
|
required => 0, |
211
|
|
|
|
|
|
|
); |
212
|
0
|
|
|
|
|
0
|
$self->add_arg( |
213
|
|
|
|
|
|
|
spec => 'contextname=s', |
214
|
|
|
|
|
|
|
help => '--contextname |
215
|
|
|
|
|
|
|
The context name for SNMPv3 (empty represents the "default" context)', |
216
|
|
|
|
|
|
|
required => 0, |
217
|
|
|
|
|
|
|
); |
218
|
0
|
|
|
|
|
0
|
$self->add_arg( |
219
|
|
|
|
|
|
|
spec => 'community2=s', |
220
|
|
|
|
|
|
|
help => '--community2 |
221
|
|
|
|
|
|
|
SNMP community which can be used to switch the context during runtime', |
222
|
|
|
|
|
|
|
required => 0, |
223
|
|
|
|
|
|
|
); |
224
|
0
|
|
|
|
|
0
|
$self->add_arg( |
225
|
|
|
|
|
|
|
spec => 'snmpwalk=s', |
226
|
|
|
|
|
|
|
help => '--snmpwalk |
227
|
|
|
|
|
|
|
A file with the output of a snmpwalk (used for simulation) |
228
|
|
|
|
|
|
|
Use it instead of --hostname', |
229
|
|
|
|
|
|
|
required => 0, |
230
|
|
|
|
|
|
|
env => 'SNMPWALK', |
231
|
|
|
|
|
|
|
); |
232
|
0
|
|
|
|
|
0
|
$self->add_arg( |
233
|
|
|
|
|
|
|
spec => 'servertype=s', |
234
|
|
|
|
|
|
|
help => '--servertype |
235
|
|
|
|
|
|
|
The type of the network device: cisco (default). Use it if auto-detection |
236
|
|
|
|
|
|
|
is not possible', |
237
|
|
|
|
|
|
|
required => 0, |
238
|
|
|
|
|
|
|
); |
239
|
0
|
|
|
|
|
0
|
$self->add_arg( |
240
|
|
|
|
|
|
|
spec => 'oids=s', |
241
|
|
|
|
|
|
|
help => '--oids |
242
|
|
|
|
|
|
|
A list of oids which are downloaded and written to a cache file. |
243
|
|
|
|
|
|
|
Use it together with --mode oidcache', |
244
|
|
|
|
|
|
|
required => 0, |
245
|
|
|
|
|
|
|
); |
246
|
0
|
|
|
|
|
0
|
$self->add_arg( |
247
|
|
|
|
|
|
|
spec => 'offline:i', |
248
|
|
|
|
|
|
|
help => '--offline |
249
|
|
|
|
|
|
|
The maximum number of seconds since the last update of cache file before |
250
|
|
|
|
|
|
|
it is considered too old', |
251
|
|
|
|
|
|
|
required => 0, |
252
|
|
|
|
|
|
|
env => 'OFFLINE', |
253
|
|
|
|
|
|
|
); |
254
|
|
|
|
|
|
|
} |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
sub validate_args { |
257
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
258
|
0
|
|
|
|
|
0
|
$self->SUPER::validate_args(); |
259
|
0
|
0
|
|
|
|
0
|
if ($self->opts->mode =~ /^(bulk)*walk/) { |
260
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->snmpwalk && $self->opts->hostname) { |
|
|
0
|
0
|
|
|
|
|
261
|
0
|
0
|
|
|
|
0
|
if ($self->check_messages == CRITICAL) { |
262
|
|
|
|
|
|
|
# gemecker vom super-validierer, der sicherstellt, dass die datei |
263
|
|
|
|
|
|
|
# snmpwalk existiert. in diesem fall wird sie aber erst neu angelegt, |
264
|
|
|
|
|
|
|
# also schnauze. |
265
|
0
|
|
|
|
|
0
|
my ($code, $message) = $self->check_messages; |
266
|
0
|
0
|
|
|
|
0
|
if ($message eq sprintf("file %s not found", $self->opts->snmpwalk)) { |
267
|
0
|
|
|
|
|
0
|
$self->clear_critical; |
268
|
|
|
|
|
|
|
} |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
# snmp agent wird abgefragt, die ergebnisse landen in einem file |
271
|
|
|
|
|
|
|
# opts->snmpwalk ist der filename. da sich die ganzen get_snmp_table/object-aufrufe |
272
|
|
|
|
|
|
|
# an das walkfile statt an den agenten halten wuerden, muss opts->snmpwalk geloescht |
273
|
|
|
|
|
|
|
# werden. stattdessen wird opts->snmpdump als traeger des dateinamens mitgegeben. |
274
|
|
|
|
|
|
|
# nur sinnvoll mit mode=walk |
275
|
0
|
|
|
|
|
0
|
$self->create_opt('snmpdump'); |
276
|
0
|
|
|
|
|
0
|
$self->override_opt('snmpdump', $self->opts->snmpwalk); |
277
|
0
|
|
|
|
|
0
|
$self->override_opt('snmpwalk', undef); |
278
|
|
|
|
|
|
|
} elsif (! $self->opts->snmpwalk && $self->opts->hostname) { |
279
|
|
|
|
|
|
|
# snmp agent wird abgefragt, die ergebnisse landen in einem file, dessen name |
280
|
|
|
|
|
|
|
# nicht vorgegeben ist |
281
|
0
|
|
|
|
|
0
|
$self->create_opt('snmpdump'); |
282
|
|
|
|
|
|
|
} |
283
|
|
|
|
|
|
|
} else { |
284
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->snmpwalk && ! $self->opts->hostname) { |
|
|
0
|
0
|
|
|
|
|
285
|
|
|
|
|
|
|
# normaler aufruf, mode != walk, oid-quelle ist eine datei |
286
|
0
|
|
|
|
|
0
|
$self->override_opt('hostname', 'snmpwalk.file'.md5_hex($self->opts->snmpwalk)) |
287
|
|
|
|
|
|
|
} elsif ($self->opts->snmpwalk && $self->opts->hostname) { |
288
|
|
|
|
|
|
|
# snmpwalk hat vorrang |
289
|
0
|
|
|
|
|
0
|
$self->override_opt('hostname', undef); |
290
|
|
|
|
|
|
|
} |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
sub init { |
295
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
296
|
0
|
0
|
|
|
|
0
|
if ($self->mode =~ /device::(bulk)*walk/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
297
|
0
|
|
|
|
|
0
|
my @trees = (); |
298
|
0
|
|
|
|
|
0
|
my $name = $Monitoring::GLPlugin::pluginname; |
299
|
0
|
|
|
|
|
0
|
$name =~ s/.*\///g; |
300
|
0
|
|
|
|
|
0
|
$name = sprintf "/tmp/snmpwalk_%s_%s", $name, $self->opts->hostname; |
301
|
0
|
0
|
|
|
|
0
|
if ($self->opts->oids) { |
|
|
0
|
|
|
|
|
|
302
|
|
|
|
|
|
|
# create pid filename |
303
|
|
|
|
|
|
|
# already running?;x |
304
|
0
|
|
|
|
|
0
|
@trees = split(",", $self->opts->oids); |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
} elsif ($self->can("trees")) { |
307
|
0
|
|
|
|
|
0
|
@trees = $self->trees; |
308
|
0
|
|
|
|
|
0
|
push(@trees, "1.3.6.1.2.1.1"); |
309
|
|
|
|
|
|
|
} else { |
310
|
0
|
|
|
|
|
0
|
@trees = ("1.3.6.1.2.1", "1.3.6.1.4.1"); |
311
|
|
|
|
|
|
|
} |
312
|
0
|
0
|
|
|
|
0
|
if ($self->opts->snmpdump) { |
313
|
0
|
|
|
|
|
0
|
$name = $self->opts->snmpdump; |
314
|
|
|
|
|
|
|
} |
315
|
0
|
0
|
|
|
|
0
|
$self->opts->override_opt("protocol", $1) if $self->opts->protocol =~ /^v(.*)/; |
316
|
0
|
0
|
|
|
|
0
|
if (defined $self->opts->offline) { |
317
|
0
|
|
|
|
|
0
|
$self->{pidfile} = $name.".pid"; |
318
|
0
|
0
|
|
|
|
0
|
if (! $self->check_pidfile()) { |
319
|
0
|
|
|
|
|
0
|
$self->debug("Exiting because another walk is already running"); |
320
|
0
|
|
|
|
|
0
|
printf STDERR "Exiting because another walk is already running\n"; |
321
|
0
|
|
|
|
|
0
|
exit 3; |
322
|
|
|
|
|
|
|
} |
323
|
0
|
|
|
|
|
0
|
$self->write_pidfile(); |
324
|
0
|
|
|
|
|
0
|
my $timedout = 0; |
325
|
0
|
|
|
|
|
0
|
my $snmpwalkpid = 0; |
326
|
|
|
|
|
|
|
$SIG{'ALRM'} = sub { |
327
|
0
|
|
|
0
|
|
0
|
$timedout = 1; |
328
|
|
|
|
|
|
|
printf "UNKNOWN - %s timed out after %d seconds\n", |
329
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::plugin->{name}, $self->opts->timeout; |
330
|
0
|
|
|
|
|
0
|
kill 9, $snmpwalkpid; |
331
|
0
|
|
|
|
|
0
|
}; |
332
|
0
|
|
|
|
|
0
|
alarm($self->opts->timeout); |
333
|
0
|
|
|
|
|
0
|
unlink $name.".partial"; |
334
|
0
|
|
0
|
|
|
0
|
while (! $timedout && @trees) { |
335
|
0
|
|
|
|
|
0
|
my $tree = shift @trees; |
336
|
0
|
|
|
|
|
0
|
$SIG{CHLD} = 'IGNORE'; |
337
|
0
|
0
|
|
|
|
0
|
my $cmd = sprintf "%s -ObentU -v%s -c %s %s %s >> %s", |
338
|
|
|
|
|
|
|
($self->mode =~ /bulk/) ? "snmpbulkwalk" : "snmpwalk", |
339
|
|
|
|
|
|
|
$self->opts->protocol, |
340
|
|
|
|
|
|
|
$self->opts->community, |
341
|
|
|
|
|
|
|
$self->opts->hostname, |
342
|
|
|
|
|
|
|
$tree, $name.".partial"; |
343
|
0
|
|
|
|
|
0
|
$self->debug($cmd); |
344
|
0
|
|
|
|
|
0
|
$snmpwalkpid = fork; |
345
|
0
|
0
|
|
|
|
0
|
if (not $snmpwalkpid) { |
346
|
0
|
|
|
|
|
0
|
exec($cmd); |
347
|
|
|
|
|
|
|
} else { |
348
|
0
|
|
|
|
|
0
|
wait(); |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
} |
351
|
0
|
0
|
|
|
|
0
|
rename $name.".partial", $name if ! $timedout; |
352
|
0
|
0
|
|
|
|
0
|
-f $self->{pidfile} && unlink $self->{pidfile}; |
353
|
0
|
0
|
|
|
|
0
|
if ($timedout) { |
354
|
0
|
|
|
|
|
0
|
printf "CRITICAL - timeout. There are still %d snmpwalks left\n", scalar(@trees); |
355
|
0
|
|
|
|
|
0
|
exit 3; |
356
|
|
|
|
|
|
|
} else { |
357
|
0
|
|
|
|
|
0
|
printf "OK - all requested oids are in %s\n", $name; |
358
|
|
|
|
|
|
|
} |
359
|
|
|
|
|
|
|
} else { |
360
|
0
|
|
|
|
|
0
|
printf "rm -f %s\n", $name; |
361
|
0
|
|
|
|
|
0
|
foreach (@trees) { |
362
|
0
|
0
|
|
|
|
0
|
printf "%s -ObentU -v%s -c %s %s %s >> %s\n", |
363
|
|
|
|
|
|
|
($self->mode =~ /bulk/) ? "snmpbulkwalk -t 15 -r 20" : "snmpwalk", |
364
|
|
|
|
|
|
|
$self->opts->protocol, |
365
|
|
|
|
|
|
|
$self->opts->community, |
366
|
|
|
|
|
|
|
$self->opts->hostname, |
367
|
|
|
|
|
|
|
$_, $name; |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
} |
370
|
0
|
|
|
|
|
0
|
exit 0; |
371
|
|
|
|
|
|
|
} elsif ($self->mode =~ /device::uptime/) { |
372
|
|
|
|
|
|
|
$self->add_info(sprintf 'device is up since %s', |
373
|
0
|
|
|
|
|
0
|
$self->human_timeticks($self->{uptime})); |
374
|
0
|
|
|
|
|
0
|
$self->set_thresholds(warning => '15:', critical => '5:'); |
375
|
0
|
|
|
|
|
0
|
$self->add_message($self->check_thresholds($self->{uptime} / 60)); |
376
|
|
|
|
|
|
|
$self->add_perfdata( |
377
|
|
|
|
|
|
|
label => 'uptime', |
378
|
0
|
|
|
|
|
0
|
value => $self->{uptime} / 60, |
379
|
|
|
|
|
|
|
places => 0, |
380
|
|
|
|
|
|
|
); |
381
|
0
|
0
|
|
|
|
0
|
if ($self->opts->report ne 'short') { |
382
|
0
|
|
|
|
|
0
|
$self->add_ok($self->pretty_sysdesc($self->{productname})); |
383
|
|
|
|
|
|
|
} |
384
|
0
|
|
|
|
|
0
|
my ($code, $message) = $self->check_messages(join => ', ', join_all => ', '); |
385
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::plugin->nagios_exit($code, $message); |
386
|
|
|
|
|
|
|
} elsif ($self->mode =~ /device::supportedmibs/) { |
387
|
0
|
|
|
|
|
0
|
our $mibdepot = []; |
388
|
0
|
|
|
|
|
0
|
my $unknowns = {}; |
389
|
0
|
|
|
|
|
0
|
my @outputlist = (); |
390
|
0
|
|
|
|
|
0
|
%{$unknowns} = %{$self->rawdata}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
391
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->name && -f $self->opts->name) { |
|
|
0
|
0
|
|
|
|
|
392
|
0
|
|
|
|
|
0
|
eval { require $self->opts->name }; |
|
0
|
|
|
|
|
0
|
|
393
|
0
|
0
|
|
|
|
0
|
$self->add_critical($@) if $@; |
394
|
|
|
|
|
|
|
} elsif ($self->opts->name && ! -f $self->opts->name) { |
395
|
0
|
|
|
|
|
0
|
$self->add_unknown("where is --name mibdepotfile?"); |
396
|
|
|
|
|
|
|
} |
397
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.60', 'ietf', 'v2', 'ACCOUNTING-CONTROL-MIB']); |
|
0
|
|
|
|
|
0
|
|
398
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.238', 'ietf', 'v2', 'ADSL2-LINE-MIB']); |
|
0
|
|
|
|
|
0
|
|
399
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.238.2', 'ietf', 'v2', 'ADSL2-LINE-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
400
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.94.3', 'ietf', 'v2', 'ADSL-LINE-EXT-MIB']); |
|
0
|
|
|
|
|
0
|
|
401
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.94', 'ietf', 'v2', 'ADSL-LINE-MIB']); |
|
0
|
|
|
|
|
0
|
|
402
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.94.2', 'ietf', 'v2', 'ADSL-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
403
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.74', 'ietf', 'v2', 'AGENTX-MIB']); |
|
0
|
|
|
|
|
0
|
|
404
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.123', 'ietf', 'v2', 'AGGREGATE-MIB']); |
|
0
|
|
|
|
|
0
|
|
405
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.118', 'ietf', 'v2', 'ALARM-MIB']); |
|
0
|
|
|
|
|
0
|
|
406
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.23', 'ietf', 'v2', 'APM-MIB']); |
|
0
|
|
|
|
|
0
|
|
407
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.3', 'ietf', 'v2', 'APPC-MIB']); |
|
0
|
|
|
|
|
0
|
|
408
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.13.1', 'ietf', 'v1', 'APPLETALK-MIB']); |
|
0
|
|
|
|
|
0
|
|
409
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.27', 'ietf', 'v2', 'APPLICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
410
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.62', 'ietf', 'v2', 'APPLICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
411
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.5', 'ietf', 'v2', 'APPN-DLUR-MIB']); |
|
0
|
|
|
|
|
0
|
|
412
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.4', 'ietf', 'v2', 'APPN-MIB']); |
|
0
|
|
|
|
|
0
|
|
413
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.4', 'ietf', 'v2', 'APPN-MIB']); |
|
0
|
|
|
|
|
0
|
|
414
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.4.0', 'ietf', 'v2', 'APPN-TRAP-MIB']); |
|
0
|
|
|
|
|
0
|
|
415
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.49', 'ietf', 'v2', 'APS-MIB']); |
|
0
|
|
|
|
|
0
|
|
416
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.117', 'ietf', 'v2', 'ARC-MIB']); |
|
0
|
|
|
|
|
0
|
|
417
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.37.1.14', 'ietf', 'v2', 'ATM2-MIB']); |
|
0
|
|
|
|
|
0
|
|
418
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.59', 'ietf', 'v2', 'ATM-ACCOUNTING-INFORMATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
419
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.37', 'ietf', 'v2', 'ATM-MIB']); |
|
0
|
|
|
|
|
0
|
|
420
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.37', 'ietf', 'v2', 'ATM-MIB']); |
|
0
|
|
|
|
|
0
|
|
421
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.37.3', 'ietf', 'v2', 'ATM-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
422
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.15', 'ietf', 'v2', 'BGP4-MIB']); |
|
0
|
|
|
|
|
0
|
|
423
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.15', 'ietf', 'v2', 'BGP4-MIB']); |
|
0
|
|
|
|
|
0
|
|
424
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.122', 'ietf', 'v2', 'BLDG-HVAC-MIB']); |
|
0
|
|
|
|
|
0
|
|
425
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17.1', 'ietf', 'v1', 'BRIDGE-MIB']); |
|
0
|
|
|
|
|
0
|
|
426
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17', 'ietf', 'v2', 'BRIDGE-MIB']); |
|
0
|
|
|
|
|
0
|
|
427
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.19', 'ietf', 'v2', 'CHARACTER-MIB']); |
|
0
|
|
|
|
|
0
|
|
428
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.94', 'ietf', 'v2', 'CIRCUIT-IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
429
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.1.1', 'ietf', 'v1', 'CLNS-MIB']); |
|
0
|
|
|
|
|
0
|
|
430
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.1.1', 'ietf', 'v1', 'CLNS-MIB']); |
|
0
|
|
|
|
|
0
|
|
431
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.132', 'ietf', 'v2', 'COFFEE-POT-MIB']); |
|
0
|
|
|
|
|
0
|
|
432
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.89', 'ietf', 'v2', 'COPS-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
433
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.18.1', 'ietf', 'v1', 'DECNET-PHIV-MIB']); |
|
0
|
|
|
|
|
0
|
|
434
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.21', 'ietf', 'v2', 'DIAL-CONTROL-MIB']); |
|
0
|
|
|
|
|
0
|
|
435
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.108', 'ietf', 'v2', 'DIFFSERV-CONFIG-MIB']); |
|
0
|
|
|
|
|
0
|
|
436
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.97', 'ietf', 'v2', 'DIFFSERV-MIB']); |
|
0
|
|
|
|
|
0
|
|
437
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.66', 'ietf', 'v2', 'DIRECTORY-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
438
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.88', 'ietf', 'v2', 'DISMAN-EVENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
439
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.90', 'ietf', 'v2', 'DISMAN-EXPRESSION-MIB']); |
|
0
|
|
|
|
|
0
|
|
440
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.82', 'ietf', 'v2', 'DISMAN-NSLOOKUP-MIB']); |
|
0
|
|
|
|
|
0
|
|
441
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.82', 'ietf', 'v2', 'DISMAN-NSLOOKUP-MIB']); |
|
0
|
|
|
|
|
0
|
|
442
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.80', 'ietf', 'v2', 'DISMAN-PING-MIB']); |
|
0
|
|
|
|
|
0
|
|
443
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.80', 'ietf', 'v2', 'DISMAN-PING-MIB']); |
|
0
|
|
|
|
|
0
|
|
444
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.63', 'ietf', 'v2', 'DISMAN-SCHEDULE-MIB']); |
|
0
|
|
|
|
|
0
|
|
445
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.63', 'ietf', 'v2', 'DISMAN-SCHEDULE-MIB']); |
|
0
|
|
|
|
|
0
|
|
446
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.64', 'ietf', 'v2', 'DISMAN-SCRIPT-MIB']); |
|
0
|
|
|
|
|
0
|
|
447
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.64', 'ietf', 'v2', 'DISMAN-SCRIPT-MIB']); |
|
0
|
|
|
|
|
0
|
|
448
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.81', 'ietf', 'v2', 'DISMAN-TRACEROUTE-MIB']); |
|
0
|
|
|
|
|
0
|
|
449
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.81', 'ietf', 'v2', 'DISMAN-TRACEROUTE-MIB']); |
|
0
|
|
|
|
|
0
|
|
450
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.46', 'ietf', 'v2', 'DLSW-MIB']); |
|
0
|
|
|
|
|
0
|
|
451
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.32.2', 'ietf', 'v2', 'DNS-RESOLVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
452
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.32.1', 'ietf', 'v2', 'DNS-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
453
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.127.5', 'ietf', 'v2', 'DOCS-BPI-MIB']); |
|
0
|
|
|
|
|
0
|
|
454
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.69', 'ietf', 'v2', 'DOCS-CABLE-DEVICE-MIB']); |
|
0
|
|
|
|
|
0
|
|
455
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.69', 'ietf', 'v2', 'DOCS-CABLE-DEVICE-MIB']); |
|
0
|
|
|
|
|
0
|
|
456
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.126', 'ietf', 'v2', 'DOCS-IETF-BPI2-MIB']); |
|
0
|
|
|
|
|
0
|
|
457
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.132', 'ietf', 'v2', 'DOCS-IETF-CABLE-DEVICE-NOTIFICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
458
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.127', 'ietf', 'v2', 'DOCS-IETF-QOS-MIB']); |
|
0
|
|
|
|
|
0
|
|
459
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.125', 'ietf', 'v2', 'DOCS-IETF-SUBMGT-MIB']); |
|
0
|
|
|
|
|
0
|
|
460
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.127', 'ietf', 'v2', 'DOCS-IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
461
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.127', 'ietf', 'v2', 'DOCS-IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
462
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.45', 'ietf', 'v2', 'DOT12-IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
463
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.53', 'ietf', 'v2', 'DOT12-RPTR-MIB']); |
|
0
|
|
|
|
|
0
|
|
464
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.155', 'ietf', 'v2', 'DOT3-EPON-MIB']); |
|
0
|
|
|
|
|
0
|
|
465
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.158', 'ietf', 'v2', 'DOT3-OAM-MIB']); |
|
0
|
|
|
|
|
0
|
|
466
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.2.2.1.1', 'ietf', 'v1', 'DPI20-MIB']); |
|
0
|
|
|
|
|
0
|
|
467
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.82', 'ietf', 'v2', 'DS0BUNDLE-MIB']); |
|
0
|
|
|
|
|
0
|
|
468
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.81', 'ietf', 'v2', 'DS0-MIB']); |
|
0
|
|
|
|
|
0
|
|
469
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.18', 'ietf', 'v2', 'DS1-MIB']); |
|
0
|
|
|
|
|
0
|
|
470
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.18', 'ietf', 'v2', 'DS1-MIB']); |
|
0
|
|
|
|
|
0
|
|
471
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.18', 'ietf', 'v2', 'DS1-MIB']); |
|
0
|
|
|
|
|
0
|
|
472
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.30', 'ietf', 'v2', 'DS3-MIB']); |
|
0
|
|
|
|
|
0
|
|
473
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.30', 'ietf', 'v2', 'DS3-MIB']); |
|
0
|
|
|
|
|
0
|
|
474
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.29', 'ietf', 'v2', 'DSA-MIB']); |
|
0
|
|
|
|
|
0
|
|
475
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.26', 'ietf', 'v2', 'DSMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
476
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.7', 'ietf', 'v2', 'EBN-MIB']); |
|
0
|
|
|
|
|
0
|
|
477
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.167', 'ietf', 'v2', 'EFM-CU-MIB']); |
|
0
|
|
|
|
|
0
|
|
478
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.47', 'ietf', 'v2', 'ENTITY-MIB']); |
|
0
|
|
|
|
|
0
|
|
479
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.47', 'ietf', 'v2', 'ENTITY-MIB']); |
|
0
|
|
|
|
|
0
|
|
480
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.47', 'ietf', 'v2', 'ENTITY-MIB']); |
|
0
|
|
|
|
|
0
|
|
481
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.99', 'ietf', 'v2', 'ENTITY-SENSOR-MIB']); |
|
0
|
|
|
|
|
0
|
|
482
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.131', 'ietf', 'v2', 'ENTITY-STATE-MIB']); |
|
0
|
|
|
|
|
0
|
|
483
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.130', 'ietf', 'v2', 'ENTITY-STATE-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
484
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.70', 'ietf', 'v2', 'ETHER-CHIPSET-MIB']); |
|
0
|
|
|
|
|
0
|
|
485
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.7', 'ietf', 'v1', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
486
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.7', 'ietf', 'v1', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
487
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.35', 'ietf', 'v2', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
488
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.35', 'ietf', 'v2', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
489
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.35', 'ietf', 'v2', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
490
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.35', 'ietf', 'v2', 'EtherLike-MIB']); |
|
0
|
|
|
|
|
0
|
|
491
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.224', 'ietf', 'v2', 'FCIP-MGMT-MIB']); |
|
0
|
|
|
|
|
0
|
|
492
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.56', 'ietf', 'v2', 'FC-MGMT-MIB']); |
|
0
|
|
|
|
|
0
|
|
493
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.15.73.1', 'ietf', 'v1', 'FDDI-SMT73-MIB']); |
|
0
|
|
|
|
|
0
|
|
494
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.75', 'ietf', 'v2', 'FIBRE-CHANNEL-FE-MIB']); |
|
0
|
|
|
|
|
0
|
|
495
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.111', 'ietf', 'v2', 'Finisher-MIB']); |
|
0
|
|
|
|
|
0
|
|
496
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.40', 'ietf', 'v2', 'FLOW-METER-MIB']); |
|
0
|
|
|
|
|
0
|
|
497
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.40', 'ietf', 'v2', 'FLOW-METER-MIB']); |
|
0
|
|
|
|
|
0
|
|
498
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.32', 'ietf', 'v2', 'FRAME-RELAY-DTE-MIB']); |
|
0
|
|
|
|
|
0
|
|
499
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.86', 'ietf', 'v2', 'FR-ATM-PVC-SERVICE-IWF-MIB']); |
|
0
|
|
|
|
|
0
|
|
500
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.47', 'ietf', 'v2', 'FR-MFR-MIB']); |
|
0
|
|
|
|
|
0
|
|
501
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.44', 'ietf', 'v2', 'FRNETSERV-MIB']); |
|
0
|
|
|
|
|
0
|
|
502
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.44', 'ietf', 'v2', 'FRNETSERV-MIB']); |
|
0
|
|
|
|
|
0
|
|
503
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.44', 'ietf', 'v2', 'FRNETSERV-MIB']); |
|
0
|
|
|
|
|
0
|
|
504
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.95', 'ietf', 'v2', 'FRSLD-MIB']); |
|
0
|
|
|
|
|
0
|
|
505
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.16', 'ietf', 'v2', 'GMPLS-LABEL-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
506
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.15', 'ietf', 'v2', 'GMPLS-LSR-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
507
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.12', 'ietf', 'v2', 'GMPLS-TC-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
508
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.13', 'ietf', 'v2', 'GMPLS-TE-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
509
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.98', 'ietf', 'v2', 'GSMP-MIB']); |
|
0
|
|
|
|
|
0
|
|
510
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.29', 'ietf', 'v2', 'HC-ALARM-MIB']); |
|
0
|
|
|
|
|
0
|
|
511
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.107', 'ietf', 'v2', 'HC-PerfHist-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
512
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.20.5', 'ietf', 'v2', 'HC-RMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
513
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.25.1', 'ietf', 'v1', 'HOST-RESOURCES-MIB']); |
|
0
|
|
|
|
|
0
|
|
514
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.25.1', 'ietf', 'v2', 'HOST-RESOURCES-MIB']); |
|
0
|
|
|
|
|
0
|
|
515
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.6.1.5', 'ietf', 'v2', 'HPR-IP-MIB']); |
|
0
|
|
|
|
|
0
|
|
516
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.6', 'ietf', 'v2', 'HPR-MIB']); |
|
0
|
|
|
|
|
0
|
|
517
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.106', 'ietf', 'v2', 'IANA-CHARSET-MIB']); |
|
0
|
|
|
|
|
0
|
|
518
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.110', 'ietf', 'v2', 'IANA-FINISHER-MIB']); |
|
0
|
|
|
|
|
0
|
|
519
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.152', 'ietf', 'v2', 'IANA-GMPLS-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
520
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.30', 'ietf', 'v2', 'IANAifType-MIB']); |
|
0
|
|
|
|
|
0
|
|
521
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.128', 'ietf', 'v2', 'IANA-IPPM-METRICS-REGISTRY-MIB']); |
|
0
|
|
|
|
|
0
|
|
522
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.119', 'ietf', 'v2', 'IANA-ITU-ALARM-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
523
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.154', 'ietf', 'v2', 'IANA-MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
524
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.109', 'ietf', 'v2', 'IANA-PRINTER-MIB']); |
|
0
|
|
|
|
|
0
|
|
525
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.2.6.2.13.1.1', 'ietf', 'v1', 'IBM-6611-APPN-MIB']); |
|
0
|
|
|
|
|
0
|
|
526
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.166', 'ietf', 'v2', 'IF-CAP-STACK-MIB']); |
|
0
|
|
|
|
|
0
|
|
527
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.230', 'ietf', 'v2', 'IFCP-MGMT-MIB']); |
|
0
|
|
|
|
|
0
|
|
528
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.77', 'ietf', 'v2', 'IF-INVERTED-STACK-MIB']); |
|
0
|
|
|
|
|
0
|
|
529
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.31', 'ietf', 'v2', 'IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
530
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.31', 'ietf', 'v2', 'IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
531
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.31', 'ietf', 'v2', 'IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
532
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.85', 'ietf', 'v2', 'IGMP-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
533
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.76', 'ietf', 'v2', 'INET-ADDRESS-MIB']); |
|
0
|
|
|
|
|
0
|
|
534
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.76', 'ietf', 'v2', 'INET-ADDRESS-MIB']); |
|
0
|
|
|
|
|
0
|
|
535
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.76', 'ietf', 'v2', 'INET-ADDRESS-MIB']); |
|
0
|
|
|
|
|
0
|
|
536
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.52.5', 'ietf', 'v2', 'INTEGRATED-SERVICES-GUARANTEED-MIB']); |
|
0
|
|
|
|
|
0
|
|
537
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.52', 'ietf', 'v2', 'INTEGRATED-SERVICES-MIB']); |
|
0
|
|
|
|
|
0
|
|
538
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.27', 'ietf', 'v2', 'INTERFACETOPN-MIB']); |
|
0
|
|
|
|
|
0
|
|
539
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.17', 'ietf', 'v2', 'IPATM-IPMC-MIB']); |
|
0
|
|
|
|
|
0
|
|
540
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.57', 'ietf', 'v2', 'IPATM-IPMC-MIB']); |
|
0
|
|
|
|
|
0
|
|
541
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.4.24', 'ietf', 'v2', 'IP-FORWARD-MIB']); |
|
0
|
|
|
|
|
0
|
|
542
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.4.24', 'ietf', 'v2', 'IP-FORWARD-MIB']); |
|
0
|
|
|
|
|
0
|
|
543
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.168', 'ietf', 'v2', 'IPMCAST-MIB']); |
|
0
|
|
|
|
|
0
|
|
544
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.48', 'ietf', 'v2', 'IP-MIB']); |
|
0
|
|
|
|
|
0
|
|
545
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.48', 'ietf', 'v2', 'IP-MIB']); |
|
0
|
|
|
|
|
0
|
|
546
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.83', 'ietf', 'v2', 'IPMROUTE-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
547
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.46', 'ietf', 'v2', 'IPOA-MIB']); |
|
0
|
|
|
|
|
0
|
|
548
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.141', 'ietf', 'v2', 'IPS-AUTH-MIB']); |
|
0
|
|
|
|
|
0
|
|
549
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.153', 'ietf', 'v2', 'IPSEC-SPD-MIB']); |
|
0
|
|
|
|
|
0
|
|
550
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.103', 'ietf', 'v2', 'IPV6-FLOW-LABEL-MIB']); |
|
0
|
|
|
|
|
0
|
|
551
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.56', 'ietf', 'v2', 'IPV6-ICMP-MIB']); |
|
0
|
|
|
|
|
0
|
|
552
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.55', 'ietf', 'v2', 'IPV6-MIB']); |
|
0
|
|
|
|
|
0
|
|
553
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.91', 'ietf', 'v2', 'IPV6-MLD-MIB']); |
|
0
|
|
|
|
|
0
|
|
554
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.86', 'ietf', 'v2', 'IPV6-TCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
555
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.87', 'ietf', 'v2', 'IPV6-UDP-MIB']); |
|
0
|
|
|
|
|
0
|
|
556
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.142', 'ietf', 'v2', 'ISCSI-MIB']); |
|
0
|
|
|
|
|
0
|
|
557
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.20', 'ietf', 'v2', 'ISDN-MIB']); |
|
0
|
|
|
|
|
0
|
|
558
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.138', 'ietf', 'v2', 'ISIS-MIB']); |
|
0
|
|
|
|
|
0
|
|
559
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.163', 'ietf', 'v2', 'ISNS-MIB']); |
|
0
|
|
|
|
|
0
|
|
560
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.121', 'ietf', 'v2', 'ITU-ALARM-MIB']); |
|
0
|
|
|
|
|
0
|
|
561
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.120', 'ietf', 'v2', 'ITU-ALARM-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
562
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.2699.1.1', 'ietf', 'v2', 'Job-Monitoring-MIB']); |
|
0
|
|
|
|
|
0
|
|
563
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.95', 'ietf', 'v2', 'L2TP-MIB']); |
|
0
|
|
|
|
|
0
|
|
564
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.165', 'ietf', 'v2', 'LANGTAG-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
565
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.227', 'ietf', 'v2', 'LMP-MIB']); |
|
0
|
|
|
|
|
0
|
|
566
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.227', 'ietf', 'v2', 'LMP-MIB']); |
|
0
|
|
|
|
|
0
|
|
567
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.101', 'ietf', 'v2', 'MALLOC-MIB']); |
|
0
|
|
|
|
|
0
|
|
568
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.26.1', 'ietf', 'v1', 'MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
569
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.26.6', 'ietf', 'v2', 'MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
570
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.26.6', 'ietf', 'v2', 'MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
571
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.26.6', 'ietf', 'v2', 'MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
572
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.26.6', 'ietf', 'v2', 'MAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
573
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.171', 'ietf', 'v2', 'MIDCOM-MIB']); |
|
0
|
|
|
|
|
0
|
|
574
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.38.1', 'ietf', 'v1', 'MIOX25-MIB']); |
|
0
|
|
|
|
|
0
|
|
575
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.44', 'ietf', 'v2', 'MIP-MIB']); |
|
0
|
|
|
|
|
0
|
|
576
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.133', 'ietf', 'v2', 'MOBILEIPV6-MIB']); |
|
0
|
|
|
|
|
0
|
|
577
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.38', 'ietf', 'v2', 'Modem-MIB']); |
|
0
|
|
|
|
|
0
|
|
578
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.8', 'ietf', 'v2', 'MPLS-FTN-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
579
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.11', 'ietf', 'v2', 'MPLS-L3VPN-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
580
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.9', 'ietf', 'v2', 'MPLS-LC-ATM-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
581
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.10', 'ietf', 'v2', 'MPLS-LC-FR-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
582
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.5', 'ietf', 'v2', 'MPLS-LDP-ATM-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
583
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.6', 'ietf', 'v2', 'MPLS-LDP-FRAME-RELAY-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
584
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.7', 'ietf', 'v2', 'MPLS-LDP-GENERIC-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
585
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.9.10.65', 'ietf', 'v2', 'MPLS-LDP-MIB']); |
|
0
|
|
|
|
|
0
|
|
586
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.4', 'ietf', 'v2', 'MPLS-LDP-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
587
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.2', 'ietf', 'v2', 'MPLS-LSR-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
588
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.1', 'ietf', 'v2', 'MPLS-TC-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
589
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.166.3', 'ietf', 'v2', 'MPLS-TE-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
590
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.92', 'ietf', 'v2', 'MSDP-MIB']); |
|
0
|
|
|
|
|
0
|
|
591
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.28', 'ietf', 'v2', 'MTA-MIB']); |
|
0
|
|
|
|
|
0
|
|
592
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.28', 'ietf', 'v2', 'MTA-MIB']); |
|
0
|
|
|
|
|
0
|
|
593
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.28', 'ietf', 'v2', 'MTA-MIB']); |
|
0
|
|
|
|
|
0
|
|
594
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.123', 'ietf', 'v2', 'NAT-MIB']); |
|
0
|
|
|
|
|
0
|
|
595
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.27', 'ietf', 'v2', 'NETWORK-SERVICES-MIB']); |
|
0
|
|
|
|
|
0
|
|
596
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.27', 'ietf', 'v2', 'NETWORK-SERVICES-MIB']); |
|
0
|
|
|
|
|
0
|
|
597
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.71', 'ietf', 'v2', 'NHRP-MIB']); |
|
0
|
|
|
|
|
0
|
|
598
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.92', 'ietf', 'v2', 'NOTIFICATION-LOG-MIB']); |
|
0
|
|
|
|
|
0
|
|
599
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.133', 'ietf', 'v2', 'OPT-IF-MIB']); |
|
0
|
|
|
|
|
0
|
|
600
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.14', 'ietf', 'v2', 'OSPF-MIB']); |
|
0
|
|
|
|
|
0
|
|
601
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.14', 'ietf', 'v2', 'OSPF-MIB']); |
|
0
|
|
|
|
|
0
|
|
602
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.14.16', 'ietf', 'v2', 'OSPF-TRAP-MIB']); |
|
0
|
|
|
|
|
0
|
|
603
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.14.16', 'ietf', 'v2', 'OSPF-TRAP-MIB']); |
|
0
|
|
|
|
|
0
|
|
604
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.34', 'ietf', 'v2', 'PARALLEL-MIB']); |
|
0
|
|
|
|
|
0
|
|
605
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17.6', 'ietf', 'v2', 'P-BRIDGE-MIB']); |
|
0
|
|
|
|
|
0
|
|
606
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.58', 'ietf', 'v2', 'PerfHist-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
607
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.58', 'ietf', 'v2', 'PerfHist-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
608
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.172', 'ietf', 'v2', 'PIM-BSR-MIB']); |
|
0
|
|
|
|
|
0
|
|
609
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.61', 'ietf', 'v2', 'PIM-MIB']); |
|
0
|
|
|
|
|
0
|
|
610
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.157', 'ietf', 'v2', 'PIM-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
611
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.93', 'ietf', 'v2', 'PINT-MIB']); |
|
0
|
|
|
|
|
0
|
|
612
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.140', 'ietf', 'v2', 'PKTC-IETF-MTA-MIB']); |
|
0
|
|
|
|
|
0
|
|
613
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.169', 'ietf', 'v2', 'PKTC-IETF-SIG-MIB']); |
|
0
|
|
|
|
|
0
|
|
614
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.124', 'ietf', 'v2', 'POLICY-BASED-MANAGEMENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
615
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.105', 'ietf', 'v2', 'POWER-ETHERNET-MIB']); |
|
0
|
|
|
|
|
0
|
|
616
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.23.4', 'ietf', 'v1', 'PPP-BRIDGE-NCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
617
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.23.3', 'ietf', 'v1', 'PPP-IP-NCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
618
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.23.1.1', 'ietf', 'v1', 'PPP-LCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
619
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.23.2', 'ietf', 'v1', 'PPP-SEC-MIB']); |
|
0
|
|
|
|
|
0
|
|
620
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.43', 'ietf', 'v2', 'Printer-MIB']); |
|
0
|
|
|
|
|
0
|
|
621
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.43', 'ietf', 'v2', 'Printer-MIB']); |
|
0
|
|
|
|
|
0
|
|
622
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.79', 'ietf', 'v2', 'PTOPO-MIB']); |
|
0
|
|
|
|
|
0
|
|
623
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17.7', 'ietf', 'v2', 'Q-BRIDGE-MIB']); |
|
0
|
|
|
|
|
0
|
|
624
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.2.2', 'ietf', 'v2', 'RADIUS-ACC-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
625
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.2.2', 'ietf', 'v2', 'RADIUS-ACC-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
626
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.2.1', 'ietf', 'v2', 'RADIUS-ACC-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
627
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.2.1', 'ietf', 'v2', 'RADIUS-ACC-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
628
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.1.2', 'ietf', 'v2', 'RADIUS-AUTH-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
629
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.1.2', 'ietf', 'v2', 'RADIUS-AUTH-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
630
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.1.1', 'ietf', 'v2', 'RADIUS-AUTH-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
631
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.67.1.1', 'ietf', 'v2', 'RADIUS-AUTH-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
632
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.145', 'ietf', 'v2', 'RADIUS-DYNAUTH-CLIENT-MIB']); |
|
0
|
|
|
|
|
0
|
|
633
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.146', 'ietf', 'v2', 'RADIUS-DYNAUTH-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
634
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.31', 'ietf', 'v2', 'RAQMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
635
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.32', 'ietf', 'v2', 'RAQMON-RDS-MIB']); |
|
0
|
|
|
|
|
0
|
|
636
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.39', 'ietf', 'v2', 'RDBMS-MIB']); |
|
0
|
|
|
|
|
0
|
|
637
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.1', 'ietf', 'v1', 'RFC1066-MIB']); |
|
0
|
|
|
|
|
0
|
|
638
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.1', 'ietf', 'v1', 'RFC1156-MIB']); |
|
0
|
|
|
|
|
0
|
|
639
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.1', 'ietf', 'v1', 'RFC1158-MIB']); |
|
0
|
|
|
|
|
0
|
|
640
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.1', 'ietf', 'v1', 'RFC1213-MIB']); |
|
0
|
|
|
|
|
0
|
|
641
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.12', 'ietf', 'v1', 'RFC1229-MIB']); |
|
0
|
|
|
|
|
0
|
|
642
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.7', 'ietf', 'v1', 'RFC1230-MIB']); |
|
0
|
|
|
|
|
0
|
|
643
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.9', 'ietf', 'v1', 'RFC1231-MIB']); |
|
0
|
|
|
|
|
0
|
|
644
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.2', 'ietf', 'v1', 'RFC1232-MIB']); |
|
0
|
|
|
|
|
0
|
|
645
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.15', 'ietf', 'v1', 'RFC1233-MIB']); |
|
0
|
|
|
|
|
0
|
|
646
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.13.1', 'ietf', 'v1', 'RFC1243-MIB']); |
|
0
|
|
|
|
|
0
|
|
647
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.13.1', 'ietf', 'v1', 'RFC1248-MIB']); |
|
0
|
|
|
|
|
0
|
|
648
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.13.1', 'ietf', 'v1', 'RFC1252-MIB']); |
|
0
|
|
|
|
|
0
|
|
649
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.14.1', 'ietf', 'v1', 'RFC1253-MIB']); |
|
0
|
|
|
|
|
0
|
|
650
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.15', 'ietf', 'v1', 'RFC1269-MIB']); |
|
0
|
|
|
|
|
0
|
|
651
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.1', 'ietf', 'v1', 'RFC1271-MIB']); |
|
0
|
|
|
|
|
0
|
|
652
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.7', 'ietf', 'v1', 'RFC1284-MIB']); |
|
0
|
|
|
|
|
0
|
|
653
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.15.1', 'ietf', 'v1', 'RFC1285-MIB']); |
|
0
|
|
|
|
|
0
|
|
654
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17.1', 'ietf', 'v1', 'RFC1286-MIB']); |
|
0
|
|
|
|
|
0
|
|
655
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.18.1', 'ietf', 'v1', 'RFC1289-phivMIB']); |
|
0
|
|
|
|
|
0
|
|
656
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.31', 'ietf', 'v1', 'RFC1304-MIB']); |
|
0
|
|
|
|
|
0
|
|
657
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.32', 'ietf', 'v1', 'RFC1315-MIB']); |
|
0
|
|
|
|
|
0
|
|
658
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.19', 'ietf', 'v1', 'RFC1316-MIB']); |
|
0
|
|
|
|
|
0
|
|
659
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.33', 'ietf', 'v1', 'RFC1317-MIB']); |
|
0
|
|
|
|
|
0
|
|
660
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.34', 'ietf', 'v1', 'RFC1318-MIB']); |
|
0
|
|
|
|
|
0
|
|
661
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.20.2', 'ietf', 'v1', 'RFC1353-MIB']); |
|
0
|
|
|
|
|
0
|
|
662
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.4.24', 'ietf', 'v1', 'RFC1354-MIB']); |
|
0
|
|
|
|
|
0
|
|
663
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.16', 'ietf', 'v1', 'RFC1381-MIB']); |
|
0
|
|
|
|
|
0
|
|
664
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.5', 'ietf', 'v1', 'RFC1382-MIB']); |
|
0
|
|
|
|
|
0
|
|
665
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.23.1', 'ietf', 'v1', 'RFC1389-MIB']); |
|
0
|
|
|
|
|
0
|
|
666
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.7', 'ietf', 'v1', 'RFC1398-MIB']); |
|
0
|
|
|
|
|
0
|
|
667
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.18', 'ietf', 'v1', 'RFC1406-MIB']); |
|
0
|
|
|
|
|
0
|
|
668
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.30', 'ietf', 'v1', 'RFC1407-MIB']); |
|
0
|
|
|
|
|
0
|
|
669
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.24.1', 'ietf', 'v1', 'RFC1414-MIB']); |
|
0
|
|
|
|
|
0
|
|
670
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.23', 'ietf', 'v2', 'RIPv2-MIB']); |
|
0
|
|
|
|
|
0
|
|
671
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16', 'ietf', 'v2', 'RMON2-MIB']); |
|
0
|
|
|
|
|
0
|
|
672
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16', 'ietf', 'v2', 'RMON2-MIB']); |
|
0
|
|
|
|
|
0
|
|
673
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.1', 'ietf', 'v1', 'RMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
674
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.20.8', 'ietf', 'v2', 'RMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
675
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.112', 'ietf', 'v2', 'ROHC-MIB']); |
|
0
|
|
|
|
|
0
|
|
676
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.114', 'ietf', 'v2', 'ROHC-RTP-MIB']); |
|
0
|
|
|
|
|
0
|
|
677
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.113', 'ietf', 'v2', 'ROHC-UNCOMPRESSED-MIB']); |
|
0
|
|
|
|
|
0
|
|
678
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.33', 'ietf', 'v2', 'RS-232-MIB']); |
|
0
|
|
|
|
|
0
|
|
679
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.134', 'ietf', 'v2', 'RSTP-MIB']); |
|
0
|
|
|
|
|
0
|
|
680
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.51', 'ietf', 'v2', 'RSVP-MIB']); |
|
0
|
|
|
|
|
0
|
|
681
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.87', 'ietf', 'v2', 'RTP-MIB']); |
|
0
|
|
|
|
|
0
|
|
682
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.139', 'ietf', 'v2', 'SCSI-MIB']); |
|
0
|
|
|
|
|
0
|
|
683
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.104', 'ietf', 'v2', 'SCTP-MIB']); |
|
0
|
|
|
|
|
0
|
|
684
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.4300.1', 'ietf', 'v2', 'SFLOW-MIB']); |
|
0
|
|
|
|
|
0
|
|
685
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.149', 'ietf', 'v2', 'SIP-COMMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
686
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.36', 'ietf', 'v2', 'SIP-MIB']); |
|
0
|
|
|
|
|
0
|
|
687
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.151', 'ietf', 'v2', 'SIP-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
688
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.148', 'ietf', 'v2', 'SIP-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
689
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.150', 'ietf', 'v2', 'SIP-UA-MIB']); |
|
0
|
|
|
|
|
0
|
|
690
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.88', 'ietf', 'v2', 'SLAPM-MIB']); |
|
0
|
|
|
|
|
0
|
|
691
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.22', 'ietf', 'v2', 'SMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
692
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.4.4', 'ietf', 'v1', 'SMUX-MIB']); |
|
0
|
|
|
|
|
0
|
|
693
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34', 'ietf', 'v2', 'SNA-NAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
694
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34', 'ietf', 'v2', 'SNA-NAU-MIB']); |
|
0
|
|
|
|
|
0
|
|
695
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.41', 'ietf', 'v2', 'SNA-SDLC-MIB']); |
|
0
|
|
|
|
|
0
|
|
696
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.18', 'ietf', 'v2', 'SNMP-COMMUNITY-MIB']); |
|
0
|
|
|
|
|
0
|
|
697
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.18', 'ietf', 'v2', 'SNMP-COMMUNITY-MIB']); |
|
0
|
|
|
|
|
0
|
|
698
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.10', 'ietf', 'v2', 'SNMP-FRAMEWORK-MIB']); |
|
0
|
|
|
|
|
0
|
|
699
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.10', 'ietf', 'v2', 'SNMP-FRAMEWORK-MIB']); |
|
0
|
|
|
|
|
0
|
|
700
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.10', 'ietf', 'v2', 'SNMP-FRAMEWORK-MIB']); |
|
0
|
|
|
|
|
0
|
|
701
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.21', 'ietf', 'v2', 'SNMP-IEEE802-TM-MIB']); |
|
0
|
|
|
|
|
0
|
|
702
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.11', 'ietf', 'v2', 'SNMP-MPD-MIB']); |
|
0
|
|
|
|
|
0
|
|
703
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.11', 'ietf', 'v2', 'SNMP-MPD-MIB']); |
|
0
|
|
|
|
|
0
|
|
704
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.11', 'ietf', 'v2', 'SNMP-MPD-MIB']); |
|
0
|
|
|
|
|
0
|
|
705
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.13', 'ietf', 'v2', 'SNMP-NOTIFICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
706
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.13', 'ietf', 'v2', 'SNMP-NOTIFICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
707
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.13', 'ietf', 'v2', 'SNMP-NOTIFICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
708
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.14', 'ietf', 'v2', 'SNMP-PROXY-MIB']); |
|
0
|
|
|
|
|
0
|
|
709
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.14', 'ietf', 'v2', 'SNMP-PROXY-MIB']); |
|
0
|
|
|
|
|
0
|
|
710
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.14', 'ietf', 'v2', 'SNMP-PROXY-MIB']); |
|
0
|
|
|
|
|
0
|
|
711
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.22.1.1', 'ietf', 'v1', 'SNMP-REPEATER-MIB']); |
|
0
|
|
|
|
|
0
|
|
712
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.22.1.1', 'ietf', 'v1', 'SNMP-REPEATER-MIB']); |
|
0
|
|
|
|
|
0
|
|
713
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.22.5', 'ietf', 'v2', 'SNMP-REPEATER-MIB']); |
|
0
|
|
|
|
|
0
|
|
714
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.12', 'ietf', 'v2', 'SNMP-TARGET-MIB']); |
|
0
|
|
|
|
|
0
|
|
715
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.12', 'ietf', 'v2', 'SNMP-TARGET-MIB']); |
|
0
|
|
|
|
|
0
|
|
716
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.12', 'ietf', 'v2', 'SNMP-TARGET-MIB']); |
|
0
|
|
|
|
|
0
|
|
717
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.15', 'ietf', 'v2', 'SNMP-USER-BASED-SM-MIB']); |
|
0
|
|
|
|
|
0
|
|
718
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.15', 'ietf', 'v2', 'SNMP-USER-BASED-SM-MIB']); |
|
0
|
|
|
|
|
0
|
|
719
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.15', 'ietf', 'v2', 'SNMP-USER-BASED-SM-MIB']); |
|
0
|
|
|
|
|
0
|
|
720
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.20', 'ietf', 'v2', 'SNMP-USM-AES-MIB']); |
|
0
|
|
|
|
|
0
|
|
721
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.101', 'ietf', 'v2', 'SNMP-USM-DH-OBJECTS-MIB']); |
|
0
|
|
|
|
|
0
|
|
722
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.2', 'ietf', 'v2', 'SNMPv2-M2M-MIB']); |
|
0
|
|
|
|
|
0
|
|
723
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.1', 'ietf', 'v2', 'SNMPv2-MIB']); |
|
0
|
|
|
|
|
0
|
|
724
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.1', 'ietf', 'v2', 'SNMPv2-MIB']); |
|
0
|
|
|
|
|
0
|
|
725
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.1', 'ietf', 'v2', 'SNMPv2-MIB']); |
|
0
|
|
|
|
|
0
|
|
726
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.3', 'ietf', 'v2', 'SNMPv2-PARTY-MIB']); |
|
0
|
|
|
|
|
0
|
|
727
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.6', 'ietf', 'v2', 'SNMPv2-USEC-MIB']); |
|
0
|
|
|
|
|
0
|
|
728
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.16', 'ietf', 'v2', 'SNMP-VIEW-BASED-ACM-MIB']); |
|
0
|
|
|
|
|
0
|
|
729
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.16', 'ietf', 'v2', 'SNMP-VIEW-BASED-ACM-MIB']); |
|
0
|
|
|
|
|
0
|
|
730
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.6.3.16', 'ietf', 'v2', 'SNMP-VIEW-BASED-ACM-MIB']); |
|
0
|
|
|
|
|
0
|
|
731
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.39', 'ietf', 'v2', 'SONET-MIB']); |
|
0
|
|
|
|
|
0
|
|
732
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.39', 'ietf', 'v2', 'SONET-MIB']); |
|
0
|
|
|
|
|
0
|
|
733
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.39', 'ietf', 'v2', 'SONET-MIB']); |
|
0
|
|
|
|
|
0
|
|
734
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.17.3', 'ietf', 'v1', 'SOURCE-ROUTING-MIB']); |
|
0
|
|
|
|
|
0
|
|
735
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.28', 'ietf', 'v2', 'SSPM-MIB']); |
|
0
|
|
|
|
|
0
|
|
736
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.54', 'ietf', 'v2', 'SYSAPPL-MIB']); |
|
0
|
|
|
|
|
0
|
|
737
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.137', 'ietf', 'v2', 'T11-FC-FABRIC-ADDR-MGR-MIB']); |
|
0
|
|
|
|
|
0
|
|
738
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.162', 'ietf', 'v2', 'T11-FC-FABRIC-CONFIG-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
739
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.159', 'ietf', 'v2', 'T11-FC-FABRIC-LOCK-MIB']); |
|
0
|
|
|
|
|
0
|
|
740
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.143', 'ietf', 'v2', 'T11-FC-FSPF-MIB']); |
|
0
|
|
|
|
|
0
|
|
741
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.135', 'ietf', 'v2', 'T11-FC-NAME-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
742
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.144', 'ietf', 'v2', 'T11-FC-ROUTE-MIB']); |
|
0
|
|
|
|
|
0
|
|
743
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.161', 'ietf', 'v2', 'T11-FC-RSCN-MIB']); |
|
0
|
|
|
|
|
0
|
|
744
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.176', 'ietf', 'v2', 'T11-FC-SP-AUTHENTICATION-MIB']); |
|
0
|
|
|
|
|
0
|
|
745
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.178', 'ietf', 'v2', 'T11-FC-SP-POLICY-MIB']); |
|
0
|
|
|
|
|
0
|
|
746
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.179', 'ietf', 'v2', 'T11-FC-SP-SA-MIB']); |
|
0
|
|
|
|
|
0
|
|
747
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.175', 'ietf', 'v2', 'T11-FC-SP-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
748
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.177', 'ietf', 'v2', 'T11-FC-SP-ZONING-MIB']); |
|
0
|
|
|
|
|
0
|
|
749
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.147', 'ietf', 'v2', 'T11-FC-VIRTUAL-FABRIC-MIB']); |
|
0
|
|
|
|
|
0
|
|
750
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.160', 'ietf', 'v2', 'T11-FC-ZONE-SERVER-MIB']); |
|
0
|
|
|
|
|
0
|
|
751
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.136', 'ietf', 'v2', 'T11-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
752
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.156', 'ietf', 'v2', 'TCP-ESTATS-MIB']); |
|
0
|
|
|
|
|
0
|
|
753
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.23.2.29.1', 'ietf', 'v1', 'TCPIPX-MIB']); |
|
0
|
|
|
|
|
0
|
|
754
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.49', 'ietf', 'v2', 'TCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
755
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.49', 'ietf', 'v2', 'TCP-MIB']); |
|
0
|
|
|
|
|
0
|
|
756
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.200', 'ietf', 'v2', 'TE-LINK-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
757
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.122', 'ietf', 'v2', 'TE-MIB']); |
|
0
|
|
|
|
|
0
|
|
758
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.3.124', 'ietf', 'v2', 'TIME-AGGREGATE-MIB']); |
|
0
|
|
|
|
|
0
|
|
759
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.8', 'ietf', 'v2', 'TN3270E-MIB']); |
|
0
|
|
|
|
|
0
|
|
760
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.34.9', 'ietf', 'v2', 'TN3270E-RT-MIB']); |
|
0
|
|
|
|
|
0
|
|
761
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.9', 'ietf', 'v2', 'TOKENRING-MIB']); |
|
0
|
|
|
|
|
0
|
|
762
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.9', 'ietf', 'v2', 'TOKENRING-MIB']); |
|
0
|
|
|
|
|
0
|
|
763
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.1', 'ietf', 'v1', 'TOKEN-RING-RMON-MIB']); |
|
0
|
|
|
|
|
0
|
|
764
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.42', 'ietf', 'v2', 'TOKENRING-STATION-SR-MIB']); |
|
0
|
|
|
|
|
0
|
|
765
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.16.30', 'ietf', 'v2', 'TPM-MIB']); |
|
0
|
|
|
|
|
0
|
|
766
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.100', 'ietf', 'v2', 'TRANSPORT-ADDRESS-MIB']); |
|
0
|
|
|
|
|
0
|
|
767
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.116', 'ietf', 'v2', 'TRIP-MIB']); |
|
0
|
|
|
|
|
0
|
|
768
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.115', 'ietf', 'v2', 'TRIP-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
769
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.131', 'ietf', 'v2', 'TUNNEL-MIB']); |
|
0
|
|
|
|
|
0
|
|
770
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.131', 'ietf', 'v2', 'TUNNEL-MIB']); |
|
0
|
|
|
|
|
0
|
|
771
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.170', 'ietf', 'v2', 'UDPLITE-MIB']); |
|
0
|
|
|
|
|
0
|
|
772
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.50', 'ietf', 'v2', 'UDP-MIB']); |
|
0
|
|
|
|
|
0
|
|
773
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.50', 'ietf', 'v2', 'UDP-MIB']); |
|
0
|
|
|
|
|
0
|
|
774
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.33', 'ietf', 'v2', 'UPS-MIB']); |
|
0
|
|
|
|
|
0
|
|
775
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.164', 'ietf', 'v2', 'URI-TC-MIB']); |
|
0
|
|
|
|
|
0
|
|
776
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.229', 'ietf', 'v2', 'VDSL-LINE-EXT-MCM-MIB']); |
|
0
|
|
|
|
|
0
|
|
777
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.228', 'ietf', 'v2', 'VDSL-LINE-EXT-SCM-MIB']); |
|
0
|
|
|
|
|
0
|
|
778
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.10.97', 'ietf', 'v2', 'VDSL-LINE-MIB']); |
|
0
|
|
|
|
|
0
|
|
779
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.129', 'ietf', 'v2', 'VPN-TC-STD-MIB']); |
|
0
|
|
|
|
|
0
|
|
780
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.68', 'ietf', 'v2', 'VRRP-MIB']); |
|
0
|
|
|
|
|
0
|
|
781
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.2.1.65', 'ietf', 'v2', 'WWW-MIB']); |
|
0
|
|
|
|
|
0
|
|
782
|
0
|
|
|
|
|
0
|
push(@{$mibdepot}, ['1.3.6.1.4.1.8072', 'net-snmp', 'v2', 'NET-SNMP-MIB']); |
|
0
|
|
|
|
|
0
|
|
783
|
0
|
|
|
|
|
0
|
my $oids = $self->get_entries_by_walk(-varbindlist => [ |
784
|
|
|
|
|
|
|
'1.3.6.1.2.1', '1.3.6.1.4.1', |
785
|
|
|
|
|
|
|
]); |
786
|
0
|
|
|
|
|
0
|
foreach my $mibinfo (@{$mibdepot}) { |
|
0
|
|
|
|
|
0
|
|
787
|
0
|
0
|
0
|
|
|
0
|
next if $self->opts->protocol eq "1" && $mibinfo->[2] ne "v1"; |
788
|
0
|
0
|
0
|
|
|
0
|
next if $self->opts->protocol ne "1" && $mibinfo->[2] eq "v1"; |
789
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mibinfo->[3]} = $mibinfo->[0]; |
790
|
|
|
|
|
|
|
} |
791
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{'MIB-2-MIB'} = "1.3.6.1.2.1"; |
792
|
0
|
|
|
|
|
0
|
foreach my $mib (keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids}) { |
|
0
|
|
|
|
|
0
|
|
793
|
0
|
0
|
|
|
|
0
|
if ($self->implements_mib($mib)) { |
794
|
0
|
|
|
|
|
0
|
push(@outputlist, [$mib, $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}]); |
795
|
0
|
|
|
|
|
0
|
$unknowns = {@{[map { |
796
|
0
|
|
|
|
|
0
|
$_, $self->rawdata->{$_} |
797
|
|
|
|
|
|
|
} grep { |
798
|
|
|
|
|
|
|
substr($_, 0, length($Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib})) ne |
799
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib} || ( |
800
|
|
|
|
|
|
|
substr($_, 0, length($Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib})) eq |
801
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib} && |
802
|
0
|
0
|
0
|
|
|
0
|
substr($_, length($Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}), 1) ne ".") |
803
|
0
|
|
|
|
|
0
|
} keys %{$unknowns}]}}; |
|
0
|
|
|
|
|
0
|
|
804
|
|
|
|
|
|
|
} |
805
|
|
|
|
|
|
|
} |
806
|
0
|
|
|
|
|
0
|
my $toplevels = {}; |
807
|
|
|
|
|
|
|
map { |
808
|
0
|
|
|
|
|
0
|
/^(1\.3\.6\.1\.(\d+)\.(\d+)\.\d+\.\d+)\./; $toplevels->{$1} = 1; |
|
0
|
|
|
|
|
0
|
|
809
|
0
|
|
|
|
|
0
|
} keys %{$unknowns}; |
|
0
|
|
|
|
|
0
|
|
810
|
0
|
|
|
|
|
0
|
foreach (sort {$a cmp $b} keys %{$toplevels}) { |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
811
|
0
|
|
|
|
|
0
|
push(@outputlist, ["", $_]); |
812
|
|
|
|
|
|
|
} |
813
|
0
|
|
|
|
|
0
|
foreach (sort {$a->[0] cmp $b->[0]} @outputlist) { |
|
0
|
|
|
|
|
0
|
|
814
|
0
|
|
|
|
|
0
|
printf "implements %s %s\n", $_->[0], $_->[1]; |
815
|
|
|
|
|
|
|
} |
816
|
0
|
|
|
|
|
0
|
$self->add_ok("have fun"); |
817
|
0
|
|
|
|
|
0
|
my ($code, $message) = $self->check_messages(join => ', ', join_all => ', '); |
818
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::plugin->nagios_exit($code, $message); |
819
|
|
|
|
|
|
|
} elsif ($self->mode =~ /device::supportedoids/) { |
820
|
0
|
|
|
|
|
0
|
my $unknowns = {}; |
821
|
0
|
|
|
|
|
0
|
%{$unknowns} = %{$self->rawdata}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
822
|
0
|
|
|
|
|
0
|
my $confirmed = {}; |
823
|
0
|
|
|
|
|
0
|
foreach my $mib (keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids}) { |
|
0
|
|
|
|
|
0
|
|
824
|
0
|
|
|
|
|
0
|
foreach my $sym (keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
|
0
|
|
|
|
|
0
|
|
825
|
0
|
0
|
|
|
|
0
|
if (my $obj = $self->get_snmp_object($mib, $sym)) { |
826
|
0
|
|
|
|
|
0
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$sym}; |
827
|
0
|
0
|
|
|
|
0
|
if (exists $unknowns->{$oid}) { |
|
|
0
|
|
|
|
|
|
828
|
0
|
|
|
|
|
0
|
$confirmed->{$oid} = sprintf '%s::%s = %s', $mib, $sym, $obj; |
829
|
0
|
|
|
|
|
0
|
delete $unknowns->{$oid}; |
830
|
|
|
|
|
|
|
} elsif (exists $unknowns->{$oid.'.0'}) { |
831
|
0
|
|
|
|
|
0
|
$confirmed->{$oid.'.0'} = sprintf '%s::%s = %s', $mib, $sym, $obj; |
832
|
0
|
|
|
|
|
0
|
delete $unknowns->{$oid.'.0'}; |
833
|
|
|
|
|
|
|
} |
834
|
|
|
|
|
|
|
} |
835
|
0
|
0
|
|
|
|
0
|
if ($sym =~ /Table$/) { |
836
|
0
|
0
|
|
|
|
0
|
if (my @table = $self->get_snmp_table_objects($mib, $sym)) { |
837
|
0
|
|
|
|
|
0
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$sym}; |
838
|
0
|
|
|
|
|
0
|
$confirmed->{$oid} = sprintf '%s::%s', $mib, $sym; |
839
|
0
|
|
|
|
|
0
|
$self->add_rawdata($oid, '--------------------'); |
840
|
0
|
|
|
|
|
0
|
foreach my $line (@table) { |
841
|
0
|
0
|
|
|
|
0
|
if ($line->{flat_indices}) { |
842
|
0
|
|
|
|
|
0
|
foreach my $column (grep !/(flat_indices)|(indices)/, keys %{$line}) { |
|
0
|
|
|
|
|
0
|
|
843
|
0
|
|
|
|
|
0
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$column}; |
844
|
0
|
0
|
|
|
|
0
|
if (exists $unknowns->{$oid.'.'.$line->{flat_indices}}) { |
845
|
|
|
|
|
|
|
$confirmed->{$oid.'.'.$line->{flat_indices}} = |
846
|
0
|
|
|
|
|
0
|
sprintf '%s::%s.%s = %s', $mib, $column, $line->{flat_indices}, $line->{$column}; |
847
|
0
|
|
|
|
|
0
|
delete $unknowns->{$oid.'.'.$line->{flat_indices}}; |
848
|
|
|
|
|
|
|
} |
849
|
|
|
|
|
|
|
} |
850
|
|
|
|
|
|
|
} |
851
|
|
|
|
|
|
|
} |
852
|
|
|
|
|
|
|
} |
853
|
|
|
|
|
|
|
} |
854
|
|
|
|
|
|
|
} |
855
|
|
|
|
|
|
|
} |
856
|
0
|
|
|
|
|
0
|
my @sortedoids = $self->sort_oids([keys %{$self->rawdata}]); |
|
0
|
|
|
|
|
0
|
|
857
|
0
|
|
|
|
|
0
|
foreach (@sortedoids) { |
858
|
0
|
0
|
|
|
|
0
|
if (exists $confirmed->{$_}) { |
859
|
0
|
|
|
|
|
0
|
printf "%s\n", $confirmed->{$_}; |
860
|
|
|
|
|
|
|
} else { |
861
|
0
|
|
|
|
|
0
|
printf "%s = %s\n", $_, $unknowns->{$_}; |
862
|
|
|
|
|
|
|
} |
863
|
|
|
|
|
|
|
} |
864
|
|
|
|
|
|
|
} |
865
|
|
|
|
|
|
|
} |
866
|
|
|
|
|
|
|
|
867
|
|
|
|
|
|
|
sub check_snmp_and_model { |
868
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
869
|
0
|
0
|
|
|
|
0
|
if ($self->opts->snmpwalk) { |
870
|
0
|
|
|
|
|
0
|
my $response = {}; |
871
|
0
|
0
|
|
|
|
0
|
if (! -f $self->opts->snmpwalk) { |
|
|
0
|
|
|
|
|
|
872
|
0
|
|
|
|
|
0
|
$self->add_message(CRITICAL, |
873
|
|
|
|
|
|
|
sprintf 'file %s not found', |
874
|
|
|
|
|
|
|
$self->opts->snmpwalk); |
875
|
|
|
|
|
|
|
} elsif (-x $self->opts->snmpwalk) { |
876
|
0
|
|
|
|
|
0
|
my $cmd = sprintf "%s -ObentU -v%s -c%s %s 1.3.6.1.4.1 2>&1", |
877
|
|
|
|
|
|
|
$self->opts->snmpwalk, |
878
|
|
|
|
|
|
|
$self->opts->protocol, |
879
|
|
|
|
|
|
|
$self->opts->community, |
880
|
|
|
|
|
|
|
$self->opts->hostname; |
881
|
0
|
|
|
|
|
0
|
open(WALK, "$cmd |"); |
882
|
0
|
|
|
|
|
0
|
while () { |
883
|
0
|
0
|
|
|
|
0
|
if (/^([\.\d]+) = .*?: (\-*\d+)/) { |
|
|
0
|
|
|
|
|
|
884
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
885
|
|
|
|
|
|
|
} elsif (/^([\.\d]+) = .*?: "(.*?)"/) { |
886
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
887
|
0
|
|
|
|
|
0
|
$response->{$1} =~ s/\s+$//; |
888
|
|
|
|
|
|
|
} |
889
|
|
|
|
|
|
|
} |
890
|
0
|
|
|
|
|
0
|
close WALK; |
891
|
|
|
|
|
|
|
} else { |
892
|
0
|
0
|
0
|
|
|
0
|
if (defined $self->opts->offline && $self->opts->mode ne 'walk') { |
893
|
0
|
0
|
|
|
|
0
|
if ((time - (stat($self->opts->snmpwalk))[9]) > $self->opts->offline) { |
894
|
0
|
|
|
|
|
0
|
$self->add_message(UNKNOWN, |
895
|
|
|
|
|
|
|
sprintf 'snmpwalk file %s is too old', $self->opts->snmpwalk); |
896
|
|
|
|
|
|
|
} |
897
|
|
|
|
|
|
|
} |
898
|
0
|
0
|
|
|
|
0
|
$self->opts->override_opt('hostname', 'walkhost') if $self->opts->mode ne 'walk'; |
899
|
0
|
|
|
|
|
0
|
open(MESS, $self->opts->snmpwalk); |
900
|
0
|
|
|
|
|
0
|
while() { |
901
|
|
|
|
|
|
|
# SNMPv2-SMI::enterprises.232.6.2.6.7.1.3.1.4 = INTEGER: 6 |
902
|
0
|
0
|
|
|
|
0
|
if (/^([\d\.]+) = .*?INTEGER: .*\((\-*\d+)\)/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
903
|
|
|
|
|
|
|
# .1.3.6.1.2.1.2.2.1.8.1 = INTEGER: down(2) |
904
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
905
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = .*?Opaque:.*?Float:.*?([\-\.\d]+)/) { |
906
|
|
|
|
|
|
|
# .1.3.6.1.4.1.2021.10.1.6.1 = Opaque: Float: 0.938965 |
907
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
908
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = STRING:\s*$/) { |
909
|
0
|
|
|
|
|
0
|
$response->{$1} = ""; |
910
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = Network Address: (.*)/) { |
911
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
912
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = Hex-STRING: (.*)/) { |
913
|
0
|
|
|
|
|
0
|
my $k = $1; |
914
|
0
|
|
|
|
|
0
|
my $h = $2; |
915
|
0
|
|
|
|
|
0
|
$h =~ s/\s+//g; |
916
|
0
|
|
|
|
|
0
|
$response->{$k} = pack('H*', $h); |
917
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = \w+: (\-*\d+)\s*$/) { |
918
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
919
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = \w+: "(.*?)"/) { |
920
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
921
|
0
|
|
|
|
|
0
|
$response->{$1} =~ s/\s+$//; |
922
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = \w+: (.*)/) { |
923
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
924
|
0
|
|
|
|
|
0
|
$response->{$1} =~ s/\s+$//; |
925
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = (\-*\d+)/) { |
926
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
927
|
|
|
|
|
|
|
} elsif (/^([\d\.]+) = "(.*?)"/) { |
928
|
0
|
|
|
|
|
0
|
$response->{$1} = $2; |
929
|
0
|
|
|
|
|
0
|
$response->{$1} =~ s/\s+$//; |
930
|
|
|
|
|
|
|
} |
931
|
|
|
|
|
|
|
} |
932
|
0
|
|
|
|
|
0
|
close MESS; |
933
|
|
|
|
|
|
|
} |
934
|
0
|
|
|
|
|
0
|
foreach my $oid (keys %$response) { |
935
|
0
|
0
|
|
|
|
0
|
if ($oid =~ /^\./) { |
936
|
0
|
|
|
|
|
0
|
my $nodot = $oid; |
937
|
0
|
|
|
|
|
0
|
$nodot =~ s/^\.//g; |
938
|
0
|
|
|
|
|
0
|
$response->{$nodot} = $response->{$oid}; |
939
|
0
|
|
|
|
|
0
|
delete $response->{$oid}; |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
} |
942
|
0
|
|
|
|
|
0
|
map { $response->{$_} =~ s/^\s+//; $response->{$_} =~ s/\s+$//; } |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
943
|
|
|
|
|
|
|
keys %$response; |
944
|
0
|
|
|
|
|
0
|
$self->set_rawdata($response); |
945
|
|
|
|
|
|
|
} else { |
946
|
0
|
|
|
|
|
0
|
$self->establish_snmp_session(); |
947
|
|
|
|
|
|
|
} |
948
|
0
|
0
|
|
|
|
0
|
if (! $self->check_messages()) { |
949
|
0
|
|
|
|
|
0
|
my $tic = time; |
950
|
|
|
|
|
|
|
# Datatype TimeTicks = 1/100s |
951
|
0
|
|
|
|
|
0
|
my $sysUptime = $self->get_snmp_object('MIB-2-MIB', 'sysUpTime', 0); |
952
|
|
|
|
|
|
|
# Datatype Integer32 = 1s |
953
|
0
|
|
|
|
|
0
|
my $snmpEngineTime = $self->get_snmp_object('SNMP-FRAMEWORK-MIB', 'snmpEngineTime'); |
954
|
|
|
|
|
|
|
# Datatype TimeTicks = 1/100s |
955
|
0
|
|
|
|
|
0
|
my $hrSystemUptime = $self->get_snmp_object('HOST-RESOURCES-MIB', 'hrSystemUptime'); |
956
|
0
|
|
|
|
|
0
|
my $sysDescr = $self->get_snmp_object('MIB-2-MIB', 'sysDescr', 0); |
957
|
0
|
|
|
|
|
0
|
my $tac = time; |
958
|
0
|
0
|
0
|
|
|
0
|
if (defined $hrSystemUptime && $hrSystemUptime =~ /^\d+$/ && $hrSystemUptime > 0) { |
|
|
|
0
|
|
|
|
|
959
|
0
|
|
|
|
|
0
|
$hrSystemUptime = $self->timeticks($hrSystemUptime); |
960
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'hrSystemUptime says: up since: %s / %s', |
961
|
|
|
|
|
|
|
scalar localtime (time - $hrSystemUptime), |
962
|
|
|
|
|
|
|
$self->human_timeticks($hrSystemUptime)); |
963
|
|
|
|
|
|
|
} else { |
964
|
0
|
|
|
|
|
0
|
$hrSystemUptime = undef; |
965
|
|
|
|
|
|
|
} |
966
|
0
|
0
|
0
|
|
|
0
|
if (defined $snmpEngineTime && $snmpEngineTime =~ /^\d+$/ && $snmpEngineTime > 0) { |
|
|
|
0
|
|
|
|
|
967
|
0
|
|
|
|
|
0
|
$snmpEngineTime = $snmpEngineTime; |
968
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'snmpEngineTime says: up since: %s / %s', |
969
|
|
|
|
|
|
|
scalar localtime (time - $snmpEngineTime), |
970
|
|
|
|
|
|
|
$self->human_timeticks($snmpEngineTime)); |
971
|
|
|
|
|
|
|
} else { |
972
|
|
|
|
|
|
|
# drecksschrott asa liefert negative werte |
973
|
|
|
|
|
|
|
# und drecksschrott socomec liefert: wrong type (should be INTEGER): NULL |
974
|
0
|
|
|
|
|
0
|
$snmpEngineTime = undef; |
975
|
|
|
|
|
|
|
} |
976
|
0
|
0
|
|
|
|
0
|
if (defined $sysUptime) { |
977
|
0
|
|
|
|
|
0
|
$sysUptime = $self->timeticks($sysUptime); |
978
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'sysUptime says: up since: %s / %s', |
979
|
|
|
|
|
|
|
scalar localtime (time - $sysUptime), |
980
|
|
|
|
|
|
|
$self->human_timeticks($sysUptime)); |
981
|
|
|
|
|
|
|
} |
982
|
0
|
0
|
0
|
|
|
0
|
if (defined $sysUptime && defined $sysDescr) { |
983
|
0
|
0
|
|
|
|
0
|
if ($hrSystemUptime) { |
|
|
0
|
|
|
|
|
|
984
|
|
|
|
|
|
|
# Bei Linux-basierten Geraeten wird snmpEngineTime viel zu haeufig |
985
|
|
|
|
|
|
|
# durchgestartet, also lieber das hier. |
986
|
0
|
|
|
|
|
0
|
$self->{uptime} = $hrSystemUptime; |
987
|
|
|
|
|
|
|
# Es sei denn, snmpEngineTime ist tatsaechlich groesser, dann gilt |
988
|
|
|
|
|
|
|
# wiederum dieses. Mag sein, dass der zahlenwert hier manchmal huepft |
989
|
|
|
|
|
|
|
# und ein Performancegraph Zacken bekommt, aber das ist mir egal. |
990
|
|
|
|
|
|
|
# es geht nicht um Graphen in Form einer ansteigenden Geraden, sondern |
991
|
|
|
|
|
|
|
# um das Erkennen von spontanen Reboots und das Vermeiden von |
992
|
|
|
|
|
|
|
# falschen Alarmen. |
993
|
0
|
0
|
0
|
|
|
0
|
if ($snmpEngineTime && $snmpEngineTime > $hrSystemUptime) { |
994
|
0
|
|
|
|
|
0
|
$self->{uptime} = $snmpEngineTime; |
995
|
|
|
|
|
|
|
} |
996
|
|
|
|
|
|
|
} elsif ($snmpEngineTime) { |
997
|
0
|
|
|
|
|
0
|
$self->{uptime} = $snmpEngineTime; |
998
|
|
|
|
|
|
|
} else { |
999
|
0
|
|
|
|
|
0
|
$self->{uptime} = $sysUptime; |
1000
|
|
|
|
|
|
|
} |
1001
|
0
|
|
|
|
|
0
|
$self->{productname} = $sysDescr; |
1002
|
0
|
|
|
|
|
0
|
$self->{sysobjectid} = $self->get_snmp_object('MIB-2-MIB', 'sysObjectID', 0); |
1003
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'uptime: %s', $self->{uptime}); |
1004
|
|
|
|
|
|
|
$self->debug(sprintf 'up since: %s', |
1005
|
0
|
|
|
|
|
0
|
scalar localtime (time - $self->{uptime})); |
1006
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::uptime = $self->{uptime}; |
1007
|
0
|
|
|
|
|
0
|
$self->debug('whoami: '.$self->{productname}); |
1008
|
|
|
|
|
|
|
} else { |
1009
|
0
|
0
|
|
|
|
0
|
if ($tac - $tic >= $Monitoring::GLPlugin::SNMP::session->timeout) { |
1010
|
0
|
|
|
|
|
0
|
$self->add_message(UNKNOWN, |
1011
|
|
|
|
|
|
|
'could not contact snmp agent, timeout during snmp-get sysUptime'); |
1012
|
|
|
|
|
|
|
} else { |
1013
|
0
|
|
|
|
|
0
|
$self->add_message(UNKNOWN, |
1014
|
|
|
|
|
|
|
'got neither sysUptime nor sysDescr, is this snmp agent working correctly?'); |
1015
|
|
|
|
|
|
|
} |
1016
|
0
|
0
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session->close if $Monitoring::GLPlugin::SNMP::session; |
1017
|
|
|
|
|
|
|
} |
1018
|
|
|
|
|
|
|
} |
1019
|
|
|
|
|
|
|
} |
1020
|
|
|
|
|
|
|
|
1021
|
|
|
|
|
|
|
sub pretty_sysdesc { |
1022
|
0
|
|
|
0
|
0
|
0
|
my ($self, $sysDesc) = @_; |
1023
|
0
|
|
|
|
|
0
|
foreach my $vendor ( |
1024
|
0
|
|
|
|
|
0
|
keys %{$Monitoring::GLPlugin::SNMP::SysDescPrettify::vendor_rules}) { |
1025
|
0
|
0
|
|
|
|
0
|
if ($sysDesc =~ /$Monitoring::GLPlugin::SNMP::SysDescPrettify::vendor_rules->{$vendor}->{vendor_pattern}/) { |
1026
|
0
|
|
|
|
|
0
|
foreach my $func (@{$Monitoring::GLPlugin::SNMP::SysDescPrettify::vendor_rules->{$vendor}->{prettifier_funcs}}) { |
|
0
|
|
|
|
|
0
|
|
1027
|
0
|
0
|
|
|
|
0
|
if (my $pretty = $func->($sysDesc, $self->session())) { |
1028
|
0
|
|
|
|
|
0
|
return $pretty; |
1029
|
|
|
|
|
|
|
} |
1030
|
|
|
|
|
|
|
} |
1031
|
|
|
|
|
|
|
} |
1032
|
|
|
|
|
|
|
} |
1033
|
0
|
|
|
|
|
0
|
return $sysDesc; |
1034
|
|
|
|
|
|
|
} |
1035
|
|
|
|
|
|
|
|
1036
|
|
|
|
|
|
|
sub establish_snmp_session { |
1037
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1038
|
0
|
|
|
|
|
0
|
$self->set_timeout_alarm(); |
1039
|
0
|
0
|
|
|
|
0
|
if (eval "require Net::SNMP") { |
1040
|
0
|
|
|
|
|
0
|
my %params = (); |
1041
|
0
|
|
|
|
|
0
|
my $net_snmp_version = Net::SNMP->VERSION(); # 5.002000 or 6.000000 |
1042
|
0
|
|
|
|
|
0
|
$params{'-translate'} = [ # because we see "NULL" coming from socomec devices |
1043
|
|
|
|
|
|
|
-all => 0x0, |
1044
|
|
|
|
|
|
|
-nosuchobject => 1, |
1045
|
|
|
|
|
|
|
-nosuchinstance => 1, |
1046
|
|
|
|
|
|
|
-endofmibview => 1, |
1047
|
|
|
|
|
|
|
-unsigned => 1, |
1048
|
|
|
|
|
|
|
]; |
1049
|
0
|
|
|
|
|
0
|
$params{'-hostname'} = $self->opts->hostname; |
1050
|
0
|
|
|
|
|
0
|
$params{'-version'} = $self->opts->protocol; |
1051
|
0
|
0
|
|
|
|
0
|
if ($self->opts->port) { |
1052
|
0
|
|
|
|
|
0
|
$params{'-port'} = $self->opts->port; |
1053
|
|
|
|
|
|
|
} |
1054
|
0
|
0
|
|
|
|
0
|
if ($self->opts->domain) { |
1055
|
0
|
|
|
|
|
0
|
$params{'-domain'} = $self->opts->domain; |
1056
|
|
|
|
|
|
|
} |
1057
|
0
|
|
|
|
|
0
|
$self->v2tov3; |
1058
|
0
|
0
|
|
|
|
0
|
if ($self->opts->protocol eq '3') { |
1059
|
0
|
|
|
|
|
0
|
$params{'-version'} = $self->opts->protocol; |
1060
|
0
|
|
|
|
|
0
|
$params{'-username'} = $self->opts->username; |
1061
|
0
|
0
|
|
|
|
0
|
if ($self->opts->authpassword) { |
1062
|
0
|
|
|
|
|
0
|
$params{'-authpassword'} = |
1063
|
|
|
|
|
|
|
$self->decode_password($self->opts->authpassword); |
1064
|
|
|
|
|
|
|
} |
1065
|
0
|
0
|
|
|
|
0
|
if ($self->opts->authprotocol) { |
1066
|
0
|
|
|
|
|
0
|
$params{'-authprotocol'} = $self->opts->authprotocol; |
1067
|
|
|
|
|
|
|
} |
1068
|
0
|
0
|
|
|
|
0
|
if ($self->opts->privpassword) { |
1069
|
0
|
|
|
|
|
0
|
$params{'-privpassword'} = |
1070
|
|
|
|
|
|
|
$self->decode_password($self->opts->privpassword); |
1071
|
|
|
|
|
|
|
} |
1072
|
0
|
0
|
|
|
|
0
|
if ($self->opts->privprotocol) { |
1073
|
0
|
|
|
|
|
0
|
$params{'-privprotocol'} = $self->opts->privprotocol; |
1074
|
|
|
|
|
|
|
} |
1075
|
|
|
|
|
|
|
# context hat in der session nix verloren, sondern wird |
1076
|
|
|
|
|
|
|
# als zusatzinfo bei den requests mitgeschickt |
1077
|
|
|
|
|
|
|
#if ($self->opts->contextengineid) { |
1078
|
|
|
|
|
|
|
# $params{'-contextengineid'} = $self->opts->contextengineid; |
1079
|
|
|
|
|
|
|
#} |
1080
|
|
|
|
|
|
|
#if ($self->opts->contextname) { |
1081
|
|
|
|
|
|
|
# $params{'-contextname'} = $self->opts->contextname; |
1082
|
|
|
|
|
|
|
#} |
1083
|
|
|
|
|
|
|
} else { |
1084
|
0
|
|
|
|
|
0
|
$params{'-community'} = |
1085
|
|
|
|
|
|
|
$self->decode_password($self->opts->community); |
1086
|
|
|
|
|
|
|
} |
1087
|
0
|
|
|
|
|
0
|
my ($session, $error) = Net::SNMP->session(%params); |
1088
|
0
|
0
|
|
|
|
0
|
if (! defined $session) { |
1089
|
0
|
|
|
|
|
0
|
$self->add_message(CRITICAL, |
1090
|
|
|
|
|
|
|
sprintf 'cannot create session object: %s', $error); |
1091
|
0
|
|
|
|
|
0
|
$self->debug(Data::Dumper::Dumper(\%params)); |
1092
|
|
|
|
|
|
|
} else { |
1093
|
0
|
|
|
|
|
0
|
my $max_msg_size = $session->max_msg_size(); |
1094
|
|
|
|
|
|
|
#$session->max_msg_size(4 * $max_msg_size); |
1095
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::max_msg_size = $max_msg_size; |
1096
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session = $session; |
1097
|
|
|
|
|
|
|
} |
1098
|
|
|
|
|
|
|
} else { |
1099
|
0
|
|
|
|
|
0
|
$self->add_message(CRITICAL, |
1100
|
|
|
|
|
|
|
'could not find Net::SNMP module'); |
1101
|
|
|
|
|
|
|
} |
1102
|
|
|
|
|
|
|
} |
1103
|
|
|
|
|
|
|
|
1104
|
|
|
|
|
|
|
sub session_translate { |
1105
|
0
|
|
|
0
|
0
|
0
|
my ($self, $translation) = @_; |
1106
|
0
|
0
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session->translate($translation) if |
1107
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::session; |
1108
|
|
|
|
|
|
|
} |
1109
|
|
|
|
|
|
|
|
1110
|
|
|
|
|
|
|
sub establish_snmp_secondary_session { |
1111
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1112
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->protocol eq '3' && ( |
|
|
|
0
|
|
|
|
|
1113
|
|
|
|
|
|
|
defined $self->opts->authprotocol2 || |
1114
|
|
|
|
|
|
|
defined $self->opts->authpassword2 || |
1115
|
|
|
|
|
|
|
defined $self->opts->privprotocol2 || |
1116
|
|
|
|
|
|
|
defined $self->opts->privpassword2 || |
1117
|
|
|
|
|
|
|
defined $self->opts->username2 || |
1118
|
|
|
|
|
|
|
defined $self->opts->contextengineid2 || |
1119
|
|
|
|
|
|
|
defined $self->opts->contextname2 |
1120
|
|
|
|
|
|
|
)) { |
1121
|
0
|
|
|
|
|
0
|
my $relogin = 0; |
1122
|
|
|
|
|
|
|
# bei --community2="snmpv3,..." wurde alles in xyz2 per override gesteckt |
1123
|
0
|
0
|
|
|
|
0
|
$relogin = 1 if ! $self->strequal($self->opts->authprotocol, |
1124
|
|
|
|
|
|
|
$self->opts->authprotocol2); |
1125
|
0
|
0
|
|
|
|
0
|
$relogin = 1 if ! $self->strequal($self->opts->authpassword, |
1126
|
|
|
|
|
|
|
$self->opts->authpassword2); |
1127
|
0
|
0
|
|
|
|
0
|
$relogin = 1 if ! $self->strequal($self->opts->privprotocol, |
1128
|
|
|
|
|
|
|
$self->opts->privprotocol2); |
1129
|
0
|
0
|
|
|
|
0
|
$relogin = 1 if ! $self->strequal($self->opts->privpassword, |
1130
|
|
|
|
|
|
|
$self->opts->privpassword2); |
1131
|
0
|
0
|
|
|
|
0
|
$relogin = 1 if ! $self->strequal($self->opts->username, |
1132
|
|
|
|
|
|
|
$self->opts->username2); |
1133
|
0
|
0
|
|
|
|
0
|
if ($relogin) { |
1134
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session = undef; |
1135
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('authprotocol', |
1136
|
|
|
|
|
|
|
$self->decode_password($self->opts->authprotocol2)); |
1137
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('authpassword', |
1138
|
|
|
|
|
|
|
$self->decode_password($self->opts->authpassword2)); |
1139
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('privprotocol', |
1140
|
|
|
|
|
|
|
$self->decode_password($self->opts->privprotocol2)); |
1141
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('privpassword', |
1142
|
|
|
|
|
|
|
$self->decode_password($self->opts->privpassword2)); |
1143
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('username', |
1144
|
|
|
|
|
|
|
$self->decode_password($self->opts->username2)); |
1145
|
0
|
|
|
|
|
0
|
$self->establish_snmp_session; |
1146
|
|
|
|
|
|
|
} |
1147
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('contextengineid', |
1148
|
|
|
|
|
|
|
$self->decode_password($self->opts->contextengineid2)); |
1149
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('contextname', |
1150
|
|
|
|
|
|
|
$self->decode_password($self->opts->contextname2)); |
1151
|
0
|
|
|
|
|
0
|
return 1; |
1152
|
|
|
|
|
|
|
} else { |
1153
|
0
|
0
|
0
|
|
|
0
|
if (defined $self->opts->community2 && |
1154
|
|
|
|
|
|
|
$self->decode_password($self->opts->community2) ne |
1155
|
|
|
|
|
|
|
$self->decode_password($self->opts->community)) { |
1156
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session = undef; |
1157
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('community', |
1158
|
|
|
|
|
|
|
$self->decode_password($self->opts->community2)) ; |
1159
|
0
|
|
|
|
|
0
|
$self->establish_snmp_session; |
1160
|
0
|
|
|
|
|
0
|
return 1; |
1161
|
|
|
|
|
|
|
} |
1162
|
|
|
|
|
|
|
} |
1163
|
0
|
|
|
|
|
0
|
return 0; |
1164
|
|
|
|
|
|
|
} |
1165
|
|
|
|
|
|
|
|
1166
|
|
|
|
|
|
|
sub reset_snmp_max_msg_size { |
1167
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1168
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "reset snmp_max_msg_size to %s", |
1169
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::max_msg_size); |
1170
|
0
|
0
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session->max_msg_size($Monitoring::GLPlugin::SNMP::max_msg_size) if $Monitoring::GLPlugin::SNMP::session; |
1171
|
|
|
|
|
|
|
} |
1172
|
|
|
|
|
|
|
|
1173
|
|
|
|
|
|
|
sub mult_snmp_max_msg_size { |
1174
|
0
|
|
|
0
|
0
|
0
|
my ($self, $factor) = @_; |
1175
|
0
|
|
0
|
|
|
0
|
$factor ||= 10; |
1176
|
0
|
0
|
|
|
|
0
|
$self->debug(sprintf "raise snmp_max_msg_size %d * %d", |
1177
|
|
|
|
|
|
|
$factor, $Monitoring::GLPlugin::SNMP::session->max_msg_size()) if $Monitoring::GLPlugin::SNMP::session; |
1178
|
0
|
0
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::session->max_msg_size($factor * $Monitoring::GLPlugin::SNMP::session->max_msg_size()) if $Monitoring::GLPlugin::SNMP::session; |
1179
|
|
|
|
|
|
|
} |
1180
|
|
|
|
|
|
|
|
1181
|
|
|
|
|
|
|
sub no_such_model { |
1182
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1183
|
0
|
|
|
|
|
0
|
printf "Model %s is not implemented\n", $self->{productname}; |
1184
|
0
|
|
|
|
|
0
|
exit 3; |
1185
|
|
|
|
|
|
|
} |
1186
|
|
|
|
|
|
|
|
1187
|
|
|
|
|
|
|
sub no_such_mode { |
1188
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1189
|
0
|
0
|
|
|
|
0
|
if (ref($self) eq "Classes::Generic") { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1190
|
0
|
|
|
|
|
0
|
$self->init(); |
1191
|
|
|
|
|
|
|
} elsif (ref($self) eq "Classes::Device") { |
1192
|
0
|
|
|
|
|
0
|
$self->add_message(UNKNOWN, 'the device did not implement the mibs this plugin is asking for'); |
1193
|
|
|
|
|
|
|
$self->add_message(UNKNOWN, |
1194
|
|
|
|
|
|
|
sprintf('unknown device%s', $self->{productname} eq 'unknown' ? |
1195
|
0
|
0
|
|
|
|
0
|
'' : '('.$self->{productname}.')')); |
1196
|
|
|
|
|
|
|
} elsif (ref($self) eq "Monitoring::GLPlugin::SNMP") { |
1197
|
|
|
|
|
|
|
# uptime, offline |
1198
|
0
|
|
|
|
|
0
|
$self->init(); |
1199
|
|
|
|
|
|
|
} else { |
1200
|
0
|
|
|
|
|
0
|
eval { |
1201
|
0
|
|
|
|
|
0
|
bless $self, "Classes::Generic"; |
1202
|
0
|
|
|
|
|
0
|
$self->init(); |
1203
|
|
|
|
|
|
|
}; |
1204
|
0
|
0
|
|
|
|
0
|
if ($@) { |
1205
|
0
|
|
|
|
|
0
|
bless $self, "Monitoring::GLPlugin::SNMP"; |
1206
|
0
|
|
|
|
|
0
|
$self->init(); |
1207
|
|
|
|
|
|
|
} |
1208
|
|
|
|
|
|
|
} |
1209
|
0
|
0
|
|
|
|
0
|
if (ref($self) eq "Monitoring::GLPlugin::SNMP") { |
1210
|
0
|
|
|
|
|
0
|
printf "Mode %s is not implemented for this type of device\n", |
1211
|
|
|
|
|
|
|
$self->opts->mode; |
1212
|
0
|
|
|
|
|
0
|
exit 3; |
1213
|
|
|
|
|
|
|
} |
1214
|
|
|
|
|
|
|
} |
1215
|
|
|
|
|
|
|
|
1216
|
|
|
|
|
|
|
sub uptime { |
1217
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1218
|
0
|
|
|
|
|
0
|
return $Monitoring::GLPlugin::SNMP::uptime; |
1219
|
|
|
|
|
|
|
} |
1220
|
|
|
|
|
|
|
|
1221
|
|
|
|
|
|
|
sub map_oid_to_class { |
1222
|
0
|
|
|
0
|
0
|
0
|
my ($self, $oid, $class) = @_; |
1223
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::discover_ids->{$oid} = $class; |
1224
|
|
|
|
|
|
|
} |
1225
|
|
|
|
|
|
|
|
1226
|
|
|
|
|
|
|
sub discover_suitable_class { |
1227
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1228
|
0
|
|
|
|
|
0
|
my $sysobj = $self->get_snmp_object('MIB-2-MIB', 'sysObjectID', 0); |
1229
|
0
|
|
|
|
|
0
|
$sysobj =~ s/^\.//g; |
1230
|
0
|
|
|
|
|
0
|
foreach my $oid (keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::discover_ids}) { |
|
0
|
|
|
|
|
0
|
|
1231
|
0
|
0
|
0
|
|
|
0
|
if ($sysobj && $oid eq $sysobj) { |
1232
|
0
|
|
|
|
|
0
|
return $Monitoring::GLPlugin::SNMP::MibsAndOids::discover_ids->{$sysobj}; |
1233
|
|
|
|
|
|
|
} |
1234
|
|
|
|
|
|
|
} |
1235
|
|
|
|
|
|
|
} |
1236
|
|
|
|
|
|
|
|
1237
|
|
|
|
|
|
|
sub require_mib { |
1238
|
1
|
|
|
1
|
0
|
2
|
my ($self, $mib) = @_; |
1239
|
1
|
|
|
|
|
3
|
my $package = uc $mib; |
1240
|
1
|
|
|
|
|
5
|
$package =~ s/-//g; |
1241
|
1
|
50
|
33
|
|
|
8
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} || |
1242
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}) { |
1243
|
0
|
|
|
|
|
0
|
$self->debug("i know package "."Monitoring::GLPlugin::SNMP::MibsAndOids::".$package); |
1244
|
0
|
|
|
|
|
0
|
return; |
1245
|
|
|
|
|
|
|
} else { |
1246
|
1
|
|
|
|
|
2
|
eval { |
1247
|
1
|
|
|
|
|
2
|
my @oldkeys = (); |
1248
|
1
|
|
|
|
|
7
|
$self->set_variable("verbosity", 2); |
1249
|
1
|
50
|
|
|
|
5
|
if ($self->get_variable("verbose")) { |
1250
|
|
|
|
|
|
|
my @oldkeys = exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} ? |
1251
|
0
|
0
|
|
|
|
0
|
keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids} : 0; |
|
0
|
|
|
|
|
0
|
|
1252
|
|
|
|
|
|
|
} |
1253
|
1
|
|
|
|
|
7
|
$self->debug("load mib "."Monitoring::GLPlugin::SNMP::MibsAndOids::".$package); |
1254
|
1
|
|
|
|
|
6
|
load "Monitoring::GLPlugin::SNMP::MibsAndOids::".$package; |
1255
|
1
|
50
|
|
|
|
20
|
if ($self->get_variable("verbose")) { |
1256
|
|
|
|
|
|
|
my @newkeys = exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} ? |
1257
|
0
|
0
|
|
|
|
0
|
keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids} : 0; |
|
0
|
|
|
|
|
0
|
|
1258
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "now i know: %s", join(" ", sort @newkeys)); |
1259
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "now i know %d keys.", scalar(@newkeys)); |
1260
|
0
|
0
|
|
|
|
0
|
if (scalar(@newkeys) <= scalar(@oldkeys)) { |
1261
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "from %d to %d keys. why did we load?", |
1262
|
|
|
|
|
|
|
scalar(@oldkeys), scalar(@newkeys)); |
1263
|
|
|
|
|
|
|
} |
1264
|
|
|
|
|
|
|
} |
1265
|
|
|
|
|
|
|
}; |
1266
|
1
|
50
|
|
|
|
3
|
if ($@) { |
1267
|
0
|
|
|
|
|
0
|
$self->debug("failed to load "."Monitoring::GLPlugin::SNMP::MibsAndOids::".$package); |
1268
|
|
|
|
|
|
|
} else { |
1269
|
1
|
50
|
|
|
|
5
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::requirements->{$mib}) { |
1270
|
0
|
|
|
|
|
0
|
foreach my $submib (@{$Monitoring::GLPlugin::SNMP::MibsAndOids::requirements->{$mib}}) { |
|
0
|
|
|
|
|
0
|
|
1271
|
0
|
|
|
|
|
0
|
$self->require_mib($submib); |
1272
|
|
|
|
|
|
|
} |
1273
|
|
|
|
|
|
|
} |
1274
|
|
|
|
|
|
|
} |
1275
|
|
|
|
|
|
|
} |
1276
|
|
|
|
|
|
|
} |
1277
|
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
|
sub implements_mib { |
1279
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib) = @_; |
1280
|
0
|
|
|
|
|
0
|
$self->require_mib($mib); |
1281
|
0
|
0
|
|
|
|
0
|
if (! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}) { |
1282
|
0
|
|
|
|
|
0
|
return 0; |
1283
|
|
|
|
|
|
|
} |
1284
|
0
|
|
|
|
|
0
|
my $sysobj = $self->get_snmp_object('MIB-2-MIB', 'sysObjectID', 0); |
1285
|
0
|
0
|
|
|
|
0
|
$sysobj =~ s/^\.// if $sysobj; |
1286
|
0
|
0
|
0
|
|
|
0
|
if ($sysobj && $sysobj eq $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}) { |
1287
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "implements %s (sysobj exact)", $mib); |
1288
|
0
|
|
|
|
|
0
|
return 1; |
1289
|
|
|
|
|
|
|
} |
1290
|
0
|
0
|
0
|
|
|
0
|
if ($sysobj && $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib} eq |
1291
|
|
|
|
|
|
|
substr $sysobj, 0, length $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}) { |
1292
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "implements %s (sysobj)", $mib); |
1293
|
0
|
|
|
|
|
0
|
return 1; |
1294
|
|
|
|
|
|
|
} |
1295
|
|
|
|
|
|
|
# some mibs are only composed of tables |
1296
|
0
|
|
|
|
|
0
|
my $traces; |
1297
|
0
|
0
|
|
|
|
0
|
if ($self->opts->snmpwalk) { |
1298
|
0
|
|
|
|
|
0
|
my @matches; |
1299
|
|
|
|
|
|
|
# exact match |
1300
|
0
|
|
|
|
|
0
|
push(@matches, @{[map { |
1301
|
0
|
|
|
|
|
0
|
$_, $self->rawdata->{$_} |
1302
|
|
|
|
|
|
|
} grep { |
1303
|
0
|
|
|
|
|
0
|
$_ eq $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib} |
1304
|
0
|
|
|
|
|
0
|
} keys %{$self->rawdata}]}); |
|
0
|
|
|
|
|
0
|
|
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
# partial match (add trailing dot) |
1307
|
0
|
|
|
|
|
0
|
my $check = $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}; |
1308
|
0
|
|
|
|
|
0
|
$check =~ s/\.?$/./; |
1309
|
0
|
|
|
|
|
0
|
push(@matches, @{[map { |
1310
|
0
|
|
|
|
|
0
|
$_, $self->rawdata->{$_} |
1311
|
|
|
|
|
|
|
} grep { |
1312
|
0
|
|
|
|
|
0
|
substr($_, 0, length($check)) eq $check |
1313
|
0
|
|
|
|
|
0
|
} keys %{$self->rawdata}]}); |
|
0
|
|
|
|
|
0
|
|
1314
|
0
|
|
|
|
|
0
|
$traces = {@matches}; |
1315
|
|
|
|
|
|
|
} else { |
1316
|
|
|
|
|
|
|
my %params = ( |
1317
|
|
|
|
|
|
|
-varbindlist => [ |
1318
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib} |
1319
|
|
|
|
|
|
|
] |
1320
|
|
|
|
|
|
|
); |
1321
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1322
|
0
|
0
|
|
|
|
0
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1323
|
0
|
0
|
|
|
|
0
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1324
|
|
|
|
|
|
|
} |
1325
|
0
|
|
|
|
|
0
|
$traces = $Monitoring::GLPlugin::SNMP::session->get_next_request(%params); |
1326
|
|
|
|
|
|
|
} |
1327
|
0
|
0
|
0
|
|
|
0
|
if ($traces && # must find oids following to the ident-oid |
|
|
|
0
|
|
|
|
|
1328
|
|
|
|
|
|
|
! exists $traces->{$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}} && # must not be the ident-oid |
1329
|
|
|
|
|
|
|
grep { # following oid is inside this tree |
1330
|
0
|
|
|
|
|
0
|
substr($_, 0, length($Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib})) eq $Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{$mib}; |
1331
|
0
|
|
|
|
|
0
|
} keys %{$traces}) { |
1332
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "implements %s (found traces)", $mib); |
1333
|
0
|
|
|
|
|
0
|
return 1; |
1334
|
|
|
|
|
|
|
} |
1335
|
|
|
|
|
|
|
} |
1336
|
|
|
|
|
|
|
|
1337
|
|
|
|
|
|
|
sub timeticks { |
1338
|
0
|
|
|
0
|
0
|
0
|
my ($self, $timestr) = @_; |
1339
|
0
|
0
|
|
|
|
0
|
if ($timestr =~ /\((\d+)\)/) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1340
|
|
|
|
|
|
|
# Timeticks: (20718727) 2 days, 9:33:07.27 |
1341
|
0
|
|
|
|
|
0
|
$timestr = $1 / 100; |
1342
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+)\s*day[s]*.*?(\d+):(\d+):(\d+)\.(\d+)/) { |
1343
|
|
|
|
|
|
|
# Timeticks: 2 days, 9:33:07.27 |
1344
|
0
|
|
|
|
|
0
|
$timestr = $1 * 24 * 3600 + $2 * 3600 + $3 * 60 + $4; |
1345
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+):(\d+):(\d+):(\d+)\.(\d+)/) { |
1346
|
|
|
|
|
|
|
# Timeticks: 0001:03:18:42.77 |
1347
|
0
|
|
|
|
|
0
|
$timestr = $1 * 3600 * 24 + $2 * 3600 + $3 * 60 + $4; |
1348
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+):(\d+):(\d+)\.(\d+)/) { |
1349
|
|
|
|
|
|
|
# Timeticks: 9:33:07.27 |
1350
|
0
|
|
|
|
|
0
|
$timestr = $1 * 3600 + $2 * 60 + $3; |
1351
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+)\s*hour[s]*.*?(\d+):(\d+)\.(\d+)/) { |
1352
|
|
|
|
|
|
|
# Timeticks: 3 hours, 42:17.98 |
1353
|
0
|
|
|
|
|
0
|
$timestr = $1 * 3600 + $2 * 60 + $3; |
1354
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+)\s*minute[s]*.*?(\d+)\.(\d+)/) { |
1355
|
|
|
|
|
|
|
# Timeticks: 36 minutes, 01.96 |
1356
|
0
|
|
|
|
|
0
|
$timestr = $1 * 60 + $2; |
1357
|
|
|
|
|
|
|
} elsif ($timestr =~ /(\d+)\.\d+\s*second[s]/) { |
1358
|
|
|
|
|
|
|
# Timeticks: 01.02 seconds |
1359
|
0
|
|
|
|
|
0
|
$timestr = $1; |
1360
|
|
|
|
|
|
|
} elsif ($timestr =~ /^(\d+)$/) { |
1361
|
0
|
|
|
|
|
0
|
$timestr = $1 / 100; |
1362
|
|
|
|
|
|
|
} |
1363
|
0
|
|
|
|
|
0
|
return $timestr; |
1364
|
|
|
|
|
|
|
} |
1365
|
|
|
|
|
|
|
|
1366
|
|
|
|
|
|
|
sub human_timeticks { |
1367
|
0
|
|
|
0
|
0
|
0
|
my ($self, $timeticks) = @_; |
1368
|
0
|
|
|
|
|
0
|
my $days = int($timeticks / 86400); |
1369
|
0
|
|
|
|
|
0
|
$timeticks -= ($days * 86400); |
1370
|
0
|
|
|
|
|
0
|
my $hours = int($timeticks / 3600); |
1371
|
0
|
|
|
|
|
0
|
$timeticks -= ($hours * 3600); |
1372
|
0
|
|
|
|
|
0
|
my $minutes = int($timeticks / 60); |
1373
|
0
|
|
|
|
|
0
|
my $seconds = $timeticks % 60; |
1374
|
0
|
0
|
|
|
|
0
|
$days = $days < 1 ? '' : $days .'d '; |
1375
|
0
|
|
|
|
|
0
|
return $days . sprintf "%dh %dm %ds", $hours, $minutes, $seconds; |
1376
|
|
|
|
|
|
|
} |
1377
|
|
|
|
|
|
|
|
1378
|
|
|
|
|
|
|
sub internal_name { |
1379
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1380
|
0
|
|
|
|
|
0
|
my $class = ref($self); |
1381
|
0
|
|
|
|
|
0
|
$class =~ s/^.*:://; |
1382
|
0
|
0
|
|
|
|
0
|
if (exists $self->{flat_indices}) { |
1383
|
0
|
|
|
|
|
0
|
return sprintf "%s_%s", uc $class, $self->{flat_indices}; |
1384
|
|
|
|
|
|
|
} else { |
1385
|
0
|
|
|
|
|
0
|
return sprintf "%s", uc $class; |
1386
|
|
|
|
|
|
|
} |
1387
|
|
|
|
|
|
|
} |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
################################################################ |
1390
|
|
|
|
|
|
|
# file-related functions |
1391
|
|
|
|
|
|
|
# |
1392
|
|
|
|
|
|
|
sub create_interface_cache_file { |
1393
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
1394
|
0
|
|
|
|
|
0
|
my $extension = ""; |
1395
|
0
|
0
|
0
|
|
|
0
|
if ($self->opts->snmpwalk && ! $self->opts->hostname) { |
1396
|
0
|
|
|
|
|
0
|
$self->opts->override_opt('hostname', |
1397
|
|
|
|
|
|
|
'snmpwalk.file'.md5_hex($self->opts->snmpwalk)) |
1398
|
|
|
|
|
|
|
} |
1399
|
0
|
0
|
|
|
|
0
|
if ($self->opts->community) { |
1400
|
0
|
|
|
|
|
0
|
$extension .= md5_hex($self->opts->community); |
1401
|
|
|
|
|
|
|
} |
1402
|
0
|
|
|
|
|
0
|
$extension =~ s/\//_/g; |
1403
|
0
|
|
|
|
|
0
|
$extension =~ s/\(/_/g; |
1404
|
0
|
|
|
|
|
0
|
$extension =~ s/\)/_/g; |
1405
|
0
|
|
|
|
|
0
|
$extension =~ s/\*/_/g; |
1406
|
0
|
|
|
|
|
0
|
$extension =~ s/\s/_/g; |
1407
|
0
|
|
|
|
|
0
|
return sprintf "%s/%s_interface_cache_%s", $self->statefilesdir(), |
1408
|
|
|
|
|
|
|
$self->opts->hostname, lc $extension; |
1409
|
|
|
|
|
|
|
} |
1410
|
|
|
|
|
|
|
|
1411
|
|
|
|
|
|
|
sub create_entry_cache_file { |
1412
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $key_attr_id) = @_; |
1413
|
0
|
|
|
|
|
0
|
return lc sprintf "%s_%s_%s_%s_cache", |
1414
|
|
|
|
|
|
|
$self->create_interface_cache_file(), |
1415
|
|
|
|
|
|
|
$mib, $table, $key_attr_id; |
1416
|
|
|
|
|
|
|
} |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
sub update_entry_cache { |
1419
|
0
|
|
|
0
|
0
|
0
|
my ($self, $force, $mib, $table, $key_attrs) = @_; |
1420
|
0
|
|
|
|
|
0
|
my $update_deadline = time - 3600; |
1421
|
0
|
|
|
|
|
0
|
my $must_update = 0; |
1422
|
0
|
0
|
|
|
|
0
|
if (ref($key_attrs) ne "ARRAY") { |
1423
|
0
|
0
|
|
|
|
0
|
if ($key_attrs eq 'flat_indices') { |
1424
|
|
|
|
|
|
|
# wird nur 1x verwendet bisher, bei OLD-CISCO-INTERFACES-MIB etherstats |
1425
|
|
|
|
|
|
|
#my $entry = $table =~ s/Table/Entry/gr; # zu neu fuer centos6 |
1426
|
0
|
|
|
|
|
0
|
my $entry = $table; |
1427
|
0
|
|
|
|
|
0
|
$entry =~ s/Table/Entry/g; |
1428
|
|
|
|
|
|
|
my @sortednames = map { |
1429
|
0
|
|
|
|
|
0
|
$_->[0] |
1430
|
|
|
|
|
|
|
} sort { |
1431
|
0
|
|
|
|
|
0
|
$a->[1] cmp $b->[1] |
1432
|
|
|
|
|
|
|
} map { |
1433
|
|
|
|
|
|
|
[$_, join '', map { |
1434
|
0
|
|
|
|
|
0
|
sprintf("%30d", $_) |
1435
|
0
|
|
|
|
|
0
|
} split( /\./, $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_})]; |
1436
|
|
|
|
|
|
|
} grep { |
1437
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_} =~ /^$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}\./; |
1438
|
0
|
|
|
|
|
0
|
} keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}; |
|
0
|
|
|
|
|
0
|
|
1439
|
0
|
|
|
|
|
0
|
$key_attrs = $sortednames[0]; |
1440
|
|
|
|
|
|
|
} |
1441
|
0
|
|
|
|
|
0
|
$key_attrs = [$key_attrs]; |
1442
|
|
|
|
|
|
|
} |
1443
|
0
|
|
|
|
|
0
|
my $key_attr_id = join('#', @{$key_attrs}); |
|
0
|
|
|
|
|
0
|
|
1444
|
0
|
|
|
|
|
0
|
my $cache = sprintf "%s_%s_%s_cache", $mib, $table, $key_attr_id; |
1445
|
0
|
|
|
|
|
0
|
my $statefile = $self->create_entry_cache_file($mib, $table, $key_attr_id); |
1446
|
0
|
0
|
0
|
|
|
0
|
if ($force == -1 && -f $statefile) { |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
1447
|
0
|
|
|
|
|
0
|
$must_update = 1; |
1448
|
|
|
|
|
|
|
# brauchts unter keinen umstaenden. |
1449
|
|
|
|
|
|
|
# z.b. wenn ein vorhergehender update_interfaces_cache keine aenderungen |
1450
|
|
|
|
|
|
|
# angezeigt hat, dann spart man sich hier den etherlike-update o.ae. |
1451
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'skip update of %s %s %s %s cache', |
1452
|
|
|
|
|
|
|
$self->opts->hostname, $self->opts->mode, $mib, $table); |
1453
|
|
|
|
|
|
|
} elsif ($force != 0 || ! -f $statefile || ((stat $statefile)[9]) < ($update_deadline)) { |
1454
|
0
|
|
|
|
|
0
|
$must_update = 1; |
1455
|
0
|
|
|
|
|
0
|
$self->debug(sprintf 'force update of %s %s %s %s cache', |
1456
|
|
|
|
|
|
|
$self->opts->hostname, $self->opts->mode, $mib, $table); |
1457
|
0
|
|
|
|
|
0
|
$self->{$cache} = {}; |
1458
|
0
|
|
|
|
|
0
|
foreach my $entry ($self->get_snmp_table_objects($mib, $table, undef, $key_attrs)) { |
1459
|
0
|
|
|
|
|
0
|
my $key = join('#', map { $entry->{$_} } @{$key_attrs}); |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1460
|
0
|
|
|
|
|
0
|
my $hash = $key . '-//-' . join('.', @{$entry->{indices}}); |
|
0
|
|
|
|
|
0
|
|
1461
|
0
|
|
|
|
|
0
|
$self->{$cache}->{$hash} = $entry->{indices}; |
1462
|
|
|
|
|
|
|
} |
1463
|
0
|
|
|
|
|
0
|
$self->save_cache($mib, $table, $key_attrs); |
1464
|
|
|
|
|
|
|
} |
1465
|
0
|
|
|
|
|
0
|
$self->load_cache($mib, $table, $key_attrs); |
1466
|
0
|
|
|
|
|
0
|
return $must_update; |
1467
|
|
|
|
|
|
|
} |
1468
|
|
|
|
|
|
|
|
1469
|
|
|
|
|
|
|
sub save_cache { |
1470
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $key_attrs) = @_; |
1471
|
0
|
|
|
|
|
0
|
my $cache = sprintf "%s_%s_%s_cache", $mib, $table, join('#', @{$key_attrs}); |
|
0
|
|
|
|
|
0
|
|
1472
|
0
|
|
|
|
|
0
|
$self->create_statefilesdir(); |
1473
|
0
|
|
|
|
|
0
|
my $statefile = $self->create_entry_cache_file($mib, $table, join('#', @{$key_attrs})); |
|
0
|
|
|
|
|
0
|
|
1474
|
0
|
|
|
|
|
0
|
open(STATE, ">".$statefile.".".$$); |
1475
|
0
|
|
|
|
|
0
|
printf STATE Data::Dumper::Dumper($self->{$cache}); |
1476
|
0
|
|
|
|
|
0
|
close STATE; |
1477
|
0
|
|
|
|
|
0
|
rename $statefile.".".$$, $statefile; |
1478
|
|
|
|
|
|
|
$self->debug(sprintf "saved %s to %s", |
1479
|
0
|
|
|
|
|
0
|
Data::Dumper::Dumper($self->{$cache}), $statefile); |
1480
|
|
|
|
|
|
|
} |
1481
|
|
|
|
|
|
|
|
1482
|
|
|
|
|
|
|
sub load_cache { |
1483
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $key_attrs) = @_; |
1484
|
0
|
|
|
|
|
0
|
my $cache = sprintf "%s_%s_%s_cache", $mib, $table, join('#', @{$key_attrs}); |
|
0
|
|
|
|
|
0
|
|
1485
|
0
|
|
|
|
|
0
|
my $statefile = $self->create_entry_cache_file($mib, $table, join('#', @{$key_attrs})); |
|
0
|
|
|
|
|
0
|
|
1486
|
0
|
|
|
|
|
0
|
$self->{$cache} = {}; |
1487
|
0
|
0
|
|
|
|
0
|
if ( -f $statefile) { |
1488
|
0
|
|
|
|
|
0
|
our $VAR1; |
1489
|
0
|
|
|
|
|
0
|
our $VAR2; |
1490
|
0
|
|
|
|
|
0
|
eval { |
1491
|
0
|
|
|
|
|
0
|
require $statefile; |
1492
|
|
|
|
|
|
|
}; |
1493
|
0
|
0
|
|
|
|
0
|
if($@) { |
1494
|
0
|
|
|
|
|
0
|
printf "rumms\n"; |
1495
|
|
|
|
|
|
|
} |
1496
|
|
|
|
|
|
|
# keinesfalls mehr require verwenden!!!!!! |
1497
|
|
|
|
|
|
|
# beim require enthaelt VAR1 andere werte als beim slurp |
1498
|
|
|
|
|
|
|
# und zwar diejenigen, die beim letzten save_cache geschrieben wurden. |
1499
|
0
|
|
|
|
|
0
|
my $content = do { local (@ARGV, $/) = $statefile; my $x = <>; close ARGV; $x }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1500
|
0
|
|
|
|
|
0
|
$VAR1 = eval "$content"; |
1501
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "load %s", Data::Dumper::Dumper($VAR1)); |
1502
|
0
|
|
|
|
|
0
|
$self->{$cache} = $VAR1; |
1503
|
|
|
|
|
|
|
} |
1504
|
|
|
|
|
|
|
} |
1505
|
|
|
|
|
|
|
|
1506
|
|
|
|
|
|
|
|
1507
|
|
|
|
|
|
|
################################################################ |
1508
|
|
|
|
|
|
|
# top-level convenience functions |
1509
|
|
|
|
|
|
|
# |
1510
|
|
|
|
|
|
|
sub get_snmp_objects { |
1511
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, @mos) = @_; |
1512
|
0
|
|
|
|
|
0
|
foreach (@mos) { |
1513
|
|
|
|
|
|
|
#my $value = $self->get_snmp_object($mib, $_, 0); |
1514
|
|
|
|
|
|
|
#if (defined $value) { |
1515
|
|
|
|
|
|
|
# $self->{$_} = $value; |
1516
|
|
|
|
|
|
|
#} else { |
1517
|
0
|
|
|
|
|
0
|
my $value = $self->get_snmp_object($mib, $_); |
1518
|
0
|
0
|
|
|
|
0
|
if (defined $value) { |
1519
|
0
|
|
|
|
|
0
|
$self->{$_} = $value; |
1520
|
|
|
|
|
|
|
} |
1521
|
|
|
|
|
|
|
#} |
1522
|
|
|
|
|
|
|
} |
1523
|
|
|
|
|
|
|
} |
1524
|
|
|
|
|
|
|
|
1525
|
|
|
|
|
|
|
sub get_snmp_tables { |
1526
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $infos) = @_; |
1527
|
0
|
|
|
|
|
0
|
foreach my $info (@{$infos}) { |
|
0
|
|
|
|
|
0
|
|
1528
|
0
|
|
|
|
|
0
|
my $arrayname = $info->[0]; |
1529
|
0
|
|
|
|
|
0
|
my $table = $info->[1]; |
1530
|
0
|
|
|
|
|
0
|
my $class = $info->[2]; |
1531
|
0
|
|
|
|
|
0
|
my $filter = $info->[3]; |
1532
|
0
|
|
|
|
|
0
|
my $rows = $info->[4]; |
1533
|
0
|
0
|
|
|
|
0
|
$self->{$arrayname} = [] if ! exists $self->{$arrayname}; |
1534
|
0
|
0
|
0
|
|
|
0
|
if (! exists $Monitoring::GLPlugin::SNMP::tablecache->{$mib} || ! exists $Monitoring::GLPlugin::SNMP::tablecache->{$mib}->{$table}) { |
1535
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::tablecache->{$mib}->{$table} = []; |
1536
|
0
|
|
|
|
|
0
|
foreach ($self->get_snmp_table_objects($mib, $table, undef, $rows)) { |
1537
|
0
|
|
|
|
|
0
|
push(@{$Monitoring::GLPlugin::SNMP::tablecache->{$mib}->{$table}}, $_); |
|
0
|
|
|
|
|
0
|
|
1538
|
0
|
|
|
|
|
0
|
my $new_object = $class->new(%{$_}); |
|
0
|
|
|
|
|
0
|
|
1539
|
0
|
0
|
0
|
|
|
0
|
next if (defined $filter && ! &$filter($new_object)); |
1540
|
0
|
|
|
|
|
0
|
push(@{$self->{$arrayname}}, $new_object); |
|
0
|
|
|
|
|
0
|
|
1541
|
|
|
|
|
|
|
} |
1542
|
|
|
|
|
|
|
} else { |
1543
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_tables %s %s cache hit", $mib, $table); |
1544
|
0
|
|
|
|
|
0
|
foreach (@{$Monitoring::GLPlugin::SNMP::tablecache->{$mib}->{$table}}) { |
|
0
|
|
|
|
|
0
|
|
1545
|
0
|
|
|
|
|
0
|
my $new_object = $class->new(%{$_}); |
|
0
|
|
|
|
|
0
|
|
1546
|
0
|
0
|
0
|
|
|
0
|
next if (defined $filter && ! &$filter($new_object)); |
1547
|
0
|
|
|
|
|
0
|
push(@{$self->{$arrayname}}, $new_object); |
|
0
|
|
|
|
|
0
|
|
1548
|
|
|
|
|
|
|
} |
1549
|
|
|
|
|
|
|
} |
1550
|
|
|
|
|
|
|
} |
1551
|
|
|
|
|
|
|
} |
1552
|
|
|
|
|
|
|
|
1553
|
|
|
|
|
|
|
sub merge_tables { |
1554
|
0
|
|
|
0
|
0
|
0
|
my ($self, $into, @from) = @_; |
1555
|
0
|
|
|
|
|
0
|
my $into_indices = {}; |
1556
|
0
|
|
|
|
|
0
|
map { $into_indices->{$_->{flat_indices}} = $_ } @{$self->{$into}}; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1557
|
0
|
|
|
|
|
0
|
foreach (@from) { |
1558
|
0
|
|
|
|
|
0
|
foreach my $element (@{$self->{$_}}) { |
|
0
|
|
|
|
|
0
|
|
1559
|
0
|
0
|
|
|
|
0
|
if (exists $into_indices->{$element->{flat_indices}}) { |
1560
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$element}) { |
|
0
|
|
|
|
|
0
|
|
1561
|
0
|
|
|
|
|
0
|
$into_indices->{$element->{flat_indices}}->{$key} = $element->{$key}; |
1562
|
|
|
|
|
|
|
} |
1563
|
|
|
|
|
|
|
} |
1564
|
|
|
|
|
|
|
} |
1565
|
0
|
|
|
|
|
0
|
delete $self->{$_}; |
1566
|
|
|
|
|
|
|
} |
1567
|
|
|
|
|
|
|
} |
1568
|
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
|
sub merge_tables_with_code { |
1570
|
0
|
|
|
0
|
0
|
0
|
my ($self, $into, @from) = @_; |
1571
|
0
|
|
|
|
|
0
|
my $into_indices = {}; |
1572
|
0
|
|
|
|
|
0
|
my @to_del = (); |
1573
|
0
|
|
|
|
|
0
|
foreach my $into_elem (@{$self->{$into}}) { |
|
0
|
|
|
|
|
0
|
|
1574
|
0
|
|
|
|
|
0
|
for (my $i = 0; $i < @from; $i += 2) { |
1575
|
0
|
|
|
|
|
0
|
my ($from_elems, $func) = @from[$i, $i+1]; |
1576
|
0
|
|
|
|
|
0
|
foreach my $from_elem (@{$self->{$from_elems}}) { |
|
0
|
|
|
|
|
0
|
|
1577
|
0
|
0
|
|
|
|
0
|
if (&$func($into_elem, $from_elem)) { |
1578
|
0
|
|
|
|
|
0
|
foreach my $key (grep !/^(info|trace|warning|critical|blacklisted|extendedinfo|flat_indices|indices)/, sort keys %{$from_elem}) { |
|
0
|
|
|
|
|
0
|
|
1579
|
0
|
|
|
|
|
0
|
$into_elem->{$key} = $from_elem->{$key}; |
1580
|
|
|
|
|
|
|
} |
1581
|
|
|
|
|
|
|
} |
1582
|
|
|
|
|
|
|
} |
1583
|
|
|
|
|
|
|
} |
1584
|
|
|
|
|
|
|
} |
1585
|
0
|
|
|
|
|
0
|
for (my $i = 0; $i < @from; $i += 2) { |
1586
|
0
|
|
|
|
|
0
|
my ($from_elems, $func) = @from[$i, $i+1]; |
1587
|
0
|
|
|
|
|
0
|
delete $self->{$from_elems}; |
1588
|
|
|
|
|
|
|
} |
1589
|
|
|
|
|
|
|
} |
1590
|
|
|
|
|
|
|
|
1591
|
|
|
|
|
|
|
sub mibs_and_oids_definition { |
1592
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $definition, @values) = @_; |
1593
|
0
|
0
|
0
|
|
|
0
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
1594
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) { |
1595
|
0
|
0
|
|
|
|
0
|
if (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq "CODE") { |
|
|
0
|
|
|
|
|
|
1596
|
0
|
|
|
|
|
0
|
return $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->(@values); |
1597
|
|
|
|
|
|
|
} elsif (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq "HASH") { |
1598
|
0
|
|
|
|
|
0
|
return $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$values[0]}; |
1599
|
|
|
|
|
|
|
} |
1600
|
|
|
|
|
|
|
} else { |
1601
|
0
|
|
|
|
|
0
|
return "unknown_".$definition; |
1602
|
|
|
|
|
|
|
} |
1603
|
|
|
|
|
|
|
} |
1604
|
|
|
|
|
|
|
|
1605
|
|
|
|
|
|
|
sub clear_table_cache { |
1606
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table) = @_; |
1607
|
0
|
0
|
0
|
|
|
0
|
if ($table && exists $Monitoring::GLPlugin::SNMP::tablecache->{$mib}) { |
|
|
0
|
|
|
|
|
|
1608
|
0
|
|
|
|
|
0
|
delete $Monitoring::GLPlugin::SNMP::tablecache->{$mib}->{$table}; |
1609
|
|
|
|
|
|
|
} elsif ($mib) { |
1610
|
0
|
|
|
|
|
0
|
delete $Monitoring::GLPlugin::SNMP::tablecache->{$mib}; |
1611
|
|
|
|
|
|
|
} else { |
1612
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::tablecache = {}; |
1613
|
|
|
|
|
|
|
} |
1614
|
|
|
|
|
|
|
} |
1615
|
|
|
|
|
|
|
|
1616
|
|
|
|
|
|
|
################################################################ |
1617
|
|
|
|
|
|
|
# 2nd level |
1618
|
|
|
|
|
|
|
# |
1619
|
|
|
|
|
|
|
sub get_snmp_object { |
1620
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $mo, $index) = @_; |
1621
|
0
|
|
|
|
|
0
|
$self->require_mib($mib); |
1622
|
0
|
0
|
0
|
|
|
0
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} && |
1623
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$mo}) { |
1624
|
0
|
0
|
|
|
|
0
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$mo}. |
1625
|
|
|
|
|
|
|
(defined $index ? '.'.$index : ''); |
1626
|
0
|
|
|
|
|
0
|
my $response = $self->get_request(-varbindlist => [$oid]); |
1627
|
0
|
0
|
|
|
|
0
|
if (defined $response->{$oid}) { |
1628
|
0
|
0
|
0
|
|
|
0
|
if ($response->{$oid} eq 'noSuchInstance' || $response->{$oid} eq 'noSuchObject') { |
|
|
0
|
|
|
|
|
|
1629
|
0
|
|
|
|
|
0
|
$response->{$oid} = undef; |
1630
|
|
|
|
|
|
|
} elsif (my @symbols = $self->make_symbolic($mib, $response, [[$index]])) { |
1631
|
0
|
|
|
|
|
0
|
$response->{$oid} = $symbols[0]->{$mo}; |
1632
|
|
|
|
|
|
|
} |
1633
|
|
|
|
|
|
|
} |
1634
|
0
|
0
|
|
|
|
0
|
$self->debug(sprintf "GET: %s::%s (%s) : %s", $mib, $mo, $oid, defined $response->{$oid} ? $response->{$oid} : ""); |
1635
|
0
|
0
|
0
|
|
|
0
|
if (! defined $response->{$oid} && ! defined $index) { |
1636
|
0
|
|
|
|
|
0
|
return $self->get_snmp_object($mib, $mo, 0); |
1637
|
|
|
|
|
|
|
} |
1638
|
0
|
|
|
|
|
0
|
return $response->{$oid}; |
1639
|
|
|
|
|
|
|
} |
1640
|
0
|
|
|
|
|
0
|
return undef; |
1641
|
|
|
|
|
|
|
} |
1642
|
|
|
|
|
|
|
|
1643
|
|
|
|
|
|
|
sub get_snmp_table_objects_with_cache { |
1644
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $key_attr, $rows, $force) = @_; |
1645
|
0
|
|
0
|
|
|
0
|
$force ||= 0; |
1646
|
0
|
|
|
|
|
0
|
$self->update_entry_cache($force, $mib, $table, $key_attr); |
1647
|
0
|
|
|
|
|
0
|
my @indices = $self->get_cache_indices($mib, $table, $key_attr); |
1648
|
0
|
|
|
|
|
0
|
my @entries = (); |
1649
|
0
|
|
|
|
|
0
|
foreach ($self->get_snmp_table_objects($mib, $table, \@indices, $rows)) { |
1650
|
0
|
|
|
|
|
0
|
push(@entries, $_); |
1651
|
|
|
|
|
|
|
} |
1652
|
0
|
|
|
|
|
0
|
return @entries; |
1653
|
|
|
|
|
|
|
} |
1654
|
|
|
|
|
|
|
|
1655
|
|
|
|
|
|
|
sub get_table_row_oids { |
1656
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $rows) = @_; |
1657
|
0
|
|
|
|
|
0
|
$self->require_mib($mib); |
1658
|
0
|
|
|
|
|
0
|
my $entry = $table; |
1659
|
0
|
|
|
|
|
0
|
$entry =~ s/Table/Entry/g; |
1660
|
0
|
|
|
|
|
0
|
my $eoid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}.'.'; |
1661
|
0
|
|
|
|
|
0
|
my $eoidlen = length($eoid); |
1662
|
0
|
|
|
|
|
0
|
my @columns = scalar(@{$rows}) ? |
1663
|
|
|
|
|
|
|
grep { |
1664
|
0
|
|
|
|
|
0
|
substr($_, 0, $eoidlen) eq $eoid |
1665
|
|
|
|
|
|
|
} map { |
1666
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_} |
1667
|
0
|
|
|
|
|
0
|
} @{$rows} |
1668
|
|
|
|
|
|
|
: |
1669
|
|
|
|
|
|
|
grep { |
1670
|
0
|
|
|
|
|
0
|
substr($_, 0, $eoidlen) eq $eoid |
1671
|
|
|
|
|
|
|
} map { |
1672
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_} |
1673
|
0
|
0
|
|
|
|
0
|
} keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}; |
|
0
|
|
|
|
|
0
|
|
1674
|
0
|
|
|
|
|
0
|
return @columns; |
1675
|
|
|
|
|
|
|
} |
1676
|
|
|
|
|
|
|
|
1677
|
|
|
|
|
|
|
# get_snmp_table_objects('MIB-Name', 'Table-Name', 'Table-Entry', [indices]) |
1678
|
|
|
|
|
|
|
# returns array of hashrefs |
1679
|
|
|
|
|
|
|
sub get_snmp_table_objects { |
1680
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $table, $indices, $rows) = @_; |
1681
|
0
|
|
0
|
|
|
0
|
$indices ||= []; |
1682
|
0
|
|
0
|
|
|
0
|
$rows ||= []; |
1683
|
0
|
|
|
|
|
0
|
$self->require_mib($mib); |
1684
|
0
|
|
|
|
|
0
|
my @entries = (); |
1685
|
0
|
|
|
|
|
0
|
my $augmenting_table; |
1686
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects %s %s", $mib, $table); |
1687
|
0
|
0
|
|
|
|
0
|
if ($table =~ /^(.*?)\+(.*)/) { |
1688
|
0
|
|
|
|
|
0
|
$table = $1; |
1689
|
0
|
|
|
|
|
0
|
$augmenting_table = $2; |
1690
|
|
|
|
|
|
|
} |
1691
|
0
|
|
|
|
|
0
|
my $entry = $table; |
1692
|
0
|
|
|
|
|
0
|
$entry =~ s/Table/Entry/g; |
1693
|
0
|
0
|
0
|
|
|
0
|
if (! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} || |
1694
|
|
|
|
|
|
|
! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$table}) { |
1695
|
0
|
|
|
|
|
0
|
return @entries; |
1696
|
|
|
|
|
|
|
} |
1697
|
0
|
0
|
|
|
|
0
|
if (! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}) { |
1698
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "table %s::%s has no entry oid", $mib, $table); |
1699
|
0
|
|
|
|
|
0
|
return @entries; |
1700
|
|
|
|
|
|
|
} |
1701
|
0
|
|
|
|
|
0
|
my @columns = $self->get_table_row_oids($mib, $table, $rows); |
1702
|
0
|
|
|
|
|
0
|
my @augmenting_columns = (); |
1703
|
0
|
0
|
|
|
|
0
|
if($augmenting_table) { |
1704
|
0
|
|
|
|
|
0
|
@augmenting_columns = $self->get_table_row_oids($mib, $augmenting_table, $rows); |
1705
|
|
|
|
|
|
|
} |
1706
|
0
|
0
|
0
|
|
|
0
|
if (scalar(@{$indices}) == 1 && $indices->[0] == -1) { |
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
# get mini-version of a table |
1708
|
0
|
|
|
|
|
0
|
my $result = $self->get_entries( |
1709
|
|
|
|
|
|
|
-columns => \@columns, |
1710
|
|
|
|
|
|
|
); |
1711
|
0
|
0
|
|
|
|
0
|
if ($augmenting_table) { |
1712
|
0
|
|
|
|
|
0
|
my $augmenting_result = $self->get_entries( |
1713
|
|
|
|
|
|
|
-columns => \@augmenting_columns, |
1714
|
|
|
|
|
|
|
); |
1715
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $augmenting_result->{$_} } |
1716
|
0
|
|
|
|
|
0
|
keys %{$augmenting_result}; |
|
0
|
|
|
|
|
0
|
|
1717
|
|
|
|
|
|
|
} |
1718
|
|
|
|
|
|
|
my @indices = |
1719
|
|
|
|
|
|
|
$self->get_indices( |
1720
|
|
|
|
|
|
|
-baseoid => $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}, |
1721
|
0
|
|
|
|
|
0
|
-oids => [keys %{$result}]); |
|
0
|
|
|
|
|
0
|
|
1722
|
0
|
|
|
|
|
0
|
@entries = $self->make_symbolic($mib, $result, \@indices); |
1723
|
0
|
|
|
|
|
0
|
@entries = map { $_->{indices} = shift @indices; $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1724
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects mini returns %d entries", |
1725
|
|
|
|
|
|
|
scalar(@entries)); |
1726
|
0
|
|
|
|
|
0
|
} elsif (scalar(@{$indices}) == 1) { |
1727
|
0
|
|
|
|
|
0
|
my $index = join('.', @{$indices->[0]}); |
|
0
|
|
|
|
|
0
|
|
1728
|
0
|
|
|
|
|
0
|
my $result = $self->get_entries( |
1729
|
|
|
|
|
|
|
-startindex => $index, |
1730
|
|
|
|
|
|
|
-endindex => $index, |
1731
|
|
|
|
|
|
|
-columns => \@columns, |
1732
|
|
|
|
|
|
|
); |
1733
|
0
|
0
|
|
|
|
0
|
if ($augmenting_table) { |
1734
|
0
|
|
|
|
|
0
|
my $augmenting_result = $self->get_entries( |
1735
|
|
|
|
|
|
|
-startindex => $index, |
1736
|
|
|
|
|
|
|
-endindex => $index, |
1737
|
|
|
|
|
|
|
-columns => \@augmenting_columns, |
1738
|
|
|
|
|
|
|
); |
1739
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $augmenting_result->{$_} } |
1740
|
0
|
|
|
|
|
0
|
keys %{$augmenting_result}; |
|
0
|
|
|
|
|
0
|
|
1741
|
|
|
|
|
|
|
} |
1742
|
0
|
|
|
|
|
0
|
@entries = $self->make_symbolic($mib, $result, $indices); |
1743
|
0
|
|
|
|
|
0
|
@entries = map { $_->{indices} = shift @{$indices}; $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1744
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects single returns %d entries", |
1745
|
|
|
|
|
|
|
scalar(@entries)); |
1746
|
0
|
|
|
|
|
0
|
} elsif (scalar(@{$indices}) > 1) { |
1747
|
0
|
|
|
|
|
0
|
my $result = {}; |
1748
|
0
|
|
|
|
|
0
|
my @sortedindices = $self->sort_indices($indices); |
1749
|
0
|
|
|
|
|
0
|
my $startindex = $sortedindices[0]; |
1750
|
0
|
|
|
|
|
0
|
my $endindex = $sortedindices[$#sortedindices]; |
1751
|
0
|
|
|
|
|
0
|
if (0) { |
1752
|
|
|
|
|
|
|
# holzweg. dicke ciscos liefern unvollstaendiges resultat, d.h. |
1753
|
|
|
|
|
|
|
# bei 138,19,157 kommt nur 138..144, dann ist schluss. |
1754
|
|
|
|
|
|
|
# maxrepetitions bringt nichts. |
1755
|
|
|
|
|
|
|
$result = $self->get_entries( |
1756
|
|
|
|
|
|
|
-startindex => $startindex, |
1757
|
|
|
|
|
|
|
-endindex => $endindex, |
1758
|
|
|
|
|
|
|
-columns => \@columns, |
1759
|
|
|
|
|
|
|
); |
1760
|
|
|
|
|
|
|
} else { |
1761
|
0
|
|
|
|
|
0
|
foreach my $idx (@sortedindices) { |
1762
|
0
|
|
|
|
|
0
|
my $tmp_result = $self->get_entries( |
1763
|
|
|
|
|
|
|
-startindex => $idx, |
1764
|
|
|
|
|
|
|
-endindex => $idx, |
1765
|
|
|
|
|
|
|
-columns => \@columns, |
1766
|
|
|
|
|
|
|
); |
1767
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $tmp_result->{$_} } |
1768
|
0
|
|
|
|
|
0
|
keys %{$tmp_result}; |
|
0
|
|
|
|
|
0
|
|
1769
|
|
|
|
|
|
|
} |
1770
|
|
|
|
|
|
|
} |
1771
|
0
|
0
|
|
|
|
0
|
if ($augmenting_table) { |
1772
|
0
|
|
|
|
|
0
|
foreach my $idx (@sortedindices) { |
1773
|
0
|
|
|
|
|
0
|
my $tmp_result = $self->get_entries( |
1774
|
|
|
|
|
|
|
-startindex => $idx, |
1775
|
|
|
|
|
|
|
-endindex => $idx, |
1776
|
|
|
|
|
|
|
-columns => \@augmenting_columns, |
1777
|
|
|
|
|
|
|
); |
1778
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $tmp_result->{$_} } |
1779
|
0
|
|
|
|
|
0
|
keys %{$tmp_result}; |
|
0
|
|
|
|
|
0
|
|
1780
|
|
|
|
|
|
|
} |
1781
|
|
|
|
|
|
|
} |
1782
|
|
|
|
|
|
|
# now we have numerical_oid+index => value |
1783
|
|
|
|
|
|
|
# needs to become symboic_oid => value |
1784
|
|
|
|
|
|
|
#my @indices = |
1785
|
|
|
|
|
|
|
# $self->get_indices($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}); |
1786
|
0
|
|
|
|
|
0
|
@entries = $self->make_symbolic($mib, $result, $indices); |
1787
|
0
|
|
|
|
|
0
|
@entries = map { $_->{indices} = shift @{$indices}; $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1788
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects single returns %d entries", |
1789
|
|
|
|
|
|
|
scalar(@entries)); |
1790
|
0
|
|
|
|
|
0
|
} elsif (scalar(@{$rows})) { |
1791
|
0
|
|
|
|
|
0
|
my $result = $self->get_entries( |
1792
|
|
|
|
|
|
|
-columns => \@columns, |
1793
|
|
|
|
|
|
|
); |
1794
|
0
|
0
|
|
|
|
0
|
if ($augmenting_table) { |
1795
|
0
|
|
|
|
|
0
|
my $augmenting_result = $self->get_entries( |
1796
|
|
|
|
|
|
|
-columns => \@augmenting_columns, |
1797
|
|
|
|
|
|
|
); |
1798
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $augmenting_result->{$_} } |
1799
|
0
|
|
|
|
|
0
|
keys %{$augmenting_result}; |
|
0
|
|
|
|
|
0
|
|
1800
|
|
|
|
|
|
|
} |
1801
|
|
|
|
|
|
|
my @indices = |
1802
|
|
|
|
|
|
|
$self->get_indices( |
1803
|
|
|
|
|
|
|
-baseoid => $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}, |
1804
|
0
|
|
|
|
|
0
|
-oids => [keys %{$result}]); |
|
0
|
|
|
|
|
0
|
|
1805
|
0
|
|
|
|
|
0
|
@entries = $self->make_symbolic($mib, $result, \@indices); |
1806
|
0
|
|
|
|
|
0
|
@entries = map { $_->{indices} = shift @indices; $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1807
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects rows returns %d entries", |
1808
|
|
|
|
|
|
|
scalar(@entries)); |
1809
|
|
|
|
|
|
|
} else { |
1810
|
|
|
|
|
|
|
my $result = $self->get_table( |
1811
|
0
|
|
|
|
|
0
|
-baseoid => $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$table}); |
1812
|
0
|
0
|
|
|
|
0
|
if ($augmenting_table) { |
1813
|
0
|
|
|
|
|
0
|
my $augmenting_result = $self->get_entries( |
1814
|
|
|
|
|
|
|
-columns => \@augmenting_columns, |
1815
|
|
|
|
|
|
|
); |
1816
|
0
|
|
|
|
|
0
|
map { $result->{$_} = $augmenting_result->{$_} } |
1817
|
0
|
|
|
|
|
0
|
keys %{$augmenting_result}; |
|
0
|
|
|
|
|
0
|
|
1818
|
|
|
|
|
|
|
} |
1819
|
|
|
|
|
|
|
# now we have numerical_oid+index => value |
1820
|
|
|
|
|
|
|
# needs to become symboic_oid => value |
1821
|
|
|
|
|
|
|
my @indices = |
1822
|
|
|
|
|
|
|
$self->get_indices( |
1823
|
|
|
|
|
|
|
-baseoid => $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$entry}, |
1824
|
0
|
|
|
|
|
0
|
-oids => [keys %{$result}]); |
|
0
|
|
|
|
|
0
|
|
1825
|
0
|
|
|
|
|
0
|
@entries = $self->make_symbolic($mib, $result, \@indices); |
1826
|
0
|
|
|
|
|
0
|
@entries = map { $_->{indices} = shift @indices; $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1827
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_snmp_table_objects default returns %d entries", |
1828
|
|
|
|
|
|
|
scalar(@entries)); |
1829
|
|
|
|
|
|
|
} |
1830
|
0
|
|
|
|
|
0
|
@entries = map { $_->{flat_indices} = join(".", @{$_->{indices}}); $_ } @entries; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
1831
|
0
|
|
|
|
|
0
|
return @entries; |
1832
|
|
|
|
|
|
|
} |
1833
|
|
|
|
|
|
|
|
1834
|
|
|
|
|
|
|
sub bulk_is_baeh { |
1835
|
0
|
|
|
0
|
0
|
0
|
my ($self, $maxrepetitions) = @_; |
1836
|
0
|
|
0
|
|
|
0
|
$maxrepetitions ||= 1; |
1837
|
0
|
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::maxrepetitions = $maxrepetitions; |
1838
|
|
|
|
|
|
|
} |
1839
|
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
|
################################################################ |
1841
|
|
|
|
|
|
|
# 3rd level functions. calling net::snmp-functions |
1842
|
|
|
|
|
|
|
# |
1843
|
|
|
|
|
|
|
sub get_request { |
1844
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1845
|
0
|
|
|
|
|
0
|
my @notcached = (); |
1846
|
0
|
|
|
|
|
0
|
foreach my $oid (@{$params{'-varbindlist'}}) { |
|
0
|
|
|
|
|
0
|
|
1847
|
0
|
|
|
|
|
0
|
$self->add_oidtrace($oid); |
1848
|
0
|
0
|
|
|
|
0
|
if (! exists $Monitoring::GLPlugin::SNMP::rawdata->{$oid}) { |
1849
|
0
|
|
|
|
|
0
|
push(@notcached, $oid); |
1850
|
|
|
|
|
|
|
} |
1851
|
|
|
|
|
|
|
} |
1852
|
0
|
0
|
0
|
|
|
0
|
if (! $self->opts->snmpwalk && (scalar(@notcached) > 0)) { |
1853
|
0
|
|
|
|
|
0
|
my %params = (); |
1854
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 0) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1855
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = \@notcached; |
1856
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::session->version() == 1) { |
1857
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = \@notcached; |
1858
|
|
|
|
|
|
|
#$params{-nonrepeaters} = scalar(@notcached); |
1859
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1860
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = \@notcached; |
1861
|
0
|
0
|
|
|
|
0
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1862
|
0
|
0
|
|
|
|
0
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1863
|
|
|
|
|
|
|
} |
1864
|
0
|
|
|
|
|
0
|
my $result = $Monitoring::GLPlugin::SNMP::session->get_request(%params); |
1865
|
|
|
|
|
|
|
# so, und jetzt gibts stinkstiefel, die kriegen |
1866
|
|
|
|
|
|
|
# params{-varbindlist => [1.3.6.1.4.1.318.1.1.1.1.1.1] |
1867
|
|
|
|
|
|
|
# und result ist |
1868
|
|
|
|
|
|
|
# { 1.3.6.1.4.1.318.1.1.1.1.1.1.0 => "Smart-UPS RT 10000 XL" } |
1869
|
|
|
|
|
|
|
# letzteres kommt in raw_data |
1870
|
|
|
|
|
|
|
# und beim abschliessenden map wirds natuerlich nicht mehr gefunden |
1871
|
|
|
|
|
|
|
# also leeres return. <> |
1872
|
0
|
|
|
|
|
0
|
foreach my $key (%{$result}) { |
|
0
|
|
|
|
|
0
|
|
1873
|
|
|
|
|
|
|
# so, und zwei jahre spaeter kommt man drauf, dass es viele sorten |
1874
|
|
|
|
|
|
|
# von stinkstiefeln gibt. die fragt man nach 1.3.6.1.4.1.13885.120.1.3.1 |
1875
|
|
|
|
|
|
|
# und kriegt als antwort 1.3.6.1.4.1.13885.120.1.3.1.0=[noSuchInstance] |
1876
|
|
|
|
|
|
|
# bis zum 11.10.16 wurde das in den cache geschrieben. eine etage hoeher |
1877
|
|
|
|
|
|
|
# wird aber dann nach 1.3.6.1.4.1.13885.120.1.3.1.0 gefallbacked, was |
1878
|
|
|
|
|
|
|
# dann prompt aus dem cache gefischt wird, anstatt den agenten zu fragen, |
1879
|
|
|
|
|
|
|
# der in diesem fall eine saubere antwort liefern wuerde. |
1880
|
|
|
|
|
|
|
# ergo: keine fehlermeldungen in den chache |
1881
|
0
|
0
|
0
|
|
|
0
|
$self->add_rawdata($key, $result->{$key}) if defined $result->{$key} && $result->{$key} ne 'noSuchInstance'; |
1882
|
|
|
|
|
|
|
} |
1883
|
|
|
|
|
|
|
} |
1884
|
0
|
|
|
|
|
0
|
my $result = {}; |
1885
|
|
|
|
|
|
|
map { |
1886
|
|
|
|
|
|
|
$result->{$_} = exists $Monitoring::GLPlugin::SNMP::rawdata->{$_} ? |
1887
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata->{$_} : |
1888
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::rawdata->{$_.'.0'} ? |
1889
|
0
|
0
|
|
|
|
0
|
$Monitoring::GLPlugin::SNMP::rawdata->{$_.'.0'} : undef; |
|
|
0
|
|
|
|
|
|
1890
|
0
|
|
|
|
|
0
|
} @{$params{'-varbindlist'}}; |
|
0
|
|
|
|
|
0
|
|
1891
|
0
|
|
|
|
|
0
|
return $result; |
1892
|
|
|
|
|
|
|
} |
1893
|
|
|
|
|
|
|
|
1894
|
|
|
|
|
|
|
sub get_entries_get_bulk { |
1895
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1896
|
0
|
|
|
|
|
0
|
my $result = {}; |
1897
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_entries_get_bulk %s", Data::Dumper::Dumper(\%params)); |
1898
|
0
|
|
|
|
|
0
|
my %newparams = (); |
1899
|
0
|
|
|
|
|
0
|
$newparams{'-maxrepetitions'} = 3; |
1900
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1901
|
0
|
0
|
|
|
|
0
|
if defined $params{'-startindex'}; |
1902
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1903
|
0
|
0
|
|
|
|
0
|
if defined $params{'-endindex'}; |
1904
|
0
|
|
|
|
|
0
|
$newparams{'-columns'} = $params{'-columns'}; |
1905
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1906
|
0
|
0
|
|
|
|
0
|
$newparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1907
|
0
|
0
|
|
|
|
0
|
$newparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1908
|
|
|
|
|
|
|
} |
1909
|
0
|
|
|
|
|
0
|
$result = $Monitoring::GLPlugin::SNMP::session->get_entries(%newparams); |
1910
|
0
|
|
|
|
|
0
|
return $result; |
1911
|
|
|
|
|
|
|
} |
1912
|
|
|
|
|
|
|
|
1913
|
|
|
|
|
|
|
sub get_entries_get_next { |
1914
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1915
|
0
|
|
|
|
|
0
|
my $result = {}; |
1916
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_entries_get_next %s", Data::Dumper::Dumper(\%params)); |
1917
|
0
|
|
|
|
|
0
|
my %newparams = (); |
1918
|
0
|
|
|
|
|
0
|
$newparams{'-maxrepetitions'} = 0; |
1919
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1920
|
0
|
0
|
|
|
|
0
|
if defined $params{'-startindex'}; |
1921
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1922
|
0
|
0
|
|
|
|
0
|
if defined $params{'-endindex'}; |
1923
|
0
|
|
|
|
|
0
|
$newparams{'-columns'} = $params{'-columns'}; |
1924
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1925
|
0
|
0
|
|
|
|
0
|
$newparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1926
|
0
|
0
|
|
|
|
0
|
$newparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1927
|
|
|
|
|
|
|
} |
1928
|
0
|
|
|
|
|
0
|
$result = $Monitoring::GLPlugin::SNMP::session->get_entries(%newparams); |
1929
|
0
|
|
|
|
|
0
|
return $result; |
1930
|
|
|
|
|
|
|
} |
1931
|
|
|
|
|
|
|
|
1932
|
|
|
|
|
|
|
sub get_entries_get_next_1index { |
1933
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1934
|
0
|
|
|
|
|
0
|
my $result = {}; |
1935
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_entries_get_next_1index %s", Data::Dumper::Dumper(\%params)); |
1936
|
0
|
|
|
|
|
0
|
my %newparams = (); |
1937
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1938
|
0
|
0
|
|
|
|
0
|
if defined $params{'-startindex'}; |
1939
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1940
|
0
|
0
|
|
|
|
0
|
if defined $params{'-endindex'}; |
1941
|
0
|
|
|
|
|
0
|
$newparams{'-columns'} = $params{'-columns'}; |
1942
|
0
|
|
|
|
|
0
|
my %singleparams = (); |
1943
|
0
|
|
|
|
|
0
|
$singleparams{'-maxrepetitions'} = 0; |
1944
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1945
|
0
|
0
|
|
|
|
0
|
$singleparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1946
|
0
|
0
|
|
|
|
0
|
$singleparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1947
|
|
|
|
|
|
|
} |
1948
|
0
|
|
|
|
|
0
|
foreach my $index ($newparams{'-startindex'}..$newparams{'-endindex'}) { |
1949
|
0
|
|
|
|
|
0
|
foreach my $oid (@{$newparams{'-columns'}}) { |
|
0
|
|
|
|
|
0
|
|
1950
|
0
|
|
|
|
|
0
|
$singleparams{'-columns'} = [$oid]; |
1951
|
0
|
|
|
|
|
0
|
$singleparams{'-startindex'} = $index; |
1952
|
0
|
|
|
|
|
0
|
$singleparams{'-endindex'} =$index; |
1953
|
0
|
|
|
|
|
0
|
my $singleresult = $Monitoring::GLPlugin::SNMP::session->get_entries(%singleparams); |
1954
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$singleresult}) { |
|
0
|
|
|
|
|
0
|
|
1955
|
0
|
|
|
|
|
0
|
$result->{$key} = $singleresult->{$key}; |
1956
|
|
|
|
|
|
|
} |
1957
|
|
|
|
|
|
|
} |
1958
|
|
|
|
|
|
|
} |
1959
|
0
|
|
|
|
|
0
|
return $result; |
1960
|
|
|
|
|
|
|
} |
1961
|
|
|
|
|
|
|
|
1962
|
|
|
|
|
|
|
sub get_entries_get_simple { |
1963
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1964
|
0
|
|
|
|
|
0
|
my $result = {}; |
1965
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_entries_get_simple %s", Data::Dumper::Dumper(\%params)); |
1966
|
0
|
|
|
|
|
0
|
my %newparams = (); |
1967
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1968
|
0
|
0
|
|
|
|
0
|
if defined $params{'-startindex'}; |
1969
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1970
|
0
|
0
|
|
|
|
0
|
if defined $params{'-endindex'}; |
1971
|
0
|
|
|
|
|
0
|
$newparams{'-columns'} = $params{'-columns'}; |
1972
|
0
|
|
|
|
|
0
|
my %singleparams = (); |
1973
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1974
|
0
|
0
|
|
|
|
0
|
$singleparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1975
|
0
|
0
|
|
|
|
0
|
$singleparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1976
|
|
|
|
|
|
|
} |
1977
|
0
|
|
|
|
|
0
|
foreach my $index ($newparams{'-startindex'}..$newparams{'-endindex'}) { |
1978
|
0
|
|
|
|
|
0
|
foreach my $oid (@{$newparams{'-columns'}}) { |
|
0
|
|
|
|
|
0
|
|
1979
|
0
|
|
|
|
|
0
|
$singleparams{'-varbindlist'} = [$oid.".".$index]; |
1980
|
0
|
|
|
|
|
0
|
my $singleresult = $Monitoring::GLPlugin::SNMP::session->get_request(%singleparams); |
1981
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$singleresult}) { |
|
0
|
|
|
|
|
0
|
|
1982
|
0
|
0
|
0
|
|
|
0
|
if ($singleresult->{$key} eq "noSuchObject" || |
|
|
|
0
|
|
|
|
|
1983
|
|
|
|
|
|
|
$singleresult->{$key} eq "noSuchInstance" || |
1984
|
|
|
|
|
|
|
$singleresult->{$key} eq "endOfMibView") { |
1985
|
0
|
|
|
|
|
0
|
$result->{$key} = undef; |
1986
|
|
|
|
|
|
|
} else { |
1987
|
0
|
|
|
|
|
0
|
$result->{$key} = $singleresult->{$key}; |
1988
|
|
|
|
|
|
|
} |
1989
|
|
|
|
|
|
|
} |
1990
|
|
|
|
|
|
|
} |
1991
|
|
|
|
|
|
|
} |
1992
|
0
|
|
|
|
|
0
|
return $result; |
1993
|
|
|
|
|
|
|
} |
1994
|
|
|
|
|
|
|
|
1995
|
|
|
|
|
|
|
sub get_entries { |
1996
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
1997
|
|
|
|
|
|
|
# [-startindex] |
1998
|
|
|
|
|
|
|
# [-endindex] |
1999
|
|
|
|
|
|
|
# -columns |
2000
|
0
|
|
|
|
|
0
|
$params{'-columns'} = [$self->sort_oids($params{'-columns'})]; |
2001
|
0
|
|
|
|
|
0
|
my $result = {}; |
2002
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_entries %s", Data::Dumper::Dumper(\%params)); |
2003
|
0
|
0
|
|
|
|
0
|
if (! $self->opts->snmpwalk) { |
2004
|
0
|
0
|
0
|
|
|
0
|
if (scalar (@{$params{'-columns'}}) < 5 && $params{'-endindex'} && $params{'-startindex'} eq $params{'-endindex'}) { |
|
0
|
|
0
|
|
|
0
|
|
2005
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_simple(%params); |
2006
|
|
|
|
|
|
|
} else { |
2007
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_bulk(%params); |
2008
|
0
|
0
|
|
|
|
0
|
if (! $result) { |
2009
|
0
|
|
|
|
|
0
|
$self->debug("bulk failed, retry simple"); |
2010
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->error() =~ /The message size exceeded the buffer maxMsgSize of (\d+)/i) { |
2011
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "buffer exceeded. raise *5 for next try"); |
2012
|
0
|
|
|
|
|
0
|
$self->mult_snmp_max_msg_size(5); |
2013
|
|
|
|
|
|
|
} else { |
2014
|
0
|
|
|
|
|
0
|
$self->debug($Monitoring::GLPlugin::SNMP::session->error()); |
2015
|
|
|
|
|
|
|
} |
2016
|
0
|
0
|
0
|
|
|
0
|
if (defined $params{'-endindex'} && defined $params{'-startindex'}) { |
2017
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_simple(%params); |
2018
|
|
|
|
|
|
|
} else { |
2019
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_next(%params); |
2020
|
|
|
|
|
|
|
} |
2021
|
|
|
|
|
|
|
} |
2022
|
|
|
|
|
|
|
} |
2023
|
0
|
0
|
|
|
|
0
|
if (! $result) { |
2024
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_next(%params); |
2025
|
0
|
0
|
0
|
|
|
0
|
if (! $result && defined $params{'-startindex'} && $params{'-startindex'} !~ /\./) { |
|
|
|
0
|
|
|
|
|
2026
|
|
|
|
|
|
|
# compound indexes cannot continue, as these two methods iterate numerically |
2027
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->error() =~ /tooBig/i) { |
2028
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "answer too big"); |
2029
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_next_1index(%params); |
2030
|
|
|
|
|
|
|
} |
2031
|
0
|
0
|
|
|
|
0
|
if (! $result) { |
2032
|
0
|
|
|
|
|
0
|
$result = $self->get_entries_get_simple(%params); |
2033
|
|
|
|
|
|
|
} |
2034
|
0
|
0
|
|
|
|
0
|
if (! $result) { |
2035
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "nutzt nix\n"); |
2036
|
|
|
|
|
|
|
} |
2037
|
|
|
|
|
|
|
} |
2038
|
|
|
|
|
|
|
} |
2039
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$result}) { |
|
0
|
|
|
|
|
0
|
|
2040
|
0
|
0
|
|
|
|
0
|
if (substr($key, -1) eq " ") { |
2041
|
0
|
|
|
|
|
0
|
my $value = $result->{$key}; |
2042
|
0
|
|
|
|
|
0
|
delete $result->{$key}; |
2043
|
0
|
|
|
|
|
0
|
$key =~ s/\s+$//g; |
2044
|
0
|
|
|
|
|
0
|
$result->{$key} = $value; |
2045
|
|
|
|
|
|
|
# |
2046
|
|
|
|
|
|
|
# warum? |
2047
|
|
|
|
|
|
|
# |
2048
|
|
|
|
|
|
|
# %newparams ist: |
2049
|
|
|
|
|
|
|
# '-columns' => [ |
2050
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.8', |
2051
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.13', |
2052
|
|
|
|
|
|
|
# ... |
2053
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.16' |
2054
|
|
|
|
|
|
|
# ], |
2055
|
|
|
|
|
|
|
# '-startindex' => '2', |
2056
|
|
|
|
|
|
|
# '-endindex' => '2' |
2057
|
|
|
|
|
|
|
# |
2058
|
|
|
|
|
|
|
# und $result ist: |
2059
|
|
|
|
|
|
|
# ... |
2060
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.2.2' => 'Adaptive Security Appliance \'outside\' interface', |
2061
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.16.2 ' => 4281465004, |
2062
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.13.2' => 0, |
2063
|
|
|
|
|
|
|
# ... |
2064
|
|
|
|
|
|
|
# |
2065
|
|
|
|
|
|
|
# stinkstiefel! |
2066
|
|
|
|
|
|
|
# |
2067
|
|
|
|
|
|
|
} |
2068
|
0
|
|
|
|
|
0
|
$self->add_rawdata($key, $result->{$key}); |
2069
|
|
|
|
|
|
|
} |
2070
|
|
|
|
|
|
|
} else { |
2071
|
|
|
|
|
|
|
my $preresult = $self->get_matching_oids( |
2072
|
0
|
|
|
|
|
0
|
-columns => $params{'-columns'}); |
2073
|
0
|
|
|
|
|
0
|
foreach (keys %{$preresult}) { |
|
0
|
|
|
|
|
0
|
|
2074
|
0
|
|
|
|
|
0
|
$result->{$_} = $preresult->{$_}; |
2075
|
|
|
|
|
|
|
} |
2076
|
0
|
|
|
|
|
0
|
my @sortedkeys = $self->sort_oids([keys %{$result}]); |
|
0
|
|
|
|
|
0
|
|
2077
|
0
|
|
|
|
|
0
|
my @to_del = (); |
2078
|
0
|
0
|
|
|
|
0
|
if ($params{'-startindex'}) { |
2079
|
0
|
|
|
|
|
0
|
foreach my $resoid (@sortedkeys) { |
2080
|
0
|
|
|
|
|
0
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
0
|
|
2081
|
0
|
|
|
|
|
0
|
my $poid = $oid.'.'; |
2082
|
0
|
|
|
|
|
0
|
my $lpoid = length($poid); |
2083
|
0
|
0
|
|
|
|
0
|
if (substr($resoid, 0, $lpoid) eq $poid) { |
2084
|
0
|
|
|
|
|
0
|
my $oidpattern = $poid; |
2085
|
0
|
|
|
|
|
0
|
$oidpattern =~ s/\./\\./g; |
2086
|
0
|
0
|
|
|
|
0
|
if ($resoid =~ /^$oidpattern(.+)$/) { |
2087
|
0
|
0
|
|
|
|
0
|
if ($1 lt $params{'-startindex'}) { |
2088
|
0
|
|
|
|
|
0
|
push(@to_del, $oid.'.'.$1); |
2089
|
|
|
|
|
|
|
} |
2090
|
|
|
|
|
|
|
} |
2091
|
|
|
|
|
|
|
} |
2092
|
|
|
|
|
|
|
} |
2093
|
|
|
|
|
|
|
} |
2094
|
|
|
|
|
|
|
} |
2095
|
0
|
0
|
|
|
|
0
|
if ($params{'-endindex'}) { |
2096
|
0
|
|
|
|
|
0
|
foreach my $resoid (@sortedkeys) { |
2097
|
0
|
|
|
|
|
0
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
0
|
|
2098
|
0
|
|
|
|
|
0
|
my $poid = $oid.'.'; |
2099
|
0
|
|
|
|
|
0
|
my $lpoid = length($poid); |
2100
|
0
|
0
|
|
|
|
0
|
if (substr($resoid, 0, $lpoid) eq $poid) { |
2101
|
0
|
|
|
|
|
0
|
my $oidpattern = $poid; |
2102
|
0
|
|
|
|
|
0
|
$oidpattern =~ s/\./\\./g; |
2103
|
0
|
0
|
|
|
|
0
|
if ($resoid =~ /^$oidpattern(.+)$/) { |
2104
|
0
|
0
|
|
|
|
0
|
if ($1 gt $params{'-endindex'}) { |
2105
|
0
|
|
|
|
|
0
|
push(@to_del, $oid.'.'.$1); |
2106
|
|
|
|
|
|
|
} |
2107
|
|
|
|
|
|
|
} |
2108
|
|
|
|
|
|
|
} |
2109
|
|
|
|
|
|
|
} |
2110
|
|
|
|
|
|
|
} |
2111
|
|
|
|
|
|
|
} |
2112
|
0
|
|
|
|
|
0
|
foreach (@to_del) { |
2113
|
0
|
|
|
|
|
0
|
delete $result->{$_}; |
2114
|
|
|
|
|
|
|
} |
2115
|
|
|
|
|
|
|
} |
2116
|
0
|
|
|
|
|
0
|
return $result; |
2117
|
|
|
|
|
|
|
} |
2118
|
|
|
|
|
|
|
|
2119
|
|
|
|
|
|
|
sub get_entries_by_walk { |
2120
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
2121
|
0
|
0
|
|
|
|
0
|
if (! $self->opts->snmpwalk) { |
2122
|
0
|
|
|
|
|
0
|
$self->add_ok("if you get this crap working correctly, let me know"); |
2123
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
2124
|
0
|
0
|
|
|
|
0
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
2125
|
0
|
0
|
|
|
|
0
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
2126
|
|
|
|
|
|
|
} |
2127
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_tree %s", Data::Dumper::Dumper(\%params)); |
2128
|
0
|
|
|
|
|
0
|
my @baseoids = @{$params{-varbindlist}}; |
|
0
|
|
|
|
|
0
|
|
2129
|
0
|
|
|
|
|
0
|
delete $params{-varbindlist}; |
2130
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 0) { |
2131
|
0
|
|
|
|
|
0
|
foreach my $baseoid (@baseoids) { |
2132
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = [$baseoid]; |
2133
|
0
|
|
|
|
|
0
|
while (my $result = $Monitoring::GLPlugin::SNMP::session->get_next_request(%params)) { |
2134
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = [($Monitoring::GLPlugin::SNMP::session->var_bind_names)[0]]; |
2135
|
|
|
|
|
|
|
} |
2136
|
|
|
|
|
|
|
} |
2137
|
|
|
|
|
|
|
} else { |
2138
|
0
|
|
|
|
|
0
|
$params{-maxrepetitions} = 200; |
2139
|
0
|
|
|
|
|
0
|
foreach my $baseoid (@baseoids) { |
2140
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = [$baseoid]; |
2141
|
0
|
|
|
|
|
0
|
while (my $result = $Monitoring::GLPlugin::SNMP::session->get_bulk_request(%params)) { |
2142
|
0
|
|
|
|
|
0
|
my @names = $Monitoring::GLPlugin::SNMP::session->var_bind_names(); |
2143
|
0
|
|
|
|
|
0
|
my @oids = $self->sort_oids(\@names); |
2144
|
0
|
|
|
|
|
0
|
$params{-varbindlist} = [pop @oids]; |
2145
|
|
|
|
|
|
|
} |
2146
|
|
|
|
|
|
|
} |
2147
|
|
|
|
|
|
|
} |
2148
|
|
|
|
|
|
|
} else { |
2149
|
|
|
|
|
|
|
return $self->get_matching_oids( |
2150
|
0
|
|
|
|
|
0
|
-columns => $params{-varbindlist}); |
2151
|
|
|
|
|
|
|
} |
2152
|
|
|
|
|
|
|
} |
2153
|
|
|
|
|
|
|
|
2154
|
|
|
|
|
|
|
sub get_table { |
2155
|
0
|
|
|
0
|
0
|
0
|
my ($self, %params) = @_; |
2156
|
0
|
|
|
|
|
0
|
$self->add_oidtrace($params{'-baseoid'}); |
2157
|
0
|
0
|
|
|
|
0
|
if (! $self->opts->snmpwalk) { |
2158
|
0
|
|
|
|
|
0
|
my @notcached = (); |
2159
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
2160
|
0
|
0
|
|
|
|
0
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
2161
|
0
|
0
|
|
|
|
0
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
2162
|
|
|
|
|
|
|
} |
2163
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::maxrepetitions) { |
2164
|
|
|
|
|
|
|
# some devices (Bintec) don't like bulk-requests. They call bulk_is_baeh(), so |
2165
|
|
|
|
|
|
|
# we immediately send get-next |
2166
|
0
|
|
|
|
|
0
|
$params{'-maxrepetitions'} = $Monitoring::GLPlugin::SNMP::maxrepetitions; |
2167
|
|
|
|
|
|
|
} |
2168
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params)); |
2169
|
0
|
|
|
|
|
0
|
my $result = $Monitoring::GLPlugin::SNMP::session->get_table(%params); |
2170
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table returned %d oids", scalar(keys %{$result})); |
|
0
|
|
|
|
|
0
|
|
2171
|
0
|
0
|
|
|
|
0
|
if (scalar(keys %{$result}) == 0) { |
|
0
|
|
|
|
|
0
|
|
2172
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table error: %s", |
2173
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::session->error()); |
2174
|
0
|
0
|
|
|
|
0
|
if ($Monitoring::GLPlugin::SNMP::session->error() =~ /The message size exceeded the buffer maxMsgSize of (\d+)/i) { |
2175
|
|
|
|
|
|
|
# bei irrsinnigen maxrepetitions |
2176
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "buffer exceeded"); |
2177
|
|
|
|
|
|
|
#$self->reset_snmp_max_msg_size(); |
2178
|
0
|
0
|
|
|
|
0
|
if ($params{'-maxrepetitions'}) { |
2179
|
0
|
|
|
|
|
0
|
$params{'-maxrepetitions'} = int($params{'-maxrepetitions'} / 2); |
2180
|
|
|
|
|
|
|
$self->debug(sprintf "reduce maxrepetitions to %d", |
2181
|
0
|
|
|
|
|
0
|
$params{'-maxrepetitions'}); |
2182
|
|
|
|
|
|
|
} else { |
2183
|
0
|
|
|
|
|
0
|
$self->mult_snmp_max_msg_size(2); |
2184
|
|
|
|
|
|
|
} |
2185
|
|
|
|
|
|
|
} |
2186
|
0
|
|
|
|
|
0
|
$self->debug("get_table error: try fallback"); |
2187
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params)); |
2188
|
0
|
|
|
|
|
0
|
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params); |
2189
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table returned %d oids", scalar(keys %{$result})); |
|
0
|
|
|
|
|
0
|
|
2190
|
0
|
0
|
|
|
|
0
|
if (scalar(keys %{$result}) == 0) { |
|
0
|
|
|
|
|
0
|
|
2191
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table error: %s", |
2192
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::session->error()); |
2193
|
0
|
0
|
0
|
|
|
0
|
if (exists $params{'-maxrepetitions'} && $params{'-maxrepetitions'} > 1) { |
2194
|
0
|
|
|
|
|
0
|
$params{'-maxrepetitions'} = 1; |
2195
|
0
|
|
|
|
|
0
|
$self->debug("get_table error: try getnext fallback"); |
2196
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params)); |
2197
|
0
|
|
|
|
|
0
|
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params); |
2198
|
0
|
|
|
|
|
0
|
$self->debug(sprintf "get_table returned %d oids", scalar(keys %{$result})); |
|
0
|
|
|
|
|
0
|
|
2199
|
|
|
|
|
|
|
} |
2200
|
0
|
0
|
|
|
|
0
|
if (scalar(keys %{$result}) == 0) { |
|
0
|
|
|
|
|
0
|
|
2201
|
0
|
|
|
|
|
0
|
$self->debug("get_table error: no more fallbacks. Try --protocol 1"); |
2202
|
|
|
|
|
|
|
} |
2203
|
|
|
|
|
|
|
} |
2204
|
|
|
|
|
|
|
} |
2205
|
|
|
|
|
|
|
# Drecksstinkstiefel Net::SNMP |
2206
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.22.4 ' => 'endOfMibView', |
2207
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.22.4' => '0.0', |
2208
|
0
|
|
|
|
|
0
|
foreach my $key (keys %{$result}) { |
|
0
|
|
|
|
|
0
|
|
2209
|
0
|
0
|
|
|
|
0
|
if (substr($key, -1) eq " ") { |
2210
|
0
|
|
|
|
|
0
|
my $value = $result->{$key}; |
2211
|
0
|
|
|
|
|
0
|
delete $result->{$key}; |
2212
|
0
|
|
|
|
|
0
|
(my $shortkey = $key) =~ s/\s+$//g; |
2213
|
0
|
0
|
|
|
|
0
|
if (! exists $result->{shortkey}) { |
2214
|
0
|
|
|
|
|
0
|
$result->{$shortkey} = $value; |
2215
|
|
|
|
|
|
|
} |
2216
|
0
|
0
|
|
|
|
0
|
$self->add_rawdata($key, $result->{$key}) if exists $result->{$key}; |
2217
|
|
|
|
|
|
|
} else { |
2218
|
0
|
|
|
|
|
0
|
$self->add_rawdata($key, $result->{$key}); |
2219
|
|
|
|
|
|
|
} |
2220
|
|
|
|
|
|
|
} |
2221
|
|
|
|
|
|
|
} |
2222
|
|
|
|
|
|
|
return $self->get_matching_oids( |
2223
|
0
|
|
|
|
|
0
|
-columns => [$params{'-baseoid'}]); |
2224
|
|
|
|
|
|
|
} |
2225
|
|
|
|
|
|
|
|
2226
|
|
|
|
|
|
|
################################################################ |
2227
|
|
|
|
|
|
|
# helper functions |
2228
|
|
|
|
|
|
|
# |
2229
|
|
|
|
|
|
|
sub valid_response { |
2230
|
0
|
|
|
0
|
0
|
0
|
my ($self, $mib, $mo, $index) = @_; |
2231
|
0
|
|
|
|
|
0
|
$self->require_mib($mib); |
2232
|
0
|
0
|
0
|
|
|
0
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} && |
2233
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$mo}) { |
2234
|
|
|
|
|
|
|
# make it numerical |
2235
|
0
|
|
|
|
|
0
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$mo}; |
2236
|
0
|
0
|
|
|
|
0
|
if (defined $index) { |
2237
|
0
|
|
|
|
|
0
|
$oid .= '.'.$index; |
2238
|
|
|
|
|
|
|
} |
2239
|
0
|
|
|
|
|
0
|
my $result = $self->get_request( |
2240
|
|
|
|
|
|
|
-varbindlist => [$oid] |
2241
|
|
|
|
|
|
|
); |
2242
|
0
|
0
|
0
|
|
|
0
|
if (!defined($result) || |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2243
|
|
|
|
|
|
|
! defined $result->{$oid} || |
2244
|
|
|
|
|
|
|
$result->{$oid} eq 'noSuchInstance' || |
2245
|
|
|
|
|
|
|
$result->{$oid} eq 'noSuchObject' || |
2246
|
|
|
|
|
|
|
$result->{$oid} eq 'endOfMibView') { |
2247
|
0
|
0
|
|
|
|
0
|
$self->debug(sprintf "GET: %s::%s (%s) : %s", $mib, $mo, $oid, defined $result->{$oid} ? $result->{$oid} : ""); |
2248
|
0
|
|
|
|
|
0
|
return undef; |
2249
|
|
|
|
|
|
|
} else { |
2250
|
0
|
0
|
|
|
|
0
|
$self->debug(sprintf "GET: %s::%s (%s) : %s", $mib, $mo, $oid, defined $result->{$oid} ? $result->{$oid} : ""); |
2251
|
0
|
|
|
|
|
0
|
$self->add_rawdata($oid, $result->{$oid}); |
2252
|
0
|
|
|
|
|
0
|
return $result->{$oid}; |
2253
|
|
|
|
|
|
|
} |
2254
|
|
|
|
|
|
|
} else { |
2255
|
0
|
|
|
|
|
0
|
return undef; |
2256
|
|
|
|
|
|
|
} |
2257
|
|
|
|
|
|
|
} |
2258
|
|
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
sub get_symbol { |
2260
|
1
|
|
|
1
|
0
|
6
|
my ($self, $mib, $oid) = @_; |
2261
|
|
|
|
|
|
|
# "LIEBERT-GP-ENVIRONMENTAL-MIB", "1.3.6.1.4.1.476.1.42.3.4.1.1.4" |
2262
|
|
|
|
|
|
|
# dahinter steckt |
2263
|
|
|
|
|
|
|
# lgpEnvSupplyAirTemperature => '1.3.6.1.4.1.476.1.42.3.4.1.1.3' |
2264
|
|
|
|
|
|
|
# lgpAmbientTemperature => '1.3.6.1.4.1.476.1.42.3.4.1.1.4' |
2265
|
|
|
|
|
|
|
# und als info vom geraet |
2266
|
|
|
|
|
|
|
# LgpEnvTemperatureMeasurementDegC = '1.3.6.1.4.1.476.1.42.3.4.1.1.4' |
2267
|
|
|
|
|
|
|
# der name des temp. sensor wird ueber die oid mitgeteilt |
2268
|
1
|
|
|
|
|
4
|
$self->require_mib($mib); |
2269
|
1
|
|
|
|
|
2
|
foreach my $symoid |
2270
|
1
|
|
|
|
|
26
|
(keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
2271
|
41
|
100
|
|
|
|
73
|
if ($oid eq $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid}) { |
2272
|
1
|
|
|
|
|
11
|
return $symoid; |
2273
|
|
|
|
|
|
|
} |
2274
|
|
|
|
|
|
|
} |
2275
|
0
|
|
|
|
|
|
return undef; |
2276
|
|
|
|
|
|
|
} |
2277
|
|
|
|
|
|
|
|
2278
|
|
|
|
|
|
|
# make_symbolic |
2279
|
|
|
|
|
|
|
# mib is the name of a mib (must be in mibs_and_oids) |
2280
|
|
|
|
|
|
|
# result is a hash-key oid->value |
2281
|
|
|
|
|
|
|
# indices is a array ref of array refs. [[1],[2],...] or [[1,0],[1,1],[2,0].. |
2282
|
|
|
|
|
|
|
sub make_symbolic { |
2283
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $result, $indices) = @_; |
2284
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2285
|
0
|
|
|
|
|
|
my @entries = (); |
2286
|
0
|
0
|
0
|
|
|
|
if (! wantarray && ref(\$result) eq "SCALAR" && ref(\$indices) eq "SCALAR") { |
|
|
|
0
|
|
|
|
|
2287
|
|
|
|
|
|
|
# $self->make_symbolic('CISCO-IETF-NAT-MIB', 'cnatProtocolStatsName', $self->{cnatProtocolStatsName}); |
2288
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$result}; |
2289
|
0
|
|
|
|
|
|
$result = { $oid => $self->{$result} }; |
2290
|
0
|
|
|
|
|
|
$indices = [[]]; |
2291
|
|
|
|
|
|
|
} |
2292
|
0
|
|
|
|
|
|
foreach my $index (@{$indices}) { |
|
0
|
|
|
|
|
|
|
2293
|
|
|
|
|
|
|
# skip [], [[]], [[undef]] |
2294
|
0
|
0
|
|
|
|
|
if (ref($index) eq "ARRAY") { |
2295
|
0
|
0
|
|
|
|
|
if (scalar(@{$index}) == 0) { |
|
0
|
0
|
|
|
|
|
|
2296
|
0
|
|
|
|
|
|
next; |
2297
|
|
|
|
|
|
|
} elsif (!defined $index->[0]) { |
2298
|
0
|
|
|
|
|
|
next; |
2299
|
|
|
|
|
|
|
} |
2300
|
|
|
|
|
|
|
} |
2301
|
0
|
|
|
|
|
|
my $mo = {}; |
2302
|
0
|
|
|
|
|
|
my $idx = join('.', @{$index}); # index can be multi-level |
|
0
|
|
|
|
|
|
|
2303
|
0
|
|
|
|
|
|
foreach my $symoid |
2304
|
0
|
|
|
|
|
|
(keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
2305
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid}; |
2306
|
0
|
0
|
|
|
|
|
if (ref($oid) ne 'HASH') { |
2307
|
0
|
|
|
|
|
|
my $fulloid = $oid . '.'.$idx; |
2308
|
0
|
0
|
|
|
|
|
if (exists $result->{$fulloid}) { |
2309
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) { |
2310
|
0
|
0
|
|
|
|
|
if (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) eq 'HASH') { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2311
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$fulloid}}) { |
2312
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$fulloid}}; |
2313
|
|
|
|
|
|
|
} else { |
2314
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2315
|
|
|
|
|
|
|
} |
2316
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^OID::(.*)/) { |
2317
|
0
|
|
|
|
|
|
my $othermib = $1; |
2318
|
0
|
0
|
|
|
|
|
if (! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$othermib}) { |
2319
|
|
|
|
|
|
|
# may point to another mib's definitions, which hasn't |
2320
|
|
|
|
|
|
|
# been used yet. |
2321
|
0
|
|
|
|
|
|
$self->require_mib($othermib); |
2322
|
|
|
|
|
|
|
} |
2323
|
0
|
|
|
|
|
|
my $value_which_is_a_oid = $result->{$fulloid}; |
2324
|
0
|
|
|
|
|
|
$value_which_is_a_oid =~ s/^\.//g; |
2325
|
0
|
|
|
|
|
|
my @result = grep { $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$othermib}->{$_} eq $value_which_is_a_oid } keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$othermib}}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2326
|
0
|
0
|
|
|
|
|
if (scalar(@result)) { |
2327
|
0
|
|
|
|
|
|
$mo->{$symoid} = $result[0]; |
2328
|
|
|
|
|
|
|
} else { |
2329
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2330
|
|
|
|
|
|
|
} |
2331
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^(.*?)::(.*)/) { |
2332
|
0
|
|
|
|
|
|
my $mib = $1; |
2333
|
0
|
|
|
|
|
|
my $definition = $2; |
2334
|
0
|
0
|
|
|
|
|
if (! exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}) { |
2335
|
|
|
|
|
|
|
# may point to another mib's definitions, which hasn't |
2336
|
|
|
|
|
|
|
# been used yet. |
2337
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2338
|
|
|
|
|
|
|
} |
2339
|
0
|
0
|
0
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2340
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2341
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'CODE') { |
2342
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->($result->{$fulloid}); |
2343
|
|
|
|
|
|
|
} elsif (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
2344
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2345
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'HASH' && |
2346
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$fulloid}}) { |
2347
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$fulloid}}; |
2348
|
|
|
|
|
|
|
} else { |
2349
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2350
|
|
|
|
|
|
|
} |
2351
|
|
|
|
|
|
|
} else { |
2352
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2353
|
|
|
|
|
|
|
# oder $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}? |
2354
|
|
|
|
|
|
|
} |
2355
|
|
|
|
|
|
|
} else { |
2356
|
0
|
|
|
|
|
|
$mo->{$symoid} = $result->{$fulloid}; |
2357
|
|
|
|
|
|
|
} |
2358
|
|
|
|
|
|
|
} |
2359
|
|
|
|
|
|
|
} |
2360
|
|
|
|
|
|
|
} |
2361
|
0
|
|
|
|
|
|
push(@entries, $mo); |
2362
|
|
|
|
|
|
|
} |
2363
|
0
|
0
|
0
|
|
|
|
if (@{$indices} and scalar(@{$indices}) == 1 and !defined $indices->[0]->[0]) { |
|
0
|
|
0
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2364
|
0
|
|
|
|
|
|
my $mo = {}; |
2365
|
0
|
|
|
|
|
|
foreach my $symoid |
2366
|
0
|
|
|
|
|
|
(keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
2367
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid}; |
2368
|
0
|
0
|
|
|
|
|
if (ref($oid) ne 'HASH') { |
2369
|
0
|
0
|
|
|
|
|
if (exists $result->{$oid}) { |
2370
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) { |
2371
|
0
|
0
|
|
|
|
|
if (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) eq 'HASH') { |
|
|
0
|
|
|
|
|
|
2372
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$oid}}) { |
2373
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$oid}}; |
2374
|
0
|
|
|
|
|
|
push(@entries, $mo); |
2375
|
|
|
|
|
|
|
} |
2376
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^(.*?)::(.*)/) { |
2377
|
0
|
|
|
|
|
|
my $mib = $1; |
2378
|
0
|
|
|
|
|
|
my $definition = $2; |
2379
|
0
|
0
|
0
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2380
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2381
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'CODE') { |
2382
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->($result->{$oid}); |
2383
|
|
|
|
|
|
|
} elsif (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
2384
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2385
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'HASH' && |
2386
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$oid}}) { |
2387
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$oid}}; |
2388
|
|
|
|
|
|
|
} else { |
2389
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$oid}; |
2390
|
|
|
|
|
|
|
} |
2391
|
|
|
|
|
|
|
} else { |
2392
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$oid}; |
2393
|
|
|
|
|
|
|
# oder $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}? |
2394
|
|
|
|
|
|
|
} |
2395
|
|
|
|
|
|
|
} |
2396
|
|
|
|
|
|
|
} |
2397
|
|
|
|
|
|
|
} |
2398
|
|
|
|
|
|
|
} |
2399
|
0
|
0
|
|
|
|
|
push(@entries, $mo) if keys %{$mo}; |
|
0
|
|
|
|
|
|
|
2400
|
|
|
|
|
|
|
} |
2401
|
0
|
0
|
|
|
|
|
if (wantarray) { |
2402
|
0
|
|
|
|
|
|
return @entries; |
2403
|
|
|
|
|
|
|
} else { |
2404
|
0
|
|
|
|
|
|
foreach my $entry (@entries) { |
2405
|
0
|
|
|
|
|
|
foreach my $key (keys %{$entry}) { |
|
0
|
|
|
|
|
|
|
2406
|
0
|
|
|
|
|
|
$self->{$key} = $entry->{$key}; |
2407
|
|
|
|
|
|
|
} |
2408
|
|
|
|
|
|
|
} |
2409
|
|
|
|
|
|
|
} |
2410
|
|
|
|
|
|
|
} |
2411
|
|
|
|
|
|
|
|
2412
|
|
|
|
|
|
|
sub sort_oids { |
2413
|
0
|
|
|
0
|
0
|
|
my ($self, $oids) = @_; |
2414
|
0
|
|
0
|
|
|
|
$oids ||= []; |
2415
|
0
|
|
|
|
|
|
my @sortedkeys = map { $_->[0] } |
2416
|
0
|
|
|
|
|
|
sort { $a->[1] cmp $b->[1] } |
2417
|
|
|
|
|
|
|
map { [$_, |
2418
|
0
|
|
|
|
|
|
join '', map { sprintf("%30d",$_) } split( /\./, $_) |
|
0
|
|
|
|
|
|
|
2419
|
0
|
|
|
|
|
|
] } @{$oids}; |
|
0
|
|
|
|
|
|
|
2420
|
0
|
|
|
|
|
|
return @sortedkeys; |
2421
|
|
|
|
|
|
|
} |
2422
|
|
|
|
|
|
|
|
2423
|
|
|
|
|
|
|
sub sort_indices { |
2424
|
0
|
|
|
0
|
0
|
|
my ($self, $indices) = @_; |
2425
|
0
|
|
|
|
|
|
my @sortedindices = map { $_->[0] } |
2426
|
0
|
|
|
|
|
|
sort { $a->[1] cmp $b->[1] } |
2427
|
|
|
|
|
|
|
map { [$_, |
2428
|
0
|
|
|
|
|
|
join '', map { sprintf("%30d",$_) } split( /\./, $_) |
|
0
|
|
|
|
|
|
|
2429
|
0
|
|
|
|
|
|
] } map { join('.', @{$_})} @{$indices}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2430
|
0
|
|
|
|
|
|
return @sortedindices; |
2431
|
|
|
|
|
|
|
} |
2432
|
|
|
|
|
|
|
|
2433
|
|
|
|
|
|
|
|
2434
|
|
|
|
|
|
|
sub get_matching_oids { |
2435
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
2436
|
0
|
|
|
|
|
|
my $result = {}; |
2437
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_matching_oids %s", Data::Dumper::Dumper(\%params)); |
2438
|
0
|
|
|
|
|
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
2439
|
0
|
|
|
|
|
|
my $oidpattern = $oid; |
2440
|
0
|
|
|
|
|
|
$oidpattern =~ s/\./\\./g; |
2441
|
0
|
|
|
|
|
|
map { $result->{$_} = $Monitoring::GLPlugin::SNMP::rawdata->{$_} } |
2442
|
0
|
|
|
|
|
|
grep /^$oidpattern(?=\.|$)/, keys %{$Monitoring::GLPlugin::SNMP::rawdata}; |
|
0
|
|
|
|
|
|
|
2443
|
|
|
|
|
|
|
} |
2444
|
|
|
|
|
|
|
$self->debug(sprintf "get_matching_oids returns %d from %d oids", |
2445
|
0
|
|
|
|
|
|
scalar(keys %{$result}), scalar(keys %{$Monitoring::GLPlugin::SNMP::rawdata})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2446
|
0
|
|
|
|
|
|
return $result; |
2447
|
|
|
|
|
|
|
} |
2448
|
|
|
|
|
|
|
|
2449
|
|
|
|
|
|
|
sub get_indices { |
2450
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
2451
|
|
|
|
|
|
|
# -baseoid : entry |
2452
|
|
|
|
|
|
|
# find all oids beginning with $entry |
2453
|
|
|
|
|
|
|
# then skip one field for the sequence |
2454
|
|
|
|
|
|
|
# then read the next numindices fields |
2455
|
0
|
|
|
|
|
|
my $entrypat = $params{'-baseoid'}; |
2456
|
0
|
|
|
|
|
|
$entrypat =~ s/\./\\\./g; |
2457
|
|
|
|
|
|
|
my @indices = map { |
2458
|
0
|
0
|
|
|
|
|
/^$entrypat\.\d+\.(.*)/ && $1; |
2459
|
|
|
|
|
|
|
} grep { |
2460
|
0
|
|
|
|
|
|
/^$entrypat/ |
2461
|
0
|
|
|
|
|
|
} keys %{$Monitoring::GLPlugin::SNMP::rawdata}; |
|
0
|
|
|
|
|
|
|
2462
|
0
|
|
|
|
|
|
my %seen = (); |
2463
|
0
|
|
|
|
|
|
my @o = map {[split /\./]} sort grep !$seen{$_}++, @indices; |
|
0
|
|
|
|
|
|
|
2464
|
0
|
|
|
|
|
|
return @o; |
2465
|
|
|
|
|
|
|
} |
2466
|
|
|
|
|
|
|
|
2467
|
|
|
|
|
|
|
# this flattens a n-dimensional array and returns the absolute position |
2468
|
|
|
|
|
|
|
# of the element at position idx1,idx2,...,idxn |
2469
|
|
|
|
|
|
|
# element 1,2 in table 0,0 0,1 0,2 1,0 1,1 1,2 2,0 2,1 2,2 is at pos 6 |
2470
|
|
|
|
|
|
|
sub get_number { |
2471
|
0
|
|
|
0
|
0
|
|
my ($self, $indexlists, @element) = @_; |
2472
|
|
|
|
|
|
|
# $indexlists = zeiger auf array aus [1, 2] |
2473
|
0
|
|
|
|
|
|
my $dimensions = scalar(@{$indexlists->[0]}); |
|
0
|
|
|
|
|
|
|
2474
|
0
|
|
|
|
|
|
my @sorted = (); |
2475
|
0
|
|
|
|
|
|
my $number = 0; |
2476
|
0
|
0
|
|
|
|
|
if ($dimensions == 1) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2477
|
|
|
|
|
|
|
@sorted = |
2478
|
0
|
|
|
|
|
|
sort { $a->[0] <=> $b->[0] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2479
|
|
|
|
|
|
|
} elsif ($dimensions == 2) { |
2480
|
|
|
|
|
|
|
@sorted = |
2481
|
0
|
0
|
|
|
|
|
sort { $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2482
|
|
|
|
|
|
|
} elsif ($dimensions == 3) { |
2483
|
|
|
|
|
|
|
@sorted = |
2484
|
0
|
0
|
0
|
|
|
|
sort { $a->[0] <=> $b->[0] || |
2485
|
|
|
|
|
|
|
$a->[1] <=> $b->[1] || |
2486
|
0
|
|
|
|
|
|
$a->[2] <=> $b->[2] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
2487
|
|
|
|
|
|
|
} |
2488
|
0
|
|
|
|
|
|
foreach (@sorted) { |
2489
|
0
|
0
|
|
|
|
|
if ($dimensions == 1) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2490
|
0
|
0
|
|
|
|
|
if ($_->[0] == $element[0]) { |
2491
|
0
|
|
|
|
|
|
last; |
2492
|
|
|
|
|
|
|
} |
2493
|
|
|
|
|
|
|
} elsif ($dimensions == 2) { |
2494
|
0
|
0
|
0
|
|
|
|
if ($_->[0] == $element[0] && $_->[1] == $element[1]) { |
2495
|
0
|
|
|
|
|
|
last; |
2496
|
|
|
|
|
|
|
} |
2497
|
|
|
|
|
|
|
} elsif ($dimensions == 3) { |
2498
|
0
|
0
|
0
|
|
|
|
if ($_->[0] == $element[0] && |
|
|
|
0
|
|
|
|
|
2499
|
|
|
|
|
|
|
$_->[1] == $element[1] && |
2500
|
|
|
|
|
|
|
$_->[2] == $element[2]) { |
2501
|
0
|
|
|
|
|
|
last; |
2502
|
|
|
|
|
|
|
} |
2503
|
|
|
|
|
|
|
} |
2504
|
0
|
|
|
|
|
|
$number++; |
2505
|
|
|
|
|
|
|
} |
2506
|
0
|
|
|
|
|
|
return ++$number; |
2507
|
|
|
|
|
|
|
} |
2508
|
|
|
|
|
|
|
|
2509
|
|
|
|
|
|
|
################################################################ |
2510
|
|
|
|
|
|
|
# caching functions |
2511
|
|
|
|
|
|
|
# |
2512
|
|
|
|
|
|
|
sub set_rawdata { |
2513
|
0
|
|
|
0
|
0
|
|
my ($self, $rawdata) = @_; |
2514
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata = $rawdata; |
2515
|
|
|
|
|
|
|
} |
2516
|
|
|
|
|
|
|
|
2517
|
|
|
|
|
|
|
sub add_rawdata { |
2518
|
0
|
|
|
0
|
0
|
|
my ($self, $oid, $value) = @_; |
2519
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata->{$oid} = $value; |
2520
|
|
|
|
|
|
|
} |
2521
|
|
|
|
|
|
|
|
2522
|
|
|
|
|
|
|
sub rawdata { |
2523
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
2524
|
0
|
|
|
|
|
|
return $Monitoring::GLPlugin::SNMP::rawdata; |
2525
|
|
|
|
|
|
|
} |
2526
|
|
|
|
|
|
|
|
2527
|
|
|
|
|
|
|
sub add_oidtrace { |
2528
|
0
|
|
|
0
|
0
|
|
my ($self, $oid) = @_; |
2529
|
0
|
|
|
|
|
|
$self->debug("cache: ".$oid); |
2530
|
0
|
|
|
|
|
|
push(@{$Monitoring::GLPlugin::SNMP::oidtrace}, $oid); |
|
0
|
|
|
|
|
|
|
2531
|
|
|
|
|
|
|
} |
2532
|
|
|
|
|
|
|
|
2533
|
|
|
|
|
|
|
# $self->update_entry_cache(0, $mib, $table, $key_attr); |
2534
|
|
|
|
|
|
|
# my @indices = $self->get_cache_indices(); |
2535
|
|
|
|
|
|
|
sub get_cache_indices { |
2536
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $table, $key_attr) = @_; |
2537
|
|
|
|
|
|
|
# get_cache_indices is only used by get_snmp_table_objects_with_cache |
2538
|
|
|
|
|
|
|
# so if we dont use --name returning all the indices would result |
2539
|
|
|
|
|
|
|
# in a step-by-step get_table_objecs(index 1...n) which could take long |
2540
|
|
|
|
|
|
|
# time when used with nexus or f5 pools |
2541
|
|
|
|
|
|
|
# returning () forces get_snmp_table_objects to use get_tables |
2542
|
0
|
0
|
|
|
|
|
return () if ! $self->opts->name; |
2543
|
0
|
0
|
|
|
|
|
if (ref($key_attr) ne "ARRAY") { |
2544
|
0
|
|
|
|
|
|
$key_attr = [$key_attr]; |
2545
|
|
|
|
|
|
|
} |
2546
|
|
|
|
|
|
|
my $cache = sprintf "%s_%s_%s_cache", |
2547
|
0
|
|
|
|
|
|
$mib, $table, join('#', @{$key_attr}); |
|
0
|
|
|
|
|
|
|
2548
|
0
|
|
|
|
|
|
my @indices = (); |
2549
|
0
|
|
|
|
|
|
foreach my $key (keys %{$self->{$cache}}) { |
|
0
|
|
|
|
|
|
|
2550
|
0
|
|
|
|
|
|
my ($descr, $index) = split('-//-', $key, 2); |
2551
|
0
|
0
|
|
|
|
|
if ($self->opts->name) { |
2552
|
0
|
0
|
|
|
|
|
if ($self->opts->regexp) { |
2553
|
0
|
|
|
|
|
|
my $pattern = $self->opts->name; |
2554
|
0
|
0
|
|
|
|
|
if ($descr =~ /$pattern/i) { |
2555
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2556
|
|
|
|
|
|
|
} |
2557
|
|
|
|
|
|
|
} else { |
2558
|
0
|
0
|
|
|
|
|
if ($self->opts->name =~ /^\d+$/) { |
2559
|
0
|
0
|
|
|
|
|
if ($index == 1 * $self->opts->name) { |
2560
|
0
|
|
|
|
|
|
push(@indices, [1 * $self->opts->name]); |
2561
|
|
|
|
|
|
|
} |
2562
|
|
|
|
|
|
|
} else { |
2563
|
0
|
0
|
|
|
|
|
if (lc $descr eq lc $self->opts->name) { |
2564
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2565
|
|
|
|
|
|
|
} |
2566
|
|
|
|
|
|
|
} |
2567
|
|
|
|
|
|
|
} |
2568
|
|
|
|
|
|
|
} else { |
2569
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2570
|
|
|
|
|
|
|
} |
2571
|
|
|
|
|
|
|
} |
2572
|
0
|
|
|
|
|
|
return @indices; |
2573
|
0
|
0
|
|
|
|
|
return map { join('.', ref($_) eq "ARRAY" ? @{$_} : $_) } @indices; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2574
|
|
|
|
|
|
|
} |
2575
|
|
|
|
|
|
|
|
2576
|
|
|
|
|
|
|
sub get_entities { |
2577
|
0
|
|
|
0
|
0
|
|
my ($self, $class, $filter) = @_; |
2578
|
0
|
|
|
|
|
|
foreach ($self->get_sub_table('ENTITY-MIB', [ |
2579
|
|
|
|
|
|
|
'entPhysicalDescr', |
2580
|
|
|
|
|
|
|
'entPhysicalName', |
2581
|
|
|
|
|
|
|
'entPhysicalClass', |
2582
|
|
|
|
|
|
|
])) { |
2583
|
0
|
|
|
|
|
|
my $new_object = $class->new(%{$_}); |
|
0
|
|
|
|
|
|
|
2584
|
0
|
0
|
0
|
|
|
|
next if (defined $filter && ! &$filter($new_object)); |
2585
|
0
|
|
|
|
|
|
push @{$self->{entities}}, $new_object; |
|
0
|
|
|
|
|
|
|
2586
|
|
|
|
|
|
|
} |
2587
|
|
|
|
|
|
|
} |
2588
|
|
|
|
|
|
|
|
2589
|
|
|
|
|
|
|
sub get_sub_table { |
2590
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $names) = @_; |
2591
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2592
|
|
|
|
|
|
|
my @oids = map { |
2593
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_} |
|
0
|
|
|
|
|
|
|
2594
|
|
|
|
|
|
|
} @$names; |
2595
|
0
|
|
|
|
|
|
my $result = $self->get_entries( |
2596
|
|
|
|
|
|
|
-columns => \@oids |
2597
|
|
|
|
|
|
|
); |
2598
|
0
|
|
|
|
|
|
my $indices = (); |
2599
|
0
|
0
|
|
|
|
|
map { if ($_ =~ /\.(\d+)$/) { $indices->{$1} = [ $1 ]; } } keys %$result; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2600
|
0
|
|
|
|
|
|
my @indices = values %$indices; |
2601
|
0
|
|
|
|
|
|
my @entries = $self->make_symbolic($mib, $result, \@indices); |
2602
|
0
|
|
|
|
|
|
@entries = map { $_->{indices} = shift @indices; $_ } @entries; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2603
|
0
|
|
|
|
|
|
@entries = map { $_->{flat_indices} = join(".", @{$_->{indices}}); $_ } @entries; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2604
|
0
|
|
|
|
|
|
return @entries; |
2605
|
|
|
|
|
|
|
} |
2606
|
|
|
|
|
|
|
|
2607
|
|
|
|
|
|
|
sub join_table { |
2608
|
0
|
|
|
0
|
0
|
|
my ($self, $to, $from) = @_; |
2609
|
0
|
|
|
|
|
|
my $to_i = {}; |
2610
|
0
|
|
|
|
|
|
foreach (@$to) { |
2611
|
0
|
|
|
|
|
|
my $i = $_->{flat_indices}; |
2612
|
0
|
|
|
|
|
|
$to_i->{$i} = $_; |
2613
|
|
|
|
|
|
|
} |
2614
|
0
|
|
|
|
|
|
foreach my $f (@$from) { |
2615
|
0
|
|
|
|
|
|
my $i = $f->{flat_indices}; |
2616
|
0
|
0
|
|
|
|
|
if (exists $to_i->{$i}) { |
2617
|
0
|
|
|
|
|
|
foreach (keys %$f) { |
2618
|
0
|
0
|
|
|
|
|
next if $_ =~ /indices/; |
2619
|
0
|
|
|
|
|
|
$to_i->{$i}->{$_} = $f->{$_}; |
2620
|
|
|
|
|
|
|
} |
2621
|
|
|
|
|
|
|
} |
2622
|
|
|
|
|
|
|
} |
2623
|
|
|
|
|
|
|
} |
2624
|
|
|
|
|
|
|
|
2625
|
|
|
|
|
|
|
|
2626
|
|
|
|
|
|
|
1; |
2627
|
|
|
|
|
|
|
|
2628
|
|
|
|
|
|
|
__END__ |