On Fri, Sep 13, 2019 at 1:42 AM Krishna Vivek Vitta <
krishna.vivekvi...@citrix.com> wrote:

> Hi Bill,
>
>
>
> Can we differentiate if snmpd has been subjected to coldStart or warmStart
> ? Are there ways to check if snmpd.conf has been reloaded ?
>

The reason it's not done now is because the structure of the configuration
code does not really lend itself to discovering whether or not something
has changed.  Of course, anything's possible if you set your mind to it -
many of the configuration read routines are written as "delete all the old
config and then read from the file", and they would have to be written,
"read the file, mark anything that's changed, then delete any old config
that wasn't still in the file" - and then at the end you could know that
you only have to set a warmStart trap if anything is marked as changed or
deleted.  However, this work has not been important enough for anyone to
have contributed code for it.  Maybe HCL will!  ;-)

The frequency of the trap is daily once during the same time.
>

As I've said both in both threads on this topic, this is completely
consistent with it being due to logrotate.


> Also as Kiran mentioned, Is there any impact by commenting the code to
> raise the trap ?
>

This sounds like a strange question because the answer is basically the
question: the code that sends the trap will not run.  The trap receiver(s)
will not receive a notification that the agent (may have been)
reconfigured/restarted.

  Bill


>  *From:* Bill Fenner <fen...@gmail.com>
> *Sent:* 12 September 2019 03:28
> *To:* Kiran Kumar Pamula -X (kpamula - HCL TECHNOLOGIES LIMITED at Cisco)
> <kpam...@cisco.com>
> *Cc:* Naresh Pindukuru -X (narpindu - HCL TECHNOLOGIES LIMITED at Cisco) <
> narpi...@cisco.com>; Appandainathan Ayyannan -X (aayyanna - HCL
> TECHNOLOGIES LIMITED at Cisco) <aayya...@cisco.com>;
> net-snmp-users@lists.sourceforge.net
> *Subject:* Re: Some general questions on netsnmp_logging_restart
>
>
>
> On Tue, Sep 10, 2019 at 1:06 AM Kiran Kumar Pamula -X (kpamula - HCL
> TECHNOLOGIES LIMITED at Cisco) via Net-snmp-users <
> net-snmp-users@lists.sourceforge.net> wrote:
>
> Hi Experts,
>
>
>
> Could you please help me with below questions in the below part of
> net-snmp code:
>
>
>
> File: net-snmp
> <https://wwwin-opengrok.cisco.com/643c/xref/obj/vendor-built/tmp/work/x86_64-montavista-linux/net-snmp/>
> /5.7.3-r5.0
> <https://wwwin-opengrok.cisco.com/643c/xref/obj/vendor-built/tmp/work/x86_64-montavista-linux/net-snmp/5.7.3-r5.0/>
> /net-snmp-5.7.3
> <https://wwwin-opengrok.cisco.com/643c/xref/obj/vendor-built/tmp/work/x86_64-montavista-linux/net-snmp/5.7.3-r5.0/net-snmp-5.7.3/>
> /agent
> <https://wwwin-opengrok.cisco.com/643c/xref/obj/vendor-built/tmp/work/x86_64-montavista-linux/net-snmp/5.7.3-r5.0/net-snmp-5.7.3/agent/>
> /snmpd.c
> <https://wwwin-opengrok.cisco.com/643c/xref/obj/vendor-built/tmp/work/x86_64-montavista-linux/net-snmp/5.7.3-r5.0/net-snmp-5.7.3/agent/snmpd.c>
>
>
>
> 1199  static int
>
> 1200  receive(void)
>
> 1201  {
>
> ..
>
> ..
>
> 1233              snmp_log(LOG_INFO, "Reconfiguring daemon\n");
>
> 1234          /*  Stop and restart logging.  This allows logfiles to be
>
> 1235                      rotated etc.  */
>
> 1236          netsnmp_logging_restart();
>
> 1237          snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n",
>
> 1238                           netsnmp_get_version());
>
> 1239              update_config();
>
> 1240              send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3);
>
> ..
>
> ..
>
> }
>
>    1. In line 1237, log points to “NET-SNMP version 5.7.3 restarted”, but
>    in actual, it is net-snmp logger that gets restarted here.
>
> Hence the above message needs to be changed accordingly so that it doesn’t
> annoy customers !!
>
> Am I right ?
>
> Line 1239 updates the config.  The log message is meant to convey that the
> agent is restarted with the new config.
>
>
>
>    1. In line 1240, why a trap is being sent just for a snmp logging
>    restart ?
>
> Is this trap really need here as snmp process is not actually getting
> restarted ?
>
> Can this line be commented out ? And what is the impact if so.
>
> The trap is not being sent just for snmp logging restart.  It is sent
> because the config is being reloaded.
>
>
>
> This trap is sent because net-snmp doesn't know if it should send
> warmStart or not.  See the page I sent to Krishna in the thread
> "nsNotifyRestart traps" for more discussion.
>
>
>
>   Bill
>
>
>
_______________________________________________
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
  • ... Kiran Kumar Pamula -X (kpamula - HCL TECHNOLOGIES LIMITED at Cisco) via Net-snmp-users
    • ... Kiran Kumar Pamula -X (kpamula - HCL TECHNOLOGIES LIMITED at Cisco) via Net-snmp-users
      • ... Kiran Kumar Pamula -X (kpamula - HCL TECHNOLOGIES LIMITED at Cisco) via Net-snmp-users
        • ... Bill Fenner
          • ... Krishna Vivek Vitta
            • ... Bill Fenner

Reply via email to