| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Monitoring::GLPlugin::SNMP::SysDescPrettify; |
|
2
|
|
|
|
|
|
|
our @ISA = qw(Monitoring::GLPlugin::SNMP); |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
{ |
|
5
|
2
|
|
|
2
|
|
12
|
no warnings qw(once); |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
326
|
|
|
6
|
|
|
|
|
|
|
$Monitoring::GLPlugin::SNMP::SysDescPrettify::vendor_rules = { |
|
7
|
|
|
|
|
|
|
Cisco => { |
|
8
|
|
|
|
|
|
|
vendor_pattern => '.*cisco.*', |
|
9
|
|
|
|
|
|
|
prettifier_funcs => [ |
|
10
|
|
|
|
|
|
|
sub { |
|
11
|
|
|
|
|
|
|
my ($sysdescr, $session) = @_; |
|
12
|
|
|
|
|
|
|
if ($sysdescr =~ /(Cisco NX-OS.*? n\d+),.*(Version .*), RELEASE SOFTWARE/) { |
|
13
|
|
|
|
|
|
|
return $1.' '.$2; |
|
14
|
|
|
|
|
|
|
} |
|
15
|
|
|
|
|
|
|
return undef; |
|
16
|
|
|
|
|
|
|
}, |
|
17
|
|
|
|
|
|
|
], |
|
18
|
|
|
|
|
|
|
}, |
|
19
|
|
|
|
|
|
|
Netgear => { |
|
20
|
|
|
|
|
|
|
vendor_pattern => '.*(netgear|GS\d+TP).*', |
|
21
|
|
|
|
|
|
|
prettifier_funcs => [ |
|
22
|
|
|
|
|
|
|
sub { |
|
23
|
|
|
|
|
|
|
my ($sysdescr, $session) = @_; |
|
24
|
|
|
|
|
|
|
if ($sysdescr =~ /GS\d+TP/) { |
|
25
|
|
|
|
|
|
|
return 'Netgear '.$sysdescr; |
|
26
|
|
|
|
|
|
|
} |
|
27
|
|
|
|
|
|
|
return undef; |
|
28
|
|
|
|
|
|
|
}, |
|
29
|
|
|
|
|
|
|
], |
|
30
|
|
|
|
|
|
|
}, |
|
31
|
|
|
|
|
|
|
}; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |