<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Package: net-snmp<br>
Version: <span id="latest_version">5.7.3+dfsg-4<br>
<br>
I upgraded from Ubuntu 16.04 to 18.04, and suddenly one of my perl
snmp scripts
(<a class="moz-txt-link-freetext" href="https://github.com/alaskacommunications/nagios_check_keepalived/blob/master/check_keepalived_vrrp.pl">https://github.com/alaskacommunications/nagios_check_keepalived/blob/master/check_keepalived_vrrp.pl</a>)
started failing.<br>
When switching back to SNMP v1 (which uses getnext instead of
getbulk), it gives the following errors:<br>
Use of uninitialized value $stopcond in quotemeta at
/usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.<br>
Use of uninitialized value $stopcond in quotemeta at
/usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.<br>
Use of uninitialized value $stopcond in quotemeta at
/usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.<br>
Use of uninitialized value $stopcond in quotemeta at
/usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.<br>
Use of uninitialized value $stopcond in quotemeta at
/usr/lib/x86_64-linux-gnu/perl5/5.26/SNMP.pm line 884.<br>
<br>
</span>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:<br>
* fix_perl_bulk_gets.diff: Fix handling of truncated bulk get
responses<br>
in the Perl module. (Patch 1278 in upstream patch tracker.)<br>
<br>
When I reverted this, everything started to work fine again :)<br>
<br>
I tried fixing the patch, and the following makes everything start
working again, but still some undef warnings:<br>
<br>
--- SNMP.pm.bak 2018-10-15 16:16:15.000000000 +0200<br>
+++ SNMP.pm 2018-12-03 15:26:22.419130670 +0100<br>
@@ -907,7 +907,7 @@<br>
my @newstopconds = ();<br>
my @newvarbinds = ();<br>
for (my $i = 0; $i < $num_stopconds; ++$i) {<br>
- unless ($found_eof[$i]) {<br>
+ unless ($found_eof[$i] ||
!defined($state->{'stopconds'}[$i])) {<br>
push @newstopconds, $state->{'stopconds'}[$i];<br>
push @newvarbinds, $state->{'varbinds'}[$i];<br>
}<br>
<p><br>
</p>
<p>So it seems like somebody with some more knowledge will need to
have a look at this.<br>
</p>
<p>Thanks<br>
Jean-Louis<br>
</p>
</body>
</html>