Welcome, Guest. Please login or register.

Author Topic: libsnmp.pm  (Read 1514 times)

flamingbob

  • Newbie
  • *
  • Posts: 3
    • View Profile
libsnmp.pm
« on: March 29, 2022, 04:58:08 pm »
Nedi gives me an error getting interface descriptions on longer types of alliases
IF  :Walking name
IF  :Walking description
ERR :IF Desc No response from remote host "172.25.235.133"
IF  :Walking type

I cant really pinpoint a problem in the code but seems the problem is like this:
iso.3.6.1.2.1.2.2.1.2.35848192 = STRING: "1/1/6, 10/100/Gig Ethernet SFP, \"IT-LAN\""

That would work

iso.3.6.1.2.1.2.2.1.2.35848192 = STRING: "1/1/6, 10/100/Gig Ethernet SFP, \"IT-LAN in a longer string and will fail\""

Now this OID will fail. Seems then the string is longer then 64 chars and will fail

Anyone got any ideas?

Code: [Select]
         if($ifnamO eq $ifdesO){                                                         # Copy IF desc, if used as name
                                %ifde  = %{$r};
                                @ifx = map(substr($_,20), keys %ifde);                                  # cut OIDs down to indexes in 1 step (gotta love perl!)
                        }else{
                                misc::Prt("IF  :Walking description\n");
                                $r = $session->get_entries(-columns => [$ifdesO],@range,@maxrep);
                                $stat{d} = $session->error;
                                if($stat{d}){
                                        misc::Prt("ERR :IF Desc $stat{d}\n","Id");
                                        $warn++;
                                }else{
                                        %ifde = %{$r};
                                        @ifx = map(substr($_,20), keys %ifde);

                                }
                        }
                }

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
    • View Profile
    • NeDi
Re: libsnmp.pm
« Reply #1 on: May 09, 2022, 10:39:18 am »
The oid https://oidref.com/1.3.6.1.2.1.2.2.1.2 is ifDescription and should be stored in a varchar 255. Your .def should reflect that or you end up with problems like this...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

flamingbob

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: libsnmp.pm
« Reply #2 on: May 30, 2022, 02:35:23 pm »
Thank you. How to solve that? Trying to to fix it in def but IFdesc doesnt seem to alter that much? Got any hints? Strange it still works on some of this nokia 7210 but fails on others.

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
    • View Profile
    • NeDi
Re: libsnmp.pm
« Reply #3 on: August 19, 2022, 11:23:05 am »
Try 1.3.6.1.2.1.31.1.1.1.1 for interface name. I'd assume they're much shorter...
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo