Our net-snmp version is 5.4 There is no usage of HUP signal and higher level agent framework invokes net-snmp API, snmpd.c::netsnmp_reconfig(), after updating or creating new snmpd.conf. After this method call then snmpd is reloading snmpd.conf file and configuring the entries. I suspect this method is not correct as per the observed behavior.
Suppose an entry exists in snmpd.conf -- trapsess [std args] host1 and lets say its configuration as (data set -v1) Now trying to add a new host entry (host2) to the system then snmpd.conf will have all its current entries and additionally snmpd.conf will have (data set -v1) + trapsess [std args] host2 System will invoke snmpd.c::netsnmp_reconfig(). From this point the snmpd will send 2 (counter) traps for host1 for any event directed for host1 and this counter depends on how many times snmpd.conf is updated / added new entries. >From net-snmp wiki, http://www.net-snmp.org/docs/man/snmpd.conf.html, The Net-SNMP agent can be instructed to re-read the various configuration files, either via an *snmpset* assignment of integer <http://www.net-snmp.org/docs/man/integer.html>(1) to UCD-SNMP-MIB::versionUpdateConfig.0 (.1.3.6.1.4.1.2021.100.11.0), or by sending a *kill -HUP* signal to the agent process. I don't think we are doing either of this model and using only snmpd.c::netsnmp_reconfig() What model do you follow for updating? As per our design model, we can't send HUP signal and restart a process. Maanas On Thu, Aug 14, 2014 at 7:39 AM, Bill Fenner <fen...@gmail.com> wrote: > I would look into what snmpd does when it receives a HUP signal. > > You didn't mention what version of net-snmp you are using. It's possible > that there were some bugs that caused the behavior that you're observing. > Can you see if this behavior still happens with 5.7.2.pre5? > > Bill > > > On Wed, Aug 13, 2014 at 6:26 PM, maanas <sonlin...@gmail.com> wrote: > >> I really appreciate if someone could provide some input on their >> development model for configuring or updating snmpd.conf from the agent >> framework. Thank you. >> >> >> >> >> On Sat, Aug 9, 2014 at 12:25 PM, maanas <sonlin...@gmail.com> wrote: >> >>> Can you please advice what is the recommended method for configuring >>> snmpd.conf >>> >>> Issue: snmp agent is sending multiple traps for the same host(s) >>> >>> 1) lets start with valid working state where snmpd.conf has some basic >>> configuration (entries) and snmpd is up and running >>> 2) Want to perform some new configurations like adding / removing new >>> trap destination host IP addresses with trapsess / trap2sink entries to >>> snmpd.conf >>> 3) A new file snmpd.conf is completely rewritten with its current >>> entries and new configuration entries are added to the file (snmpd.conf) >>> and copy this file to snmpd.conf standard path which is read by snmp agent. >>> 4) Then call snmpd.c::netsnmp_reconfig() API to read new configuration >>> values. >>> 5) snmpd still runs and performs reconfigure steps using new >>> configuration file (which has old entries and as well as new entries). >>> 6) After the step 5 then system behaves incorrect. For any event / alarm >>> generated in the system then snmp agent sends more and more traps to the >>> same hosts and this count depends on how many times the configuration >>> changes are performed on snmpd.conf file >>> >>> This clearly indicates that the procedure followed is wrong and appears >>> that snmpd is learning same hosts addresses many times with snmpd.conf >>> entries? Should it suppose to learn and populate only 1 entry per host >>> while it configures and populates the snmpTargetAddrTable? Is there any >>> other parameters which does sending multiple traps? like repeater / retry >>> count etc? >>> >>> What is the correct way to create/update the configuration file for >>> adding / removing entries in snmpd.conf? I appreciate your help and any >>> inputs / pointers on this model. >>> >>> Thanks, >>> Maanas >>> >> >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Net-snmp-users mailing list >> Net-snmp-users@lists.sourceforge.net >> Please see the following page to unsubscribe or change other options: >> https://lists.sourceforge.net/lists/listinfo/net-snmp-users >> >> >
------------------------------------------------------------------------------
_______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users