Eltex hw version crap -(

This commit is contained in:
Andrey Pazychev
2020-05-17 19:02:34 +03:00
parent fe3bc6afe0
commit 57aa73f613

View File

@@ -17,15 +17,18 @@ our ( $VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE );
$VERSION = '3.70-135';
our $index = undef;
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
%GLOBALS = (
%SNMP::Info::Layer3::GLOBALS,
'model_oid_mes' => 'mib-2.47.1.1.1.1.13.67108992',
#'hw_oid' => 'mib-2.47.1.1.1.1.8.67108992',
'hw_oid_1_81' => 'mib-2.47.1.1.1.1.8.67108992',
'model_oid' => 'iso.0.8802.1.1.2.1.3.4.0',
'model_oid_mxa' => 'enterprises.35265.4.2.0',
'model_oid_mxa' => 'enterprises.35265.4.2.0',
'hw_oid' => 'iso.0.8802.1.1.2.1.5.4795.1.2.2.0',
'hw_oid_1_30' => 'iso.0.8802.1.1.2.1.5.1.1.2.2.0',
'serial_oid' => 'mib-2.47.1.1.1.1.11.67108992',
'serial_oid_22' => 'enterprises.35265.1.22.1.18.4.0',
'serial_oid_mxa' => 'enterprises.35265.4.3.0',
@@ -48,7 +51,7 @@ sub model {
my $model; my $hw;
my $id = $obj->id();
$model = $obj->model_oid || undef;
$hw = $obj->hw_oid || undef;
$hw = $obj->hwver() || undef;
if ( $id =~ /35265\.1\.22/ ) {
my $descr = $obj->descr_oid;
$descr =~ /Eltex\s(.*)\ssoftware\sversion\s(.*)\sbuild\s(\d+)/;
@@ -60,6 +63,7 @@ sub model {
elsif (defined $model and $model !~ /MES\d+/) {
$model = $obj->model_oid_mes . ' ' . $obj->model_oid || undef;
}
if (defined $model and defined $hw) {
return $model . ' HW:' . $hw;
}
@@ -98,6 +102,9 @@ sub os_ver {
my $descr = $obj->descr_oid;
$descr =~ /Eltex\s(.*)\ssoftware\sversion\s(.*)\sbuild\s(\d+)/;
return $2;
}
elsif ($id =~ /35265\.1\.30/) {
}
else {
return 'unknown';
@@ -127,6 +134,21 @@ sub serial {
return $serial;
}
sub hwver {
my $obj = shift;
my $id = $obj->id();
my $hw = $obj->hw_ver();
if ($id =~ /35265\.1\.30/) {
return $obj->hw_oid_1_30;
}
elsif($id =~ /35265\.1\.81|5[4,2]/) {
return $obj->hw_oid_1_81;
}
else {
return $hw;
}
}
1;
__END__