Duplicate index in target/usm mibs when doing a reconfigure with SIGHUP

"Miller, Jeff (eng)" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
If I change my snmpd.conf file and then use SIGHUP to snmpd to get it to
reconfigure, it results in "duplicate index" errors getting logged.  It
also appears that the data structures associated with the mibs are
messed up as a walk results in an "OID not increasing" error.  If I look
at the persistent file I also see that the snmpNotifyTable and
snmpNotifyFilterProfileTable persistent lines are in fact duplicated.
At one point I saw something like this when playing with the usm/vacm
configuration so I think it was a problem there as well.

If I look at the code for the target mib I see that it only registers to
save and load configuration information.  It does not register for a
pre-load like the notification mib does.  The notification mib seems to
work correctly and I think this is because it gets called by the
pre-load callback to free its structures prior to loading of the
persistent information.  I think the target mib has duplicate index
values because it does not have a chance to free its previous
information and because it does not validate before adding re-read
persistent information to its structures.  Does this make sense?  If so,
is there a patch or workaround that people are using to avoid the
problem?

BTW: I also tried setting the boolean
NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD to TRUE after initially starting
to see if that might cause the target mib from getting called during the
reconfiguration and this did not seem to help.

Jeff

The errors look like this:
  Jan 17 07:13:57 ccndev1 daemon.info snmpd[1020]: Reconfiguring daemon 
  Jan 17 07:13:57 ccndev1 daemon.info snmpd[1020]: NET-SNMP version
5.3.1 restarted 
  Jan 17 07:14:02 ccndev1 daemon.info snmpd[1020]: Turning on AgentX
master support. 
  Jan 17 07:14:02 ccndev1 daemon.warn snmpd[1020]:
header_complex_add_data_by_oid with duplicate index. 
  Jan 17 07:14:02 ccndev1 daemon.warn snmpd[1020]:
header_complex_add_data_by_oid with duplicate index. 
  Jan 17 07:14:02 ccndev1 daemon.err snmpd[1020]: error on subcontainer
'' insert (-1) 

  > snmpwalk ccndev1 .1.3.6.1.6.3.13.1
  SNMP-NOTIFICATION-MIB::snmpNotifyTag.'NotifyTarget1' = STRING:
NotifyTag1
  SNMP-NOTIFICATION-MIB::snmpNotifyTag.'NotifyTarget1' = STRING:
NotifyTag1
  Error: OID not increasing:
SNMP-NOTIFICATION-MIB::snmpNotifyTag.'NotifyTarget1'
  >= SNMP-NOTIFICATION-MIB::snmpNotifyTag.'NotifyTarget1'

And the persistent snmpd.conf file contains this:
  setserialno 2098080508
  snmpNotifyTable  "NotifyTarget1" "NotifyTag1" 1 3 1
  snmpNotifyTable  "NotifyTarget1" "NotifyTag1" 1 3 1 
  snmpNotifyFilterProfileTable  "TargetParams1" "NotifyProfile1" 3 1 
  snmpNotifyFilterProfileTable  "TargetParams1" "NotifyProfile1" 3 1
  targetAddr TargetAddr1 .1.3.6.1.6.1.1 0x9be22bee00a2 1500 3
"NotifyTag1" TargetParams1 3 1
  targetParams TargetParams1 0 1 public 1 3 1

  ##############################################################
  # 
  # snmpNotifyFilterTable persistent data
  #
  snmpNotifyFilterTable
.14.78.111.116.105.102.121.80.114.111.102.105.108.101.49.1.3.6.1.4.1.201
4.13.1.0 2:0x 3:2 4:3 5:1 $
  ##############################################################

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.