From: SourceForge.net <no...@so...> - 2005-12-07 22:01:34
|
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-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 |