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