From: SourceForge.net <no...@so...> - 2005-12-08 13:13:46
|
Bugs item #1374483, was opened at 2005-12-06 04:56 Message generated for change (Comment added) made by chris_nelson You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1374483&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: apps Group: None Status: Open Resolution: Works For Me Priority: 3 Submitted By: Christopher Nelson (chris_nelson) Assigned to: Nobody/Anonymous (nobody) Summary: v5.2.2 snmpget, set complain about index type for ifIndex Initial Comment: In v5.2.2, attempting to access a table indexed by ifIndex (and perhaps any derived type) gives an error message: # snmpget -v 2c -c public ipm RFC1213-MIB::ifIndex.1 Unexpected index type: 0 ifIndex 1 RFC1213-MIB::ifIndex.1 = INTEGER: 1 Sets to rows of tables indexed by such values appear to succeed but don't take effect. I've instrumented my table handler and the set routine in the agent doesn't get called. # snmpset -v 2c -c private ipm SIXNET-MIB::ifAdminPower.1 i 2 Unexpected index type: 0 ifIndex 1 SIXNET-MIB::ifAdminPower.1 = INTEGER: down(2) # snmpget -v 2c -c private ipm SIXNET-MIB::ifAdminPower.1 Unexpected index type: 0 ifIndex 1 SIXNET-MIB::ifAdminPower.1 = INTEGER: up(1) (I can't show it here very well but I've put snmp_log() statements in my table handler in the get and set routines and the get shows up in the log but the set does not.) This worked in v5.1.1. ---------------------------------------------------------------------- >Comment By: Christopher Nelson (chris_nelson) Date: 2005-12-08 04:13 Message: Logged In: YES user_id=107514 > Is this with 5.2.2? Yes. > Please run snmpget with "-Dparse-mibs,read_config" to see what config files and MIBs it reads. ~1k lines of log attached. > Post the content of the configuration files None that seem to be reported in the attached log. Shouldn't it process /usr/share/snmp/snmpd.conf by default? > and verify whether RFC1213-MIB is the version shipped with 5.2.2. Would the MIB have changed? It has a timestamp consistent with when I last installed v5.2.2. In /usr/share/snmp/mibs and where I untarred and built v5.2.2 I see: # md5sum /usr/share/snmp/mibs/RFC1213-MIB.txt f05e4af8c75fb4c416412ef7fcc919e2 /usr/share/snmp/mibs/RFC1213-MIB.txt # md5sum /home/chrisn/snmp/net-snmp-5.2.2/mibs/RFC1213-MIB.txt f05e4af8c75fb4c416412ef7fcc919e2 /home/chrisn/snmp/net-snmp-5.2.2/mibs/RFC1213-MIB.txt ---------------------------------------------------------------------- Comment By: Thomas Anders (tanders) Date: 2005-12-08 03:41 Message: Logged In: YES user_id=848638 Is this with 5.2.2? Please run snmpget with "-Dparse-mibs,read_config" to see what config files and MIBs it reads. Post the content of the configuration files and verify whether RFC1213-MIB is the version shipped with 5.2.2. ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2005-12-08 03:36 Message: Logged In: YES user_id=107514 I rebuilt with: # ./configure --prefix=/usr # make # make install and then I still get: # snmpget -v 2c -c public ipm RFC1213-MIB::ifIndex.1 Unexpected index type: 0 ifIndex 1 RFC1213-MIB::ifIndex.1 = INTEGER: 1 FWIW: # uname -a Linux eng8 2.4.18-3smp #1 SMP Thu Apr 18 06:59:55 EDT 2002 i686 unknown # gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110) ---------------------------------------------------------------------- Comment By: Thomas Anders (tanders) Date: 2005-12-07 13:39 Message: Logged In: YES user_id=848638 I tested exactly like you proposed: snmpget -v2c -c foobar localhost RFC1213-MIB::ifIndex.1. Again, this works fine for a stock 5.2.2 or 5.3.pre5 build. Can you retest this on a local machine with a default build (plain ./configure)? ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2005-12-07 11:11 Message: Logged In: YES user_id=107514 How did you test? It seems to only happen with certain tables. Specifically, I know it happens with ifIndex (as in RFC1213-MIB::ifIndex.1). FWIW, my configure options are: ./configure --prefix=/usr --target=powerpc-linux --host=powerpc-linux --build=i386-pc-linux --with-openssl=/usr/local/ssl/bin --with-endianness=big --with-cc=powerpc-linux-gcc --with-ar=powerpc-linux-ar --with-install-prefix=/IPm --with-cflags="-O2" --enable-applications --disable-mib-loading --disable-scripts --with-sys-location="Blah" --with-sys-contact="Blah" --with-logfile="/var/log/snmpd.log" --with-default-snmp-version="3" --with-persistent-directory="/var/net-snmp" ---------------------------------------------------------------------- Comment By: Thomas Anders (tanders) Date: 2005-12-07 11:07 Message: Logged In: YES user_id=848638 Sorry, I don't get this message with stock CVS MAIN or V5-2-patches on Linux/x86. Looks like being special to your setup. ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2005-12-06 07:33 Message: Logged In: YES user_id=107514 Failure to set was my bad. I added a column and didn't get my table handler right. That's working now. The erroneous Unexpected index type message is still a pain. ---------------------------------------------------------------------- Comment By: Christopher Nelson (chris_nelson) Date: 2005-12-06 05:21 Message: Logged In: YES user_id=107514 I've simplified my table handler a lot to just access a static array: static long power[MAX_IF]; long* get_testAdminPower(void *data_context, size_t *ret_len) { long port; port = ctx2port(data_context); snmp_log(LOG_DEBUG, "<<GET power for %ld, value is %ld\n", port, power[port]); *ret_len = sizeof(long); return &power[port]; } int set_testAdminPower(void *data_context, long *val, size_t val_len) { long port; port = ctx2port(data_context); snmp_log(LOG_DEBUG, ">>SET power for %ld, new value is %ld\n", port, *val); power[port] = *val; return SNMP_ERR_NOERROR; } and I see this: # snmpget -v 2c -c private ipm SIXNET-MIB::ifAdminPower.1 Unexpected index type: 0 ifIndex 1 SIXNET-MIB::ifAdminPower.1 = INTEGER: unknown(0) # snmpset -v 2c -c private ipm SIXNET-MIB::ifAdminPower.1 i 2 Unexpected index type: 0 ifIndex 1 SIXNET-MIB::ifAdminPower.1 = INTEGER: down(2) # snmpget -v 2c -c private ipm SIXNET-MIB::ifAdminPower.1 Unexpected index type: 0 ifIndex 1 SIXNET-MIB::ifAdminPower.1 = INTEGER: unknown(0) and my log contains: <<GET power for 1, value is 0 <<GET power for 1, value is 0 <<GET power for 1, value is 0 <<GET power for 1, value is 0 *NO* calls of the set routine! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1374483&group_id=12694 |