snmp-info icon indicating copy to clipboard operation
snmp-info copied to clipboard

Alcatel/Nokia SR - Error on e_index from /Info/Layer3/Timetra

Open flucio-tlf opened this issue 7 months ago • 5 comments

When i submit a netdisco-do discover on my Alcatel/Nokia SR routers, the e_index returns a error, because it has a "1." before the integer expected. So none modules has been inserted to DB.

[2694767] 2025-06-16 14:54:36 debug ⮕ worker Discover::Entities p100 [2694767] 2025-06-16 14:54:36 debug [192.168.1.1] modules - index 1.184550401 is not an integer .... [2694767] 2025-06-16 14:54:36 debug [192.168.1.1] modules - index 1.402653953 is not an integer [2694767] 2025-06-16 14:54:36 debug [192.168.1.1] modules - removed 0 chassis modules [2694767] 2025-06-16 14:54:36 debug ⬅ (info) [192.168.1.1] modules - added 0 new chassis modules

I debugged Timetra.pm, and compare with many snmp outputs, from diferents versions and models of Nokia SR family.

So i made a workaround to strip the caracter "1." from the OID results, to became a integer again:

--- Timetra.pm.bkp.ori  2025-06-16 10:19:14.000000000 -0300
+++ Timetra.pm  2025-06-16 15:19:37.473633447 -0300
@@ -354,7 +354,13 @@
     my %e_index;
 
     foreach my $iid ( keys %$e_descr ) {
-        $e_index{$iid} = $iid;
+        #$e_index{$iid} = $iid;
+       # Remove o prefixo "1." usando uma expressão regular
+        if ($iid =~ /^1\.(\d+)$/) {
+            $e_index{$iid} = $1; # Armazena apenas o número inteiro
+        } else {
+            warn "index $iid is not in the expected format"; # Trata índices inesperados
+        }
     }
     return \%e_index;
 }

Please include in the next version, or if had time, debug the root cause in across the code.

If needed. I can test and validade the code.

App::Netdisco 2.86.1 SNMP::Info 3.972.2 DB Schema 93 PostgreSQL 14.00.18 Perl 5.34.0

Thanks in advice.

flucio-tlf avatar Jun 16 '25 19:06 flucio-tlf

Patch in a better format

Timetra.pm.patch.txt

flucio-tlf avatar Jun 16 '25 19:06 flucio-tlf

did this work before? and if so do you know which timeframe?

looking at the module & it's test it seems to have been using the same formatting for a long time. netdisco did however do some work in this area over the past months.

thx

inphobia avatar Jul 09 '25 02:07 inphobia

I also don't mind putting a fix into Netdisco - try to remove 1. from any index it sees. It's a bit leaky as a solution but would be a more general one - unless it can go somewhere in Info.pm that would benefit all Entity retrievals.

ollyg avatar Jul 09 '25 05:07 ollyg

did this work before? and if so do you know which timeframe?

looking at the module & it's test it seems to have been using the same formatting for a long time. netdisco did however do some work in this area over the past months.

thx

I've been using it with Alcatel/Nokia since 2013, and it never worked.

flucio-tlf avatar Jul 23 '25 17:07 flucio-tlf

I also don't mind putting a fix into Netdisco - try to remove 1. from any index it sees. It's a bit leaky as a solution but would be a more general one - unless it can go somewhere in Info.pm that would benefit all Entity retrievals.

Sorry for not elaborating on the solution, as I don't have sufficient knowledge. But feel free to suggest something more elaborate. Count on me to test and validate any other solution.

flucio-tlf avatar Jul 23 '25 17:07 flucio-tlf