Package: net-snmp
Version: 5.7.3+dfsg-4

I upgraded from Ubuntu 16.04 to 18.04, and suddenly one of my perl snmp scripts (https://github.com/alaskacommunications/nagios_check_keepalived/blob/master/check_keepalived_vrrp.pl) started failing. When switching back to SNMP v1 (which uses getnext instead of getbulk), it gives the following errors: Use of uninitialized value $stopcond in quotemeta at /usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884. Use of uninitialized value $stopcond in quotemeta at /usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884. Use of uninitialized value $stopcond in quotemeta at /usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884. Use of uninitialized value $stopcond in quotemeta at /usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884. Use of uninitialized value $stopcond in quotemeta at /usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.

After digging in the changes between net-snmp in ubuntu 16.04 and 18.04, I found out the following patch is the cause of this:
    * fix_perl_bulk_gets.diff: Fix handling of truncated bulk get responses
      in the Perl module. (Patch 1278 in upstream patch tracker.)

When I reverted this, everything started to work fine again :)

I tried fixing the patch, and the following makes everything start working again, but still some undef warnings:

--- SNMP.pm.bak    2018-10-15 16:16:15.000000000 +0200
+++ SNMP.pm    2018-12-03 15:26:22.419130670 +0100
@@ -907,7 +907,7 @@
     my @newstopconds = ();
     my @newvarbinds = ();
     for (my $i = 0; $i < $num_stopconds; ++$i) {
-        unless ($found_eof[$i]) {
+        unless ($found_eof[$i] || !defined($state->{'stopconds'}[$i])) {
         push @newstopconds, $state->{'stopconds'}[$i];
         push @newvarbinds, $state->{'varbinds'}[$i];
         }


So it seems like somebody with some more knowledge will need to have a look at this.

Thanks
Jean-Louis

Reply via email to