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
|
|
1699
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
48
|
|
6
|
2
|
|
|
2
|
|
16
|
use File::Basename; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
102
|
|
7
|
2
|
|
|
2
|
|
8
|
use Digest::MD5 qw(md5_hex); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
62
|
|
8
|
2
|
|
|
2
|
|
904
|
use Module::Load; |
|
2
|
|
|
|
|
1449
|
|
|
2
|
|
|
|
|
8
|
|
9
|
2
|
|
|
2
|
|
982
|
use AutoLoader; |
|
2
|
|
|
|
|
1940
|
|
|
2
|
|
|
|
|
8
|
|
10
|
|
|
|
|
|
|
our $AUTOLOAD; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
84
|
use constant { OK => 0, WARNING => 1, CRITICAL => 2, UNKNOWN => 3 }; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
27726
|
|
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
|
5
|
my ($class, %params) = @_; |
30
|
|
|
|
|
|
|
require Monitoring::GLPlugin |
31
|
1
|
50
|
|
|
|
65
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::; |
32
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::MibsAndOids |
33
|
1
|
50
|
|
|
|
501
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::MibsAndOids::; |
34
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::CSF |
35
|
1
|
50
|
|
|
|
336
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::CSF::; |
36
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::Item |
37
|
1
|
50
|
|
|
|
346
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::Item::; |
38
|
|
|
|
|
|
|
require Monitoring::GLPlugin::SNMP::TableItem |
39
|
1
|
50
|
|
|
|
347
|
if ! grep /BEGIN/, keys %Monitoring::GLPlugin::SNMP::TableItem::; |
40
|
1
|
|
|
|
|
9
|
my $self = Monitoring::GLPlugin->new(%params); |
41
|
1
|
|
|
|
|
3
|
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
|
|
|
|
|
|
|
################################################################ |
1662
|
|
|
|
|
|
|
# 3rd level functions. calling net::snmp-functions |
1663
|
|
|
|
|
|
|
# |
1664
|
|
|
|
|
|
|
sub get_request { |
1665
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1666
|
0
|
|
|
|
|
|
my @notcached = (); |
1667
|
0
|
|
|
|
|
|
foreach my $oid (@{$params{'-varbindlist'}}) { |
|
0
|
|
|
|
|
|
|
1668
|
0
|
|
|
|
|
|
$self->add_oidtrace($oid); |
1669
|
0
|
0
|
|
|
|
|
if (! exists $Monitoring::GLPlugin::SNMP::rawdata->{$oid}) { |
1670
|
0
|
|
|
|
|
|
push(@notcached, $oid); |
1671
|
|
|
|
|
|
|
} |
1672
|
|
|
|
|
|
|
} |
1673
|
0
|
0
|
0
|
|
|
|
if (! $self->opts->snmpwalk && (scalar(@notcached) > 0)) { |
1674
|
0
|
|
|
|
|
|
my %params = (); |
1675
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 0) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
1676
|
0
|
|
|
|
|
|
$params{-varbindlist} = \@notcached; |
1677
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::session->version() == 1) { |
1678
|
0
|
|
|
|
|
|
$params{-varbindlist} = \@notcached; |
1679
|
|
|
|
|
|
|
#$params{-nonrepeaters} = scalar(@notcached); |
1680
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1681
|
0
|
|
|
|
|
|
$params{-varbindlist} = \@notcached; |
1682
|
0
|
0
|
|
|
|
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1683
|
0
|
0
|
|
|
|
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1684
|
|
|
|
|
|
|
} |
1685
|
0
|
|
|
|
|
|
my $result = $Monitoring::GLPlugin::SNMP::session->get_request(%params); |
1686
|
|
|
|
|
|
|
# so, und jetzt gibts stinkstiefel, die kriegen |
1687
|
|
|
|
|
|
|
# params{-varbindlist => [1.3.6.1.4.1.318.1.1.1.1.1.1] |
1688
|
|
|
|
|
|
|
# und result ist |
1689
|
|
|
|
|
|
|
# { 1.3.6.1.4.1.318.1.1.1.1.1.1.0 => "Smart-UPS RT 10000 XL" } |
1690
|
|
|
|
|
|
|
# letzteres kommt in raw_data |
1691
|
|
|
|
|
|
|
# und beim abschliessenden map wirds natuerlich nicht mehr gefunden |
1692
|
|
|
|
|
|
|
# also leeres return. <> |
1693
|
0
|
|
|
|
|
|
foreach my $key (%{$result}) { |
|
0
|
|
|
|
|
|
|
1694
|
0
|
|
|
|
|
|
$self->add_rawdata($key, $result->{$key}); |
1695
|
|
|
|
|
|
|
} |
1696
|
|
|
|
|
|
|
} |
1697
|
0
|
|
|
|
|
|
my $result = {}; |
1698
|
|
|
|
|
|
|
map { |
1699
|
|
|
|
|
|
|
$result->{$_} = exists $Monitoring::GLPlugin::SNMP::rawdata->{$_} ? |
1700
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata->{$_} : |
1701
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::rawdata->{$_.'.0'} ? |
1702
|
0
|
0
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata->{$_.'.0'} : undef; |
|
|
0
|
|
|
|
|
|
1703
|
0
|
|
|
|
|
|
} @{$params{'-varbindlist'}}; |
|
0
|
|
|
|
|
|
|
1704
|
0
|
|
|
|
|
|
return $result; |
1705
|
|
|
|
|
|
|
} |
1706
|
|
|
|
|
|
|
|
1707
|
|
|
|
|
|
|
sub get_entries_get_bulk { |
1708
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1709
|
0
|
|
|
|
|
|
my $result = {}; |
1710
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_entries_get_bulk %s", Data::Dumper::Dumper(\%params)); |
1711
|
0
|
|
|
|
|
|
my %newparams = (); |
1712
|
0
|
|
|
|
|
|
$newparams{'-maxrepetitions'} = 3; |
1713
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1714
|
0
|
0
|
|
|
|
|
if defined $params{'-startindex'}; |
1715
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1716
|
0
|
0
|
|
|
|
|
if defined $params{'-endindex'}; |
1717
|
0
|
|
|
|
|
|
$newparams{'-columns'} = $params{'-columns'}; |
1718
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1719
|
0
|
0
|
|
|
|
|
$newparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1720
|
0
|
0
|
|
|
|
|
$newparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1721
|
|
|
|
|
|
|
} |
1722
|
0
|
|
|
|
|
|
$result = $Monitoring::GLPlugin::SNMP::session->get_entries(%newparams); |
1723
|
0
|
|
|
|
|
|
return $result; |
1724
|
|
|
|
|
|
|
} |
1725
|
|
|
|
|
|
|
|
1726
|
|
|
|
|
|
|
sub get_entries_get_next { |
1727
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1728
|
0
|
|
|
|
|
|
my $result = {}; |
1729
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_entries_get_next %s", Data::Dumper::Dumper(\%params)); |
1730
|
0
|
|
|
|
|
|
my %newparams = (); |
1731
|
0
|
|
|
|
|
|
$newparams{'-maxrepetitions'} = 0; |
1732
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1733
|
0
|
0
|
|
|
|
|
if defined $params{'-startindex'}; |
1734
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1735
|
0
|
0
|
|
|
|
|
if defined $params{'-endindex'}; |
1736
|
0
|
|
|
|
|
|
$newparams{'-columns'} = $params{'-columns'}; |
1737
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1738
|
0
|
0
|
|
|
|
|
$newparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1739
|
0
|
0
|
|
|
|
|
$newparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1740
|
|
|
|
|
|
|
} |
1741
|
0
|
|
|
|
|
|
$result = $Monitoring::GLPlugin::SNMP::session->get_entries(%newparams); |
1742
|
0
|
|
|
|
|
|
return $result; |
1743
|
|
|
|
|
|
|
} |
1744
|
|
|
|
|
|
|
|
1745
|
|
|
|
|
|
|
sub get_entries_get_next_1index { |
1746
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1747
|
0
|
|
|
|
|
|
my $result = {}; |
1748
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_entries_get_next_1index %s", Data::Dumper::Dumper(\%params)); |
1749
|
0
|
|
|
|
|
|
my %newparams = (); |
1750
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1751
|
0
|
0
|
|
|
|
|
if defined $params{'-startindex'}; |
1752
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1753
|
0
|
0
|
|
|
|
|
if defined $params{'-endindex'}; |
1754
|
0
|
|
|
|
|
|
$newparams{'-columns'} = $params{'-columns'}; |
1755
|
0
|
|
|
|
|
|
my %singleparams = (); |
1756
|
0
|
|
|
|
|
|
$singleparams{'-maxrepetitions'} = 0; |
1757
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1758
|
0
|
0
|
|
|
|
|
$singleparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1759
|
0
|
0
|
|
|
|
|
$singleparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1760
|
|
|
|
|
|
|
} |
1761
|
0
|
|
|
|
|
|
foreach my $index ($newparams{'-startindex'}..$newparams{'-endindex'}) { |
1762
|
0
|
|
|
|
|
|
foreach my $oid (@{$newparams{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
1763
|
0
|
|
|
|
|
|
$singleparams{'-columns'} = [$oid]; |
1764
|
0
|
|
|
|
|
|
$singleparams{'-startindex'} = $index; |
1765
|
0
|
|
|
|
|
|
$singleparams{'-endindex'} =$index; |
1766
|
0
|
|
|
|
|
|
my $singleresult = $Monitoring::GLPlugin::SNMP::session->get_entries(%singleparams); |
1767
|
0
|
|
|
|
|
|
foreach my $key (keys %{$singleresult}) { |
|
0
|
|
|
|
|
|
|
1768
|
0
|
|
|
|
|
|
$result->{$key} = $singleresult->{$key}; |
1769
|
|
|
|
|
|
|
} |
1770
|
|
|
|
|
|
|
} |
1771
|
|
|
|
|
|
|
} |
1772
|
0
|
|
|
|
|
|
return $result; |
1773
|
|
|
|
|
|
|
} |
1774
|
|
|
|
|
|
|
|
1775
|
|
|
|
|
|
|
sub get_entries_get_simple { |
1776
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1777
|
0
|
|
|
|
|
|
my $result = {}; |
1778
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_entries_get_simple %s", Data::Dumper::Dumper(\%params)); |
1779
|
0
|
|
|
|
|
|
my %newparams = (); |
1780
|
|
|
|
|
|
|
$newparams{'-startindex'} = $params{'-startindex'} |
1781
|
0
|
0
|
|
|
|
|
if defined $params{'-startindex'}; |
1782
|
|
|
|
|
|
|
$newparams{'-endindex'} = $params{'-endindex'} |
1783
|
0
|
0
|
|
|
|
|
if defined $params{'-endindex'}; |
1784
|
0
|
|
|
|
|
|
$newparams{'-columns'} = $params{'-columns'}; |
1785
|
0
|
|
|
|
|
|
my %singleparams = (); |
1786
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1787
|
0
|
0
|
|
|
|
|
$singleparams{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1788
|
0
|
0
|
|
|
|
|
$singleparams{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1789
|
|
|
|
|
|
|
} |
1790
|
0
|
|
|
|
|
|
foreach my $index ($newparams{'-startindex'}..$newparams{'-endindex'}) { |
1791
|
0
|
|
|
|
|
|
foreach my $oid (@{$newparams{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
1792
|
0
|
|
|
|
|
|
$singleparams{'-varbindlist'} = [$oid.".".$index]; |
1793
|
0
|
|
|
|
|
|
my $singleresult = $Monitoring::GLPlugin::SNMP::session->get_request(%singleparams); |
1794
|
0
|
|
|
|
|
|
foreach my $key (keys %{$singleresult}) { |
|
0
|
|
|
|
|
|
|
1795
|
0
|
|
|
|
|
|
$result->{$key} = $singleresult->{$key}; |
1796
|
|
|
|
|
|
|
} |
1797
|
|
|
|
|
|
|
} |
1798
|
|
|
|
|
|
|
} |
1799
|
0
|
|
|
|
|
|
return $result; |
1800
|
|
|
|
|
|
|
} |
1801
|
|
|
|
|
|
|
|
1802
|
|
|
|
|
|
|
sub get_entries { |
1803
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1804
|
|
|
|
|
|
|
# [-startindex] |
1805
|
|
|
|
|
|
|
# [-endindex] |
1806
|
|
|
|
|
|
|
# -columns |
1807
|
0
|
|
|
|
|
|
my $result = {}; |
1808
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_entries %s", Data::Dumper::Dumper(\%params)); |
1809
|
0
|
0
|
|
|
|
|
if (! $self->opts->snmpwalk) { |
1810
|
0
|
|
|
|
|
|
$result = $self->get_entries_get_bulk(%params); |
1811
|
0
|
0
|
|
|
|
|
if (! $result) { |
1812
|
0
|
0
|
0
|
|
|
|
if (scalar (@{$params{'-columns'}}) < 50 && $params{'-endindex'} && $params{'-startindex'} eq $params{'-endindex'}) { |
|
0
|
|
0
|
|
|
|
|
1813
|
0
|
|
|
|
|
|
$result = $self->get_entries_get_simple(%params); |
1814
|
|
|
|
|
|
|
} else { |
1815
|
0
|
|
|
|
|
|
$result = $self->get_entries_get_next(%params); |
1816
|
|
|
|
|
|
|
} |
1817
|
0
|
0
|
0
|
|
|
|
if (! $result && defined $params{'-startindex'} && $params{'-startindex'} !~ /\./) { |
|
|
|
0
|
|
|
|
|
1818
|
|
|
|
|
|
|
# compound indexes cannot continue, as these two methods iterate numerically |
1819
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->error() =~ /tooBig/i) { |
1820
|
0
|
|
|
|
|
|
$result = $self->get_entries_get_next_1index(%params); |
1821
|
|
|
|
|
|
|
} |
1822
|
0
|
0
|
|
|
|
|
if (! $result) { |
1823
|
0
|
|
|
|
|
|
$result = $self->get_entries_get_simple(%params); |
1824
|
|
|
|
|
|
|
} |
1825
|
0
|
0
|
|
|
|
|
if (! $result) { |
1826
|
0
|
|
|
|
|
|
$self->debug(sprintf "nutzt nix\n"); |
1827
|
|
|
|
|
|
|
} |
1828
|
|
|
|
|
|
|
} |
1829
|
|
|
|
|
|
|
} |
1830
|
0
|
|
|
|
|
|
foreach my $key (keys %{$result}) { |
|
0
|
|
|
|
|
|
|
1831
|
0
|
0
|
|
|
|
|
if (substr($key, -1) eq " ") { |
1832
|
0
|
|
|
|
|
|
my $value = $result->{$key}; |
1833
|
0
|
|
|
|
|
|
delete $result->{$key}; |
1834
|
0
|
|
|
|
|
|
$key =~ s/\s+$//g; |
1835
|
0
|
|
|
|
|
|
$result->{$key} = $value; |
1836
|
|
|
|
|
|
|
# |
1837
|
|
|
|
|
|
|
# warum? |
1838
|
|
|
|
|
|
|
# |
1839
|
|
|
|
|
|
|
# %newparams ist: |
1840
|
|
|
|
|
|
|
# '-columns' => [ |
1841
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.8', |
1842
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.13', |
1843
|
|
|
|
|
|
|
# ... |
1844
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.16' |
1845
|
|
|
|
|
|
|
# ], |
1846
|
|
|
|
|
|
|
# '-startindex' => '2', |
1847
|
|
|
|
|
|
|
# '-endindex' => '2' |
1848
|
|
|
|
|
|
|
# |
1849
|
|
|
|
|
|
|
# und $result ist: |
1850
|
|
|
|
|
|
|
# ... |
1851
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.2.2' => 'Adaptive Security Appliance \'outside\' interface', |
1852
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.16.2 ' => 4281465004, |
1853
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.13.2' => 0, |
1854
|
|
|
|
|
|
|
# ... |
1855
|
|
|
|
|
|
|
# |
1856
|
|
|
|
|
|
|
# stinkstiefel! |
1857
|
|
|
|
|
|
|
# |
1858
|
|
|
|
|
|
|
} |
1859
|
0
|
|
|
|
|
|
$self->add_rawdata($key, $result->{$key}); |
1860
|
|
|
|
|
|
|
} |
1861
|
|
|
|
|
|
|
} else { |
1862
|
|
|
|
|
|
|
my $preresult = $self->get_matching_oids( |
1863
|
0
|
|
|
|
|
|
-columns => $params{'-columns'}); |
1864
|
0
|
|
|
|
|
|
foreach (keys %{$preresult}) { |
|
0
|
|
|
|
|
|
|
1865
|
0
|
|
|
|
|
|
$result->{$_} = $preresult->{$_}; |
1866
|
|
|
|
|
|
|
} |
1867
|
0
|
|
|
|
|
|
my @sortedkeys = map { $_->[0] } |
1868
|
0
|
|
|
|
|
|
sort { $a->[1] cmp $b->[1] } |
1869
|
|
|
|
|
|
|
map { [$_, |
1870
|
0
|
|
|
|
|
|
join '', map { sprintf("%30d",$_) } split( /\./, $_) |
|
0
|
|
|
|
|
|
|
1871
|
0
|
|
|
|
|
|
] } keys %{$result}; |
|
0
|
|
|
|
|
|
|
1872
|
0
|
|
|
|
|
|
my @to_del = (); |
1873
|
0
|
0
|
|
|
|
|
if ($params{'-startindex'}) { |
1874
|
0
|
|
|
|
|
|
foreach my $resoid (@sortedkeys) { |
1875
|
0
|
|
|
|
|
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
1876
|
0
|
|
|
|
|
|
my $poid = $oid.'.'; |
1877
|
0
|
|
|
|
|
|
my $lpoid = length($poid); |
1878
|
0
|
0
|
|
|
|
|
if (substr($resoid, 0, $lpoid) eq $poid) { |
1879
|
0
|
|
|
|
|
|
my $oidpattern = $poid; |
1880
|
0
|
|
|
|
|
|
$oidpattern =~ s/\./\\./g; |
1881
|
0
|
0
|
|
|
|
|
if ($resoid =~ /^$oidpattern(.+)$/) { |
1882
|
0
|
0
|
|
|
|
|
if ($1 lt $params{'-startindex'}) { |
1883
|
0
|
|
|
|
|
|
push(@to_del, $oid.'.'.$1); |
1884
|
|
|
|
|
|
|
} |
1885
|
|
|
|
|
|
|
} |
1886
|
|
|
|
|
|
|
} |
1887
|
|
|
|
|
|
|
} |
1888
|
|
|
|
|
|
|
} |
1889
|
|
|
|
|
|
|
} |
1890
|
0
|
0
|
|
|
|
|
if ($params{'-endindex'}) { |
1891
|
0
|
|
|
|
|
|
foreach my $resoid (@sortedkeys) { |
1892
|
0
|
|
|
|
|
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
1893
|
0
|
|
|
|
|
|
my $poid = $oid.'.'; |
1894
|
0
|
|
|
|
|
|
my $lpoid = length($poid); |
1895
|
0
|
0
|
|
|
|
|
if (substr($resoid, 0, $lpoid) eq $poid) { |
1896
|
0
|
|
|
|
|
|
my $oidpattern = $poid; |
1897
|
0
|
|
|
|
|
|
$oidpattern =~ s/\./\\./g; |
1898
|
0
|
0
|
|
|
|
|
if ($resoid =~ /^$oidpattern(.+)$/) { |
1899
|
0
|
0
|
|
|
|
|
if ($1 gt $params{'-endindex'}) { |
1900
|
0
|
|
|
|
|
|
push(@to_del, $oid.'.'.$1); |
1901
|
|
|
|
|
|
|
} |
1902
|
|
|
|
|
|
|
} |
1903
|
|
|
|
|
|
|
} |
1904
|
|
|
|
|
|
|
} |
1905
|
|
|
|
|
|
|
} |
1906
|
|
|
|
|
|
|
} |
1907
|
0
|
|
|
|
|
|
foreach (@to_del) { |
1908
|
0
|
|
|
|
|
|
delete $result->{$_}; |
1909
|
|
|
|
|
|
|
} |
1910
|
|
|
|
|
|
|
} |
1911
|
0
|
|
|
|
|
|
return $result; |
1912
|
|
|
|
|
|
|
} |
1913
|
|
|
|
|
|
|
|
1914
|
|
|
|
|
|
|
sub get_entries_by_walk { |
1915
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1916
|
0
|
0
|
|
|
|
|
if (! $self->opts->snmpwalk) { |
1917
|
0
|
|
|
|
|
|
$self->add_ok("if you get this crap working correctly, let me know"); |
1918
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1919
|
0
|
0
|
|
|
|
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1920
|
0
|
0
|
|
|
|
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1921
|
|
|
|
|
|
|
} |
1922
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_tree %s", Data::Dumper::Dumper(\%params)); |
1923
|
0
|
|
|
|
|
|
my @baseoids = @{$params{-varbindlist}}; |
|
0
|
|
|
|
|
|
|
1924
|
0
|
|
|
|
|
|
delete $params{-varbindlist}; |
1925
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 0) { |
1926
|
0
|
|
|
|
|
|
foreach my $baseoid (@baseoids) { |
1927
|
0
|
|
|
|
|
|
$params{-varbindlist} = [$baseoid]; |
1928
|
0
|
|
|
|
|
|
while (my $result = $Monitoring::GLPlugin::SNMP::session->get_next_request(%params)) { |
1929
|
0
|
|
|
|
|
|
$params{-varbindlist} = [($Monitoring::GLPlugin::SNMP::session->var_bind_names)[0]]; |
1930
|
|
|
|
|
|
|
} |
1931
|
|
|
|
|
|
|
} |
1932
|
|
|
|
|
|
|
} else { |
1933
|
0
|
|
|
|
|
|
$params{-maxrepetitions} = 200; |
1934
|
0
|
|
|
|
|
|
foreach my $baseoid (@baseoids) { |
1935
|
0
|
|
|
|
|
|
$params{-varbindlist} = [$baseoid]; |
1936
|
0
|
|
|
|
|
|
while (my $result = $Monitoring::GLPlugin::SNMP::session->get_bulk_request(%params)) { |
1937
|
0
|
|
|
|
|
|
my @names = $Monitoring::GLPlugin::SNMP::session->var_bind_names(); |
1938
|
0
|
|
|
|
|
|
my @oids = $self->sort_oids(\@names); |
1939
|
0
|
|
|
|
|
|
$params{-varbindlist} = [pop @oids]; |
1940
|
|
|
|
|
|
|
} |
1941
|
|
|
|
|
|
|
} |
1942
|
|
|
|
|
|
|
} |
1943
|
|
|
|
|
|
|
} else { |
1944
|
|
|
|
|
|
|
return $self->get_matching_oids( |
1945
|
0
|
|
|
|
|
|
-columns => $params{-varbindlist}); |
1946
|
|
|
|
|
|
|
} |
1947
|
|
|
|
|
|
|
} |
1948
|
|
|
|
|
|
|
|
1949
|
|
|
|
|
|
|
sub get_table { |
1950
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
1951
|
0
|
|
|
|
|
|
$self->add_oidtrace($params{'-baseoid'}); |
1952
|
0
|
0
|
|
|
|
|
if (! $self->opts->snmpwalk) { |
1953
|
0
|
|
|
|
|
|
my @notcached = (); |
1954
|
0
|
0
|
|
|
|
|
if ($Monitoring::GLPlugin::SNMP::session->version() == 3) { |
1955
|
0
|
0
|
|
|
|
|
$params{-contextengineid} = $self->opts->contextengineid if $self->opts->contextengineid; |
1956
|
0
|
0
|
|
|
|
|
$params{-contextname} = $self->opts->contextname if $self->opts->contextname; |
1957
|
|
|
|
|
|
|
} |
1958
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params)); |
1959
|
0
|
|
|
|
|
|
my $result = $Monitoring::GLPlugin::SNMP::session->get_table(%params); |
1960
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table returned %d oids", scalar(keys %{$result})); |
|
0
|
|
|
|
|
|
|
1961
|
0
|
0
|
|
|
|
|
if (scalar(keys %{$result}) == 0) { |
|
0
|
|
|
|
|
|
|
1962
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table error: %s", |
1963
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::session->error()); |
1964
|
0
|
|
|
|
|
|
$self->debug("get_table error: try fallback"); |
1965
|
0
|
|
|
|
|
|
$params{'-maxrepetitions'} = 1; |
1966
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table %s", Data::Dumper::Dumper(\%params)); |
1967
|
0
|
|
|
|
|
|
$result = $Monitoring::GLPlugin::SNMP::session->get_table(%params); |
1968
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table returned %d oids", scalar(keys %{$result})); |
|
0
|
|
|
|
|
|
|
1969
|
0
|
0
|
|
|
|
|
if (scalar(keys %{$result}) == 0) { |
|
0
|
|
|
|
|
|
|
1970
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_table error: %s", |
1971
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::session->error()); |
1972
|
0
|
|
|
|
|
|
$self->debug("get_table error: no more fallbacks. Try --protocol 1"); |
1973
|
|
|
|
|
|
|
} |
1974
|
|
|
|
|
|
|
} |
1975
|
|
|
|
|
|
|
# Drecksstinkstiefel Net::SNMP |
1976
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.22.4 ' => 'endOfMibView', |
1977
|
|
|
|
|
|
|
# '1.3.6.1.2.1.2.2.1.22.4' => '0.0', |
1978
|
0
|
|
|
|
|
|
foreach my $key (keys %{$result}) { |
|
0
|
|
|
|
|
|
|
1979
|
0
|
0
|
|
|
|
|
if (substr($key, -1) eq " ") { |
1980
|
0
|
|
|
|
|
|
my $value = $result->{$key}; |
1981
|
0
|
|
|
|
|
|
delete $result->{$key}; |
1982
|
0
|
|
|
|
|
|
(my $shortkey = $key) =~ s/\s+$//g; |
1983
|
0
|
0
|
|
|
|
|
if (! exists $result->{shortkey}) { |
1984
|
0
|
|
|
|
|
|
$result->{$shortkey} = $value; |
1985
|
|
|
|
|
|
|
} |
1986
|
0
|
0
|
|
|
|
|
$self->add_rawdata($key, $result->{$key}) if exists $result->{$key}; |
1987
|
|
|
|
|
|
|
} else { |
1988
|
0
|
|
|
|
|
|
$self->add_rawdata($key, $result->{$key}); |
1989
|
|
|
|
|
|
|
} |
1990
|
|
|
|
|
|
|
} |
1991
|
|
|
|
|
|
|
} |
1992
|
|
|
|
|
|
|
return $self->get_matching_oids( |
1993
|
0
|
|
|
|
|
|
-columns => [$params{'-baseoid'}]); |
1994
|
|
|
|
|
|
|
} |
1995
|
|
|
|
|
|
|
|
1996
|
|
|
|
|
|
|
################################################################ |
1997
|
|
|
|
|
|
|
# helper functions |
1998
|
|
|
|
|
|
|
# |
1999
|
|
|
|
|
|
|
sub valid_response { |
2000
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $oid, $index) = @_; |
2001
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2002
|
0
|
0
|
0
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib} && |
2003
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$oid}) { |
2004
|
|
|
|
|
|
|
# make it numerical |
2005
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$oid}; |
2006
|
0
|
0
|
|
|
|
|
if (defined $index) { |
2007
|
0
|
|
|
|
|
|
$oid .= '.'.$index; |
2008
|
|
|
|
|
|
|
} |
2009
|
0
|
|
|
|
|
|
my $result = $self->get_request( |
2010
|
|
|
|
|
|
|
-varbindlist => [$oid] |
2011
|
|
|
|
|
|
|
); |
2012
|
0
|
0
|
0
|
|
|
|
if (!defined($result) || |
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2013
|
|
|
|
|
|
|
! defined $result->{$oid} || |
2014
|
|
|
|
|
|
|
$result->{$oid} eq 'noSuchInstance' || |
2015
|
|
|
|
|
|
|
$result->{$oid} eq 'noSuchObject' || |
2016
|
|
|
|
|
|
|
$result->{$oid} eq 'endOfMibView') { |
2017
|
0
|
|
|
|
|
|
return undef; |
2018
|
|
|
|
|
|
|
} else { |
2019
|
0
|
|
|
|
|
|
$self->add_rawdata($oid, $result->{$oid}); |
2020
|
0
|
|
|
|
|
|
return $result->{$oid}; |
2021
|
|
|
|
|
|
|
} |
2022
|
|
|
|
|
|
|
} else { |
2023
|
0
|
|
|
|
|
|
return undef; |
2024
|
|
|
|
|
|
|
} |
2025
|
|
|
|
|
|
|
} |
2026
|
|
|
|
|
|
|
|
2027
|
|
|
|
|
|
|
# make_symbolic |
2028
|
|
|
|
|
|
|
# mib is the name of a mib (must be in mibs_and_oids) |
2029
|
|
|
|
|
|
|
# result is a hash-key oid->value |
2030
|
|
|
|
|
|
|
# indices is a array ref of array refs. [[1],[2],...] or [[1,0],[1,1],[2,0].. |
2031
|
|
|
|
|
|
|
sub make_symbolic { |
2032
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $result, $indices) = @_; |
2033
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2034
|
0
|
|
|
|
|
|
my @entries = (); |
2035
|
0
|
0
|
0
|
|
|
|
if (! wantarray && ref(\$result) eq "SCALAR" && ref(\$indices) eq "SCALAR") { |
|
|
|
0
|
|
|
|
|
2036
|
|
|
|
|
|
|
# $self->make_symbolic('CISCO-IETF-NAT-MIB', 'cnatProtocolStatsName', $self->{cnatProtocolStatsName}); |
2037
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$result}; |
2038
|
0
|
|
|
|
|
|
$result = { $oid => $self->{$result} }; |
2039
|
0
|
|
|
|
|
|
$indices = [[]]; |
2040
|
|
|
|
|
|
|
} |
2041
|
0
|
|
|
|
|
|
foreach my $index (@{$indices}) { |
|
0
|
|
|
|
|
|
|
2042
|
|
|
|
|
|
|
# skip [], [[]], [[undef]] |
2043
|
0
|
0
|
|
|
|
|
if (ref($index) eq "ARRAY") { |
2044
|
0
|
0
|
|
|
|
|
if (scalar(@{$index}) == 0) { |
|
0
|
0
|
|
|
|
|
|
2045
|
0
|
|
|
|
|
|
next; |
2046
|
|
|
|
|
|
|
} elsif (!defined $index->[0]) { |
2047
|
0
|
|
|
|
|
|
next; |
2048
|
|
|
|
|
|
|
} |
2049
|
|
|
|
|
|
|
} |
2050
|
0
|
|
|
|
|
|
my $mo = {}; |
2051
|
0
|
|
|
|
|
|
my $idx = join('.', @{$index}); # index can be multi-level |
|
0
|
|
|
|
|
|
|
2052
|
0
|
|
|
|
|
|
foreach my $symoid |
2053
|
0
|
|
|
|
|
|
(keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
2054
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid}; |
2055
|
0
|
0
|
|
|
|
|
if (ref($oid) ne 'HASH') { |
2056
|
0
|
|
|
|
|
|
my $fulloid = $oid . '.'.$idx; |
2057
|
0
|
0
|
|
|
|
|
if (exists $result->{$fulloid}) { |
2058
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) { |
2059
|
0
|
0
|
|
|
|
|
if (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) eq 'HASH') { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2060
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$fulloid}}) { |
2061
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$fulloid}}; |
2062
|
|
|
|
|
|
|
} else { |
2063
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2064
|
|
|
|
|
|
|
} |
2065
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^OID::(.*)/) { |
2066
|
0
|
|
|
|
|
|
my $othermib = $1; |
2067
|
0
|
|
|
|
|
|
my $value_which_is_a_oid = $result->{$fulloid}; |
2068
|
0
|
|
|
|
|
|
$value_which_is_a_oid =~ s/^\.//g; |
2069
|
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
|
|
|
|
|
|
|
2070
|
0
|
0
|
|
|
|
|
if (scalar(@result)) { |
2071
|
0
|
|
|
|
|
|
$mo->{$symoid} = $result[0]; |
2072
|
|
|
|
|
|
|
} else { |
2073
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2074
|
|
|
|
|
|
|
} |
2075
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^(.*?)::(.*)/) { |
2076
|
0
|
|
|
|
|
|
my $mib = $1; |
2077
|
0
|
|
|
|
|
|
my $definition = $2; |
2078
|
0
|
0
|
0
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2079
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2080
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'CODE') { |
2081
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->($result->{$fulloid}); |
2082
|
|
|
|
|
|
|
} elsif (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
2083
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2084
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'HASH' && |
2085
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$fulloid}}) { |
2086
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$fulloid}}; |
2087
|
|
|
|
|
|
|
} else { |
2088
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2089
|
|
|
|
|
|
|
} |
2090
|
|
|
|
|
|
|
} else { |
2091
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$fulloid}; |
2092
|
|
|
|
|
|
|
# oder $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}? |
2093
|
|
|
|
|
|
|
} |
2094
|
|
|
|
|
|
|
} else { |
2095
|
0
|
|
|
|
|
|
$mo->{$symoid} = $result->{$fulloid}; |
2096
|
|
|
|
|
|
|
} |
2097
|
|
|
|
|
|
|
} |
2098
|
|
|
|
|
|
|
} |
2099
|
|
|
|
|
|
|
} |
2100
|
0
|
|
|
|
|
|
push(@entries, $mo); |
2101
|
|
|
|
|
|
|
} |
2102
|
0
|
0
|
0
|
|
|
|
if (@{$indices} and scalar(@{$indices}) == 1 and !defined $indices->[0]->[0]) { |
|
0
|
|
0
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2103
|
0
|
|
|
|
|
|
my $mo = {}; |
2104
|
0
|
|
|
|
|
|
foreach my $symoid |
2105
|
0
|
|
|
|
|
|
(keys %{$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}}) { |
2106
|
0
|
|
|
|
|
|
my $oid = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid}; |
2107
|
0
|
0
|
|
|
|
|
if (ref($oid) ne 'HASH') { |
2108
|
0
|
0
|
|
|
|
|
if (exists $result->{$oid}) { |
2109
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) { |
2110
|
0
|
0
|
|
|
|
|
if (ref($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}) eq 'HASH') { |
|
|
0
|
|
|
|
|
|
2111
|
0
|
0
|
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$oid}}) { |
2112
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}->{$result->{$oid}}; |
2113
|
0
|
|
|
|
|
|
push(@entries, $mo); |
2114
|
|
|
|
|
|
|
} |
2115
|
|
|
|
|
|
|
} elsif ($Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'} =~ /^(.*?)::(.*)/) { |
2116
|
0
|
|
|
|
|
|
my $mib = $1; |
2117
|
0
|
|
|
|
|
|
my $definition = $2; |
2118
|
0
|
0
|
0
|
|
|
|
if (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
|
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
2119
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2120
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'CODE') { |
2121
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->($result->{$oid}); |
2122
|
|
|
|
|
|
|
} elsif (exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib} && |
2123
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition} && |
2124
|
|
|
|
|
|
|
ref($Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}) eq 'HASH' && |
2125
|
|
|
|
|
|
|
exists $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$oid}}) { |
2126
|
0
|
|
|
|
|
|
$mo->{$symoid} = $Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{$mib}->{$definition}->{$result->{$oid}}; |
2127
|
|
|
|
|
|
|
} else { |
2128
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$oid}; |
2129
|
|
|
|
|
|
|
} |
2130
|
|
|
|
|
|
|
} else { |
2131
|
0
|
|
|
|
|
|
$mo->{$symoid} = 'unknown_'.$result->{$oid}; |
2132
|
|
|
|
|
|
|
# oder $Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$symoid.'Definition'}? |
2133
|
|
|
|
|
|
|
} |
2134
|
|
|
|
|
|
|
} |
2135
|
|
|
|
|
|
|
} |
2136
|
|
|
|
|
|
|
} |
2137
|
|
|
|
|
|
|
} |
2138
|
0
|
0
|
|
|
|
|
push(@entries, $mo) if keys %{$mo}; |
|
0
|
|
|
|
|
|
|
2139
|
|
|
|
|
|
|
} |
2140
|
0
|
0
|
|
|
|
|
if (wantarray) { |
2141
|
0
|
|
|
|
|
|
return @entries; |
2142
|
|
|
|
|
|
|
} else { |
2143
|
0
|
|
|
|
|
|
foreach my $entry (@entries) { |
2144
|
0
|
|
|
|
|
|
foreach my $key (keys %{$entry}) { |
|
0
|
|
|
|
|
|
|
2145
|
0
|
|
|
|
|
|
$self->{$key} = $entry->{$key}; |
2146
|
|
|
|
|
|
|
} |
2147
|
|
|
|
|
|
|
} |
2148
|
|
|
|
|
|
|
} |
2149
|
|
|
|
|
|
|
} |
2150
|
|
|
|
|
|
|
|
2151
|
|
|
|
|
|
|
sub sort_oids { |
2152
|
0
|
|
|
0
|
0
|
|
my ($self, $oids) = @_; |
2153
|
0
|
|
0
|
|
|
|
$oids ||= []; |
2154
|
0
|
|
|
|
|
|
my @sortedkeys = map { $_->[0] } |
2155
|
0
|
|
|
|
|
|
sort { $a->[1] cmp $b->[1] } |
2156
|
|
|
|
|
|
|
map { [$_, |
2157
|
0
|
|
|
|
|
|
join '', map { sprintf("%30d",$_) } split( /\./, $_) |
|
0
|
|
|
|
|
|
|
2158
|
0
|
|
|
|
|
|
] } @{$oids}; |
|
0
|
|
|
|
|
|
|
2159
|
0
|
|
|
|
|
|
return @sortedkeys; |
2160
|
|
|
|
|
|
|
} |
2161
|
|
|
|
|
|
|
|
2162
|
|
|
|
|
|
|
sub get_matching_oids { |
2163
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
2164
|
0
|
|
|
|
|
|
my $result = {}; |
2165
|
0
|
|
|
|
|
|
$self->debug(sprintf "get_matching_oids %s", Data::Dumper::Dumper(\%params)); |
2166
|
0
|
|
|
|
|
|
foreach my $oid (@{$params{'-columns'}}) { |
|
0
|
|
|
|
|
|
|
2167
|
0
|
|
|
|
|
|
my $oidpattern = $oid; |
2168
|
0
|
|
|
|
|
|
$oidpattern =~ s/\./\\./g; |
2169
|
0
|
|
|
|
|
|
map { $result->{$_} = $Monitoring::GLPlugin::SNMP::rawdata->{$_} } |
2170
|
0
|
|
|
|
|
|
grep /^$oidpattern(?=\.|$)/, keys %{$Monitoring::GLPlugin::SNMP::rawdata}; |
|
0
|
|
|
|
|
|
|
2171
|
|
|
|
|
|
|
} |
2172
|
|
|
|
|
|
|
$self->debug(sprintf "get_matching_oids returns %d from %d oids", |
2173
|
0
|
|
|
|
|
|
scalar(keys %{$result}), scalar(keys %{$Monitoring::GLPlugin::SNMP::rawdata})); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2174
|
0
|
|
|
|
|
|
return $result; |
2175
|
|
|
|
|
|
|
} |
2176
|
|
|
|
|
|
|
|
2177
|
|
|
|
|
|
|
sub get_indices { |
2178
|
0
|
|
|
0
|
0
|
|
my ($self, %params) = @_; |
2179
|
|
|
|
|
|
|
# -baseoid : entry |
2180
|
|
|
|
|
|
|
# find all oids beginning with $entry |
2181
|
|
|
|
|
|
|
# then skip one field for the sequence |
2182
|
|
|
|
|
|
|
# then read the next numindices fields |
2183
|
0
|
|
|
|
|
|
my $entrypat = $params{'-baseoid'}; |
2184
|
0
|
|
|
|
|
|
$entrypat =~ s/\./\\\./g; |
2185
|
|
|
|
|
|
|
my @indices = map { |
2186
|
0
|
0
|
|
|
|
|
/^$entrypat\.\d+\.(.*)/ && $1; |
2187
|
|
|
|
|
|
|
} grep { |
2188
|
0
|
|
|
|
|
|
/^$entrypat/ |
2189
|
0
|
|
|
|
|
|
} keys %{$Monitoring::GLPlugin::SNMP::rawdata}; |
|
0
|
|
|
|
|
|
|
2190
|
0
|
|
|
|
|
|
my %seen = (); |
2191
|
0
|
|
|
|
|
|
my @o = map {[split /\./]} sort grep !$seen{$_}++, @indices; |
|
0
|
|
|
|
|
|
|
2192
|
0
|
|
|
|
|
|
return @o; |
2193
|
|
|
|
|
|
|
} |
2194
|
|
|
|
|
|
|
|
2195
|
|
|
|
|
|
|
# this flattens a n-dimensional array and returns the absolute position |
2196
|
|
|
|
|
|
|
# of the element at position idx1,idx2,...,idxn |
2197
|
|
|
|
|
|
|
# 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 |
2198
|
|
|
|
|
|
|
sub get_number { |
2199
|
0
|
|
|
0
|
0
|
|
my ($self, $indexlists, @element) = @_; |
2200
|
|
|
|
|
|
|
# $indexlists = zeiger auf array aus [1, 2] |
2201
|
0
|
|
|
|
|
|
my $dimensions = scalar(@{$indexlists->[0]}); |
|
0
|
|
|
|
|
|
|
2202
|
0
|
|
|
|
|
|
my @sorted = (); |
2203
|
0
|
|
|
|
|
|
my $number = 0; |
2204
|
0
|
0
|
|
|
|
|
if ($dimensions == 1) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2205
|
|
|
|
|
|
|
@sorted = |
2206
|
0
|
|
|
|
|
|
sort { $a->[0] <=> $b->[0] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2207
|
|
|
|
|
|
|
} elsif ($dimensions == 2) { |
2208
|
|
|
|
|
|
|
@sorted = |
2209
|
0
|
0
|
|
|
|
|
sort { $a->[0] <=> $b->[0] || $a->[1] <=> $b->[1] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2210
|
|
|
|
|
|
|
} elsif ($dimensions == 3) { |
2211
|
|
|
|
|
|
|
@sorted = |
2212
|
0
|
0
|
0
|
|
|
|
sort { $a->[0] <=> $b->[0] || |
2213
|
|
|
|
|
|
|
$a->[1] <=> $b->[1] || |
2214
|
0
|
|
|
|
|
|
$a->[2] <=> $b->[2] } @{$indexlists}; |
|
0
|
|
|
|
|
|
|
2215
|
|
|
|
|
|
|
} |
2216
|
0
|
|
|
|
|
|
foreach (@sorted) { |
2217
|
0
|
0
|
|
|
|
|
if ($dimensions == 1) { |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
2218
|
0
|
0
|
|
|
|
|
if ($_->[0] == $element[0]) { |
2219
|
0
|
|
|
|
|
|
last; |
2220
|
|
|
|
|
|
|
} |
2221
|
|
|
|
|
|
|
} elsif ($dimensions == 2) { |
2222
|
0
|
0
|
0
|
|
|
|
if ($_->[0] == $element[0] && $_->[1] == $element[1]) { |
2223
|
0
|
|
|
|
|
|
last; |
2224
|
|
|
|
|
|
|
} |
2225
|
|
|
|
|
|
|
} elsif ($dimensions == 3) { |
2226
|
0
|
0
|
0
|
|
|
|
if ($_->[0] == $element[0] && |
|
|
|
0
|
|
|
|
|
2227
|
|
|
|
|
|
|
$_->[1] == $element[1] && |
2228
|
|
|
|
|
|
|
$_->[2] == $element[2]) { |
2229
|
0
|
|
|
|
|
|
last; |
2230
|
|
|
|
|
|
|
} |
2231
|
|
|
|
|
|
|
} |
2232
|
0
|
|
|
|
|
|
$number++; |
2233
|
|
|
|
|
|
|
} |
2234
|
0
|
|
|
|
|
|
return ++$number; |
2235
|
|
|
|
|
|
|
} |
2236
|
|
|
|
|
|
|
|
2237
|
|
|
|
|
|
|
################################################################ |
2238
|
|
|
|
|
|
|
# caching functions |
2239
|
|
|
|
|
|
|
# |
2240
|
|
|
|
|
|
|
sub set_rawdata { |
2241
|
0
|
|
|
0
|
0
|
|
my ($self, $rawdata) = @_; |
2242
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata = $rawdata; |
2243
|
|
|
|
|
|
|
} |
2244
|
|
|
|
|
|
|
|
2245
|
|
|
|
|
|
|
sub add_rawdata { |
2246
|
0
|
|
|
0
|
0
|
|
my ($self, $oid, $value) = @_; |
2247
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::rawdata->{$oid} = $value; |
2248
|
|
|
|
|
|
|
} |
2249
|
|
|
|
|
|
|
|
2250
|
|
|
|
|
|
|
sub rawdata { |
2251
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
2252
|
0
|
|
|
|
|
|
return $Monitoring::GLPlugin::SNMP::rawdata; |
2253
|
|
|
|
|
|
|
} |
2254
|
|
|
|
|
|
|
|
2255
|
|
|
|
|
|
|
sub add_oidtrace { |
2256
|
0
|
|
|
0
|
0
|
|
my ($self, $oid) = @_; |
2257
|
0
|
|
|
|
|
|
$self->debug("cache: ".$oid); |
2258
|
0
|
|
|
|
|
|
push(@{$Monitoring::GLPlugin::SNMP::oidtrace}, $oid); |
|
0
|
|
|
|
|
|
|
2259
|
|
|
|
|
|
|
} |
2260
|
|
|
|
|
|
|
|
2261
|
|
|
|
|
|
|
# $self->update_entry_cache(0, $mib, $table, $key_attr); |
2262
|
|
|
|
|
|
|
# my @indices = $self->get_cache_indices(); |
2263
|
|
|
|
|
|
|
sub get_cache_indices { |
2264
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $table, $key_attr) = @_; |
2265
|
0
|
0
|
|
|
|
|
if (ref($key_attr) ne "ARRAY") { |
2266
|
0
|
|
|
|
|
|
$key_attr = [$key_attr]; |
2267
|
|
|
|
|
|
|
} |
2268
|
|
|
|
|
|
|
my $cache = sprintf "%s_%s_%s_cache", |
2269
|
0
|
|
|
|
|
|
$mib, $table, join('#', @{$key_attr}); |
|
0
|
|
|
|
|
|
|
2270
|
0
|
|
|
|
|
|
my @indices = (); |
2271
|
0
|
|
|
|
|
|
foreach my $key (keys %{$self->{$cache}}) { |
|
0
|
|
|
|
|
|
|
2272
|
0
|
|
|
|
|
|
my ($descr, $index) = split('-//-', $key, 2); |
2273
|
0
|
0
|
|
|
|
|
if ($self->opts->name) { |
2274
|
0
|
0
|
|
|
|
|
if ($self->opts->regexp) { |
2275
|
0
|
|
|
|
|
|
my $pattern = $self->opts->name; |
2276
|
0
|
0
|
|
|
|
|
if ($descr =~ /$pattern/i) { |
2277
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2278
|
|
|
|
|
|
|
} |
2279
|
|
|
|
|
|
|
} else { |
2280
|
0
|
0
|
|
|
|
|
if ($self->opts->name =~ /^\d+$/) { |
2281
|
0
|
0
|
|
|
|
|
if ($index == 1 * $self->opts->name) { |
2282
|
0
|
|
|
|
|
|
push(@indices, [1 * $self->opts->name]); |
2283
|
|
|
|
|
|
|
} |
2284
|
|
|
|
|
|
|
} else { |
2285
|
0
|
0
|
|
|
|
|
if (lc $descr eq lc $self->opts->name) { |
2286
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2287
|
|
|
|
|
|
|
} |
2288
|
|
|
|
|
|
|
} |
2289
|
|
|
|
|
|
|
} |
2290
|
|
|
|
|
|
|
} else { |
2291
|
0
|
|
|
|
|
|
push(@indices, $self->{$cache}->{$key}); |
2292
|
|
|
|
|
|
|
} |
2293
|
|
|
|
|
|
|
} |
2294
|
0
|
|
|
|
|
|
return @indices; |
2295
|
0
|
0
|
|
|
|
|
return map { join('.', ref($_) eq "ARRAY" ? @{$_} : $_) } @indices; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2296
|
|
|
|
|
|
|
} |
2297
|
|
|
|
|
|
|
|
2298
|
|
|
|
|
|
|
sub get_entities { |
2299
|
0
|
|
|
0
|
0
|
|
my ($self, $class, $filter) = @_; |
2300
|
0
|
|
|
|
|
|
foreach ($self->get_sub_table('ENTITY-MIB', [ |
2301
|
|
|
|
|
|
|
'entPhysicalDescr', |
2302
|
|
|
|
|
|
|
'entPhysicalName', |
2303
|
|
|
|
|
|
|
'entPhysicalClass', |
2304
|
|
|
|
|
|
|
])) { |
2305
|
0
|
|
|
|
|
|
my $new_object = $class->new(%{$_}); |
|
0
|
|
|
|
|
|
|
2306
|
0
|
0
|
0
|
|
|
|
next if (defined $filter && ! &$filter($new_object)); |
2307
|
0
|
|
|
|
|
|
push @{$self->{entities}}, $new_object; |
|
0
|
|
|
|
|
|
|
2308
|
|
|
|
|
|
|
} |
2309
|
|
|
|
|
|
|
} |
2310
|
|
|
|
|
|
|
|
2311
|
|
|
|
|
|
|
sub get_sub_table { |
2312
|
0
|
|
|
0
|
0
|
|
my ($self, $mib, $names) = @_; |
2313
|
0
|
|
|
|
|
|
$self->require_mib($mib); |
2314
|
|
|
|
|
|
|
my @oids = map { |
2315
|
0
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{$mib}->{$_} |
|
0
|
|
|
|
|
|
|
2316
|
|
|
|
|
|
|
} @$names; |
2317
|
0
|
|
|
|
|
|
my $result = $self->get_entries( |
2318
|
|
|
|
|
|
|
-columns => \@oids |
2319
|
|
|
|
|
|
|
); |
2320
|
0
|
|
|
|
|
|
my $indices = (); |
2321
|
0
|
0
|
|
|
|
|
map { if ($_ =~ /\.(\d+)$/) { $indices->{$1} = [ $1 ]; } } keys %$result; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2322
|
0
|
|
|
|
|
|
my @indices = values %$indices; |
2323
|
0
|
|
|
|
|
|
my @entries = $self->make_symbolic($mib, $result, \@indices); |
2324
|
0
|
|
|
|
|
|
@entries = map { $_->{indices} = shift @indices; $_ } @entries; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2325
|
0
|
|
|
|
|
|
@entries = map { $_->{flat_indices} = join(".", @{$_->{indices}}); $_ } @entries; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
2326
|
0
|
|
|
|
|
|
return @entries; |
2327
|
|
|
|
|
|
|
} |
2328
|
|
|
|
|
|
|
|
2329
|
|
|
|
|
|
|
sub join_table { |
2330
|
0
|
|
|
0
|
0
|
|
my ($self, $to, $from) = @_; |
2331
|
0
|
|
|
|
|
|
my $to_i = {}; |
2332
|
0
|
|
|
|
|
|
foreach (@$to) { |
2333
|
0
|
|
|
|
|
|
my $i = $_->{flat_indices}; |
2334
|
0
|
|
|
|
|
|
$to_i->{$i} = $_; |
2335
|
|
|
|
|
|
|
} |
2336
|
0
|
|
|
|
|
|
foreach my $f (@$from) { |
2337
|
0
|
|
|
|
|
|
my $i = $f->{flat_indices}; |
2338
|
0
|
0
|
|
|
|
|
if (exists $to_i->{$i}) { |
2339
|
0
|
|
|
|
|
|
foreach (keys %$f) { |
2340
|
0
|
0
|
|
|
|
|
next if $_ =~ /indices/; |
2341
|
0
|
|
|
|
|
|
$to_i->{$i}->{$_} = $f->{$_}; |
2342
|
|
|
|
|
|
|
} |
2343
|
|
|
|
|
|
|
} |
2344
|
|
|
|
|
|
|
} |
2345
|
|
|
|
|
|
|
} |
2346
|
|
|
|
|
|
|
|
2347
|
|
|
|
|
|
|
|
2348
|
|
|
|
|
|
|
1; |
2349
|
|
|
|
|
|
|
|
2350
|
|
|
|
|
|
|
__END__ |