[SRU] COUNTER64 broken in NetSNMP::agent

Bug #406171 reported by Thomas Guyot-Sionnest on 2009-07-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Undecided
Unassigned
Hardy
Undecided
Chuck Short
Intrepid
Undecided
Chuck Short
Jaunty
Undecided
Chuck Short

Bug Description

Trying to use COUNTER64 in NetSNMP::agent doesn't work. This is a long-standing bug that has been fixed in SVN for 5.2.x, 5.3.x, 5.4.x and trunk last year.

I noticed this bug a while ago (it was already reported to net-snmp) and worked around it by using normal counters. Now it's fixed I'd like to use them to test some counter-specific functions. It would be awesome if the patch could get trough normal updates.

Note that Perl do not support 64bit integers ("long long" in C) out of the box, but Math::Int64 do and the value can be safely passed to NetSNMP::agent as a string.

See:
http://sourceforge.net/tracker/index.php?func=detail&aid=2022948&group_id=12694&atid=312694
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=17246

I attached the patch for the 5.4.x branch from SVN - from this URL:
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-4-patches/net-snmp/perl/agent/agent.xs?view=patch&r1=17246&r2=17245&pathrev=17246

Thomas Guyot-Sionnest (dermoth) wrote :
Chuck Short (zulcss) wrote :

Could you please include a sample test program with the expected results with and without the patch applied?

Thanks
chuck

Changed in net-snmp (Ubuntu):
status: New → Incomplete
Thomas Guyot-Sionnest (dermoth) wrote :

I didn't have any when I initially wrote this but I was writing an embedded agent for testing special behaviours in Nagios-plugins's check_snmp.

The easiest way to test is to take the latest nagios-plugins snapshot from http://repo.or.cz/w/nagiosplugins.git (there is a snapshot download link next to each shortlog entries), extract it, and from the "plugins" directory:
1. Run:
  perl tests/check_snmp.t -d &
it will output:
  Please contact SNMP at: NNNNN
This is the port to use in the next command

2. Run: (replace NNNNN with the port returned by he 1st command)
  snmpget -v2c -cpublic localhost:NNNNN .1.3.6.1.4.1.8072.3.2.67.4

On the first poll it should return "Counter64: 18446744073709351616"

If you have Math::Int64 you can enable it in tests/check_snmp_agent.pl (uncomment the use line and comment out the dummy sub under it and restart check_snmp.t) and each subsequent poll on this OID should return the last polled value +100000 until the counter roll over and restart from 0 (there is a similar behaviour with Counter32 on the .3 oid).

If you don't have the module the value will be interpreted as a regular number after the first poll and since Perl do not support "long long" internally the results are unpredictable (they are predictable on the first run as the data is still a string).

Changed in net-snmp (Ubuntu):
status: Incomplete → New
Chuck Short (zulcss) wrote :

What version of net-snmp are you running?

Regards

Thomas Guyot-Sionnest (dermoth) wrote :

Latest from hardy-updates:

snmpget --version:
NET-SNMP version: 5.4.1

apt-cache show snmp:
Architecture: amd64
Source: net-snmp
Version: 5.4.1~dfsg-4ubuntu4.2

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.4.1~dfsg-12ubuntu5

