Layer3::Juniper fixed to return os_ver for JUNOS 14.x and higher

This commit is contained in:
Oliver Gorwits
2017-07-11 21:01:33 +01:00
parent 2d18a75ad7
commit b9cd429551
2 changed files with 16 additions and 7 deletions

View File

@@ -1,5 +1,11 @@
SNMP::Info - Friendly OO-style interface to Network devices using SNMP. SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
version 3.37 (2017-07-11)
[ENHANCEMENTS]
* Layer3::Juniper fixed to return os_ver for JUNOS 14.x and higher
version 3.36 (2017-06-28) version 3.36 (2017-06-28)
[ENHANCEMENTS] [ENHANCEMENTS]

View File

@@ -110,15 +110,18 @@ sub layers {
sub os_ver { sub os_ver {
my $juniper = shift; my $juniper = shift;
my $descr = $juniper->description() || ''; my $sys_descr = $juniper->description() || '';
my $lldp_descr = $juniper->lldp_sysdesc() || ''; my $lldp_descr = $juniper->lldp_sysdesc() || '';
foreach my $descr ($sys_descr, $lldp_descr) {
if ( $descr =~ m/kernel JUNOS ([^,\s]+)/ ) { if ( $descr =~ m/kernel JUNOS ([^,\s]+)/ ) {
return $1; return $1;
} }
elsif ( $lldp_descr =~ m/version\s(\S+)\s/ ) { elsif ( $descr =~ m/version\s(\S+)\s/ ) {
return $1; return $1;
} }
}
return; return;
} }