RE: Some general questions on netsnmp_logging_restart

Krishna Vivek Vitta <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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 frequency of the trap is daily once during the same time.
Also as Kiran mentioned, Is there any impact by commenting the code to raise the trap ?

Thank you
Krishna Vivek

From: Bill Fenner <[email protected]>
Sent: 12 September 2019 03:28
To: Kiran Kumar Pamula -X (kpamula - HCL TECHNOLOGIES LIMITED at Cisco) <[email protected]>
Cc: Naresh Pindukuru -X (narpindu - HCL TECHNOLOGIES LIMITED at Cisco) <[email protected]>; Appandainathan Ayyannan -X (aayyanna - HCL TECHNOLOGIES LIMITED at Cisco) <[email protected]>; [email protected]
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 <[email protected]<mailto:[email protected]>> 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
[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.