File net-snmp-5.6.1-log-agentx-disconnections.patch of Package net-snmp.openSUSE_11.4_Update
commit 1be8cf08a67a91855fee1ec4a2d8e087c7812456
Author: Dave Shield <D.T.Shield@liverpool.ac.uk>
Date: Tue Dec 27 18:04:10 2011 +0000
CHANGES: agentx: PATCHES: 3445437: Log AgentX disconnections
(in line with connections) Patch provided by Bill Fenner
Index: net-snmp-5.6.1/agent/mibgroup/agentx/subagent.c
===================================================================
--- net-snmp-5.6.1.orig/agent/mibgroup/agentx/subagent.c
+++ net-snmp-5.6.1/agent/mibgroup/agentx/subagent.c
@@ -286,8 +286,10 @@ handle_agentx_packet(int operation, nets
* agentx_reopen_session unregisters itself if it succeeds in talking
* to the master agent.
*/
- snmp_alarm_register(period, SA_REPEAT, agentx_reopen_session,
- NULL);
+ snmp_alarm_register(period, SA_REPEAT, agentx_reopen_session, NULL);
+ snmp_log(LOG_INFO, "AgentX master disconnected us, reconnecting in %d\n", period);
+ } else {
+ snmp_log(LOG_INFO, "AgentX master disconnected us, not reconnecting\n");
}
return 0;
} else if (operation != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {