Description of problem: The "sysObjectID" scalar MIB object (.1.3.6.1.2.1.1.2.0) conveys what kind of device one is talking to via SNMP. The correct value for a Net-SNMP agent on GNU/Linux is ".1.3.6.1.4.1.8072.3.2.10", but a bug in the Net-SNMP 5.5 code causes this value always to be truncated to ".1.3". The result is that SNMP management applications (e.g. OpenNMS) are unable to determine from the sysObjectID that they're in fact talking to a Net-SNMP agent at all, let alone one running on Linux. Version-Release number of selected component (if applicable): 5.5-20 (and all previous releases of 5.5) How reproducible: Always Steps to Reproduce: 1. Install package "net-snmp" and start service "snmp" 2. Run "snmpget -On -v1 -c public localhost sysObjectID.0" Actual results: [jeffg@rawhide ~]$ snmpget -On -v1 -c public localhost sysObjectID.0 .1.3.6.1.2.1.1.2.0 = OID: .1.3 Expected results: [jeffg@mephesto ~]$ snmpget -On -v1 -c public localhost sysObjectID.0 .1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.8072.3.2.10 Additional info: This bug is fixed in upstream Subversion trunk and upstream version 5.6 release candidates. It's a one-line fix, which I'll attach as soon as I know the ID of this bug.
Created attachment 451997 [details] Proposed patch to fix sysObjectID truncation bug This patch should apply cleanly to all releases up to and including 20 of version 5.5 of this package.
This problem affects Fedora 13, Fedora 14 beta, rawhide, and RHEL 6 beta. I'm happy to provide more information as needed; this is my first bug report in this tracker, so please let me know if I've broken any conventions.
A bit more information as suggested by fenris02 in #bugzappers: I'm actually running FC13; my assertion above that the problem affects other releases is based on downloading the net-snmp SRPM associated with each of those releases and inspecting the source and patches contained within. [root@ip6test ~]# rpm -q net-snmp net-snmp-5.5-16.fc13.i686
The initial report states that the sysObjectID always comes out as ".1.3"; this is true on 32-bit i386 installs of F13. On an x86_64 install, the sysObjectID comes out instead as ".0.1": [root@f13-64 ~]# rpm -q net-snmp net-snmp-5.5-16.fc13.x86_64 [root@f13-64 ~]# snmpget -On -v1 -c public localhost sysObjectID.0 .1.3.6.1.2.1.1.2.0 = OID: .0.1
The attached patch isn't quite sufficient (in fact it doesn't apply cleanly) so I'm doing more research on the upstream revisions that do actually comprise a fix, starting with the list of revisions since the 5.5 release that affect agent/mibgroups/mibII/system_mib.c (which was at r17596 at the time of 5.5 release) and ending at the HEAD of current upstream Subversion trunk (r19399): r17825 [NO-OP] Commit message: "CHANGES: snmpd: BUG: 2900078: Add support for OID variables with size in elements instead of bytes, correct sysObjectID to use this." Notes on Fedora bug report: The sole non-whitespace change to system_mib.c in this commit is backed out later in r19382. Changes in this commit external to system_mib.c are therefore orthogonal to this bug report. In short, this revision is a no-op for the purposes of the problem at hand. r18016 [IGNORE] (Long commit message describing MinGW build fixes) Notes on Fedora bug report: The MinGW compilation fixes in this revision are immaterial for purposes of Fedora / RHEL bug reporting, so this revision is a no-op. r19322 [KEEP] Commit message: "CHANGES: snmpd: PATCH: 3044512: from philwebster: fix sysobjectid directive." Notes on Fedora bug report: This rev affects only system_mib.c. One of its changes is subsequently changed again in r19371, but the balance should be retained. r19371 [KEEP] Commit message: "Fixed a compiler warning that was introduced in r19322 (patch 3044512). The third argument passed to read_objid() was an int instead of size_t. This could have caused memory corruption on 64-bit systems." Notes on Fedora bug report: This rev affects only system_mib.c and is a straightforward type fix as described in commit message. r19382 [NO-OP] Commit message: "Patch from Fulko Hew to fix patch 2900078 which broke sysObjectID lengths" Notes on Fedora bug report: This rev affects only system_mib.c and backs out the sole non-whitespace change to that file in r17825, rendering this rev a no-op for our purposes. Attaching a new patch that represents the balance of all the upstream changes discussed above, and which I've verified applies cleanly, compiles, and corrects the problem described in this bug.
Created attachment 452222 [details] Updated proposed patch to fix sysObjectID truncation bug See Comment 5 for my methodology for arriving at this patch. Verified that adding this patch to release 12 of this package's spec file and rebuilding does fix the problem.
Thanks for detailed bug report and patch, I have reproduced the bug locally.
net-snmp-5.5-17.fc13 has been submitted as an update for Fedora 13. https://admin.fedoraproject.org/updates/net-snmp-5.5-17.fc13
net-snmp-5.5-21.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/net-snmp-5.5-21.fc14
Thank you, Jan! I just realized that apart from an inter-bug link, there's no mention in this report of Bug 641113 which describes exactly the same issue in RHEL 6, so here's a mention :) -jeff
net-snmp-5.5-17.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update net-snmp'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/net-snmp-5.5-17.fc13
net-snmp-5.5-17.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
net-snmp-5.5-21.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.