---------------
net-snmp (5.4.1~dfsg-12ubuntu5) karmic; urgency=low

  * debian/patches/99-fix-perl-counter-in-subagent.patch: Fix for Counter64 in
    perl subagent. (LP: #406171)

 -- Chuck Short <email address hidden> Fri, 04 Sep 2009 12:10:01 -0500

Changed in net-snmp (Ubuntu):
status: New → Fix Released
Chuck Short (zulcss) on 2009-09-16
Changed in net-snmp (Ubuntu Hardy):
assignee: nobody → Chuck Short (zulcss)
Changed in net-snmp (Ubuntu Intrepid):
assignee: nobody → Chuck Short (zulcss)
Changed in net-snmp (Ubuntu Jaunty):
assignee: nobody → Chuck Short (zulcss)
Chuck Short (zulcss) wrote :

Statement of Impact:

Users trying to use NetSNMP::agent are unable to do so because Counter64 is broken.

How the bug has been addressed:

This bug has been addressed in the SVN tree for net-snmp (http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-4-patches/net-snmp/perl/agent/agent.xs?view=patch&r1=17246&r2=17245&pathrev=17246). I have backported this patch for Karmic and have not backported for Hardy,Intrepid, and Jaunty. The patch is attached.

How to reproduce:

See above in comment #3

Impact:

There should be no regressions with this patch.

summary: - COUNTER64 broken in NetSNMP::agent
+ [SRU] COUNTER64 broken in NetSNMP::agent
Martin Pitt (pitti) wrote :

Would have been nice to not have the .xs.orig in the patch (which makes it huge), but it seems harmless.

Changed in net-snmp (Ubuntu Jaunty):
status: New → Fix Committed
Martin Pitt (pitti) wrote :

Accepted net-snmp into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Martin Pitt (pitti) wrote :

Accepted net-snmp into hardy-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in net-snmp (Ubuntu Hardy):
status: New → Fix Committed
Martin Pitt (pitti) wrote :

Accepted net-snmp into intrepid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in net-snmp (Ubuntu Intrepid):
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.4.1~dfsg-12ubuntu3.1

---------------
net-snmp (5.4.1~dfsg-12ubuntu3.1) jaunty-proposed; urgency=low

  * debian/patches/101-fix-ipalias.patch: Fix flooding syslog -
     Syslog fills with hundreds of these errors if you have a network
     interface, e.g. eth2, with no IP address, but you have an alias,
     e.g. eth2:1, that does have an IP address (and netmask).
     (LP: #270713)
  * debian/patches/103-fix-ubuntu-lmsensors.patch: Point to the right
     place for /etc/sensors3.conf. (LP: #192745)
  * debian/patches/99-fix-perl-counter-in-subagent.patch: Fix for Counter64 in
     perl subagent. (LP: #406171)

 -- Chuck Short <email address hidden> Tue, 15 Sep 2009 15:53:48 -0400

Changed in net-snmp (Ubuntu Jaunty):
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

Jaunty update was tested in bug 270713. Keeping v-needed for hardy/intrepid.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.4.1~dfsg-4ubuntu4.3

---------------
net-snmp (5.4.1~dfsg-4ubuntu4.3) hardy-proposed; urgency=low

  * debian/patches/101-fix-ipalias.patch: Fix flooding syslog -
    Syslog fills with hundreds of these errors if you have a network
    interface, e.g. eth2, with no IP address, but you have an alias,
    e.g. eth2:1, that does have an IP address (and netmask).
    (LP: #270713)
  * debian/patches/103-fix-ubuntu-lmsensors.patch: Point to the right
    place for /etc/sensors3.conf. (LP: #192745)
  * debian/patches/99-fix-perl-counter-in-subagent.patch: Fix for Counter64 in
    perl subagent. (LP: #406171)
  * debian/patches/53_fix_python_regression.patch: Fix python segmentation fault.
    (LP: #347361)
  * debian/patches/54_fix_registration_error.patch: Surpresses annoying
    registrations in startup. (LP: #200614)

 -- Chuck Short <email address hidden> Tue, 15 Sep 2009 14:13:51 -0400

Changed in net-snmp (Ubuntu Hardy):
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

Hardy update was tested in bug 200614.

Martin Pitt (pitti) wrote :

Anyone who can test the package in intrepid-proposed and confirm that it still works and fixes the issue? Otherwise it will be removed from -proposed again.

Martin Pitt (pitti) wrote :

This intrepid-proposed SRU has not been verified in the last three months or longer. Intrepid will go out of support in less than two months, so it is not worth pursuing this SRU any further.

I removed the intrepid-proposed version from the archive.

Changed in net-snmp (Ubuntu Intrepid):
status: Fix Committed → Won't Fix
AlexanderYT (arcam) wrote :

I confirm this bug in Lucid. The net-snmp package does not contain this patch http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-4-patches/net-snmp/perl/agent/agent.xs?view=patch&r1=17246&r2=17245&pathrev=17246 . After apply this patch, issue was fixed.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers