From: SourceForge.net <no...@so...> - 2012-07-31 20:25:54
|
Patches item #3412939, was opened at 2011-09-22 08:41 Message generated for change (Comment added) made by hardaker You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3412939&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Julien Pinon (jpinon) >Assigned to: Wes Hardaker (hardaker) Summary: Repair tkmib Initial Comment: It seems that tkmib is broken since a long time. A git bisect shows that commit c80bce5 of perl/SNMP/SNMP.pm is the cause. I am not fluent in perl language, but here is a patch against master branch that fixes it. ---------------------------------------------------------------------- Comment By: Wes Hardaker (hardaker) Date: 2012-07-31 13:25 Message: Thanks for the patch! It has been applied to the 5.4.x and above code branches and the main development tree, and will appear in future releases of the Net-SNMP package. ---------------------------------------------------------------------- Comment By: Julien Pinon (jpinon) Date: 2011-09-26 12:34 Message: My system is a debian squeeze. It uses perl version 5.10.1. I tested my patch with net-snmp 5.3.4 as provided by squeeze, last version from git branch master, and tags 5.4.2, 5.4.3 and 5.4.7 from git repo. To ease debugging you should modify tkmib so that errors while loading SNMP module are not hidden. I do it this way : diff --git a/local/tkmib b/local/tkmib index aea22f3..5e02a45 100755 --- a/local/tkmib +++ b/local/tkmib @@ -6,7 +6,7 @@ require 5; # attempt to determine if they have the proper modules installed. # SNMP -my $havesnmp = eval {require SNMP;}; +require SNMP; # the Tk packages @@ -15,15 +15,6 @@ my $havetk = eval {require Tk; require Tk::HList; require Tk::FileSelect; require Tk::Dialog;}; -if (!$havesnmp) { - print " -ERROR: You don't have the SNMP perl module installed. Please obtain this by -getting the latest source release of the net-snmp toolkit from -http://www.net-snmp.org/download/ . The perl module is contained in -the perl/SNMP directory. See the INSTALL file there for -instructions. -"; -} if (!$havetk) { print " @@ -34,11 +25,6 @@ install this by running (as root): "; } -if (!$havetk || !$havesnmp) { - print "\n"; - exit; -} - if ($havetk) { # Tk doesn't seem to like require so we force use here. eval {import Tk; ---------------------------------------------------------------------- Comment By: reach2victor (reach2victor) Date: 2011-09-26 01:40 Message: hello jpinon, thanks for quick reply !. i have recompiled the perl module for net-snmp with your changes in SNMP.pm. I did not observe any change in the behavior. can you share what is Perl version and OS details you r using. (same commands what i shared earlier) when i did dive into file SNMP.xs. I found that your observations might be correct, warnings are coming from perl modules. <snippet> switch (mode) { case SNMP_XLATE_MODE_TAG2OID: if (!__tag2oid(var, NULL, oid_arr, &oid_arr_len, NULL, best_guess)) { if (verbose) warn("error: snmp_translate_obj:Unknown OID %s\n",var); } else { status = __sprint_num_objid(str_buf, oid_arr, oid_arr_len); } <snippet> google search on this topic, i observed that the issue faced by me is quite old and also observed irrepective of OS used. for example in bug#587828 in Debian. appreciate if someone can point me to any fix or clues to fix this issue. Regards, reach2victor ---------------------------------------------------------------------- Comment By: Julien Pinon (jpinon) Date: 2011-09-25 11:00 Message: Hi, I do not know what makes you think that the patch is not complete. As it is, it works for me, and tkmib displays correct value in GUI. The patch does not prevent tkmib to output some warnings on stderr, these came from the use of warnings in perl modules. ---------------------------------------------------------------------- Comment By: reach2victor (reach2victor) Date: 2011-09-24 11:36 Message: hello jpinon, thanks for your diff, i have not tested it. I think it is not complete diff. please share complete diff. whenever i use tkmib to poll any OID i get following message on console cli " error: snmp_translate_obj:Unknown OID .iso.org.dod.internet.mgmt.mib " however, reply from snmp agent is received by the machine. but is not displayed on tkmib GUI. but when i use CLI based snmp polling i get collect information for snmp oid. preliminary investigation points me to code SNMP.pm file. i hope your code fixes it. Here is the capture of the issue. [root@coddylinux ~]# tkmib setting opts error: snmp_translate_obj:Unknown OID .iso.org.dod.internet.mgmt.mib- error: snmp_translate_obj:Unknown OID .iso.org.dod.internet.mgmt.mib- [root@coddylinux ~]# [root@coddylinux ~]# snmpget --version NET-SNMP version: 5.6.1.1 [root@coddylinux ~]# perl -v This is perl, v5.8.8 built for i386-linux-thread-multi Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. [root@coddylinux ~]# [root@coddylinux perl]# uname -s -a -n -r -v -m -p -i -o --version uname (GNU coreutils) 5.97 Copyright (C) 2006 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. Written by David MacKenzie. [root@coddylinux perl]# let me know you need any other information. Regards, reach2victor ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=3412939&group_id=12694 